VTK  9.4.20241218
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
135#ifndef vtkImageReader2Factory_h
136#define vtkImageReader2Factory_h
137
138#include "vtkIOImageModule.h" // For export macro
139#include "vtkObject.h"
140
141VTK_ABI_NAMESPACE_BEGIN
142class vtkImageReader2;
144class vtkImageReader2FactoryCleanup;
145
146class VTKIOIMAGE_EXPORT vtkImageReader2Factory : public vtkObject
147{
148public:
151 void PrintSelf(ostream& os, vtkIndent indent) override;
152
158
165 static vtkImageReader2* CreateImageReader2(const char* path);
166
175 static vtkImageReader2* CreateImageReader2FromExtension(const char* extension);
176
182
183 /*
184 * An utility method to check if a (dotted or not) file extension is present
185 * in a list a whitespace separated list of dotted file extensions
186 */
187 static bool CheckExtensionIsInExtensions(const char* extension, const char* extensions);
188
189protected:
191 ~vtkImageReader2Factory() override = default;
192
193 static void InitializeReaders();
194
195private:
196 static vtkImageReader2Collection* AvailableReaders;
198 void operator=(const vtkImageReader2Factory&) = delete;
199
200 friend class vtkImageReader2FactoryCleanup;
201};
202
203VTK_ABI_NAMESPACE_END
204#endif
maintain a list of image readers
Superclass of binary file readers.
static bool CheckExtensionIsInExtensions(const char *extension, const char *extensions)
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 vtkImageReader2Factory * New()
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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
#define VTK_NEWINSTANCE