VTK  9.3.0
vtkImageReader2Factory.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
35 #ifndef vtkImageReader2Factory_h
36 #define vtkImageReader2Factory_h
37 
38 #include "vtkIOImageModule.h" // For export macro
39 #include "vtkObject.h"
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkImageReader2;
44 class vtkImageReader2FactoryCleanup;
45 
46 class VTKIOIMAGE_EXPORT vtkImageReader2Factory : public vtkObject
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
58 
65  static vtkImageReader2* CreateImageReader2(const char* path);
66 
75  static vtkImageReader2* CreateImageReader2FromExtension(const char* extension);
76 
82 
83  /*
84  * An utility method to check if a (dotted or not) file extension is present
85  * in a list a whitespace separated list of dotted file extensions
86  */
87  static bool CheckExtensionIsInExtensions(const char* extension, const char* extensions);
88 
89 protected:
91  ~vtkImageReader2Factory() override = default;
92 
93  static void InitializeReaders();
94 
95 private:
96  static vtkImageReader2Collection* AvailableReaders;
98  void operator=(const vtkImageReader2Factory&) = delete;
99 
100  friend class vtkImageReader2FactoryCleanup;
101 };
102 
103 VTK_ABI_NAMESPACE_END
104 #endif
maintain a list of image readers
Superclass of binary file readers.
static bool CheckExtensionIsInExtensions(const char *extension, const char *extensions)
static vtkImageReader2Factory * New()
static void InitializeReaders()
static void GetRegisteredReaders(vtkImageReader2Collection *)
The caller must allocate the vtkImageReader2Collection and pass in the pointer to this method.
vtkImageReader2Factory()=default
~vtkImageReader2Factory() override=default
static void RegisterReader(vtkImageReader2 *r)
registered readers will be queried in CreateImageReader2 to see if they can load a given file.
static vtkImageReader2 * CreateImageReader2FromExtension(const char *extension)
Create a vtkImageReader2 from a (dotted or not) file extension.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkImageReader2 * CreateImageReader2(const char *path)
open the image file, it is the callers responsibility to call Delete on the returned object.
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
#define VTK_NEWINSTANCE