VTK  9.2.6
vtkImageReader2Factory.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageReader2Factory.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
147#ifndef vtkImageReader2Factory_h
148#define vtkImageReader2Factory_h
149
150#include "vtkIOImageModule.h" // For export macro
151#include "vtkObject.h"
152
153class vtkImageReader2;
155class vtkImageReader2FactoryCleanup;
156
157class VTKIOIMAGE_EXPORT vtkImageReader2Factory : public vtkObject
158{
159public:
162 void PrintSelf(ostream& os, vtkIndent indent) override;
163
169
176 static vtkImageReader2* CreateImageReader2(const char* path);
177
186 static vtkImageReader2* CreateImageReader2FromExtension(const char* extension);
187
193
194 /*
195 * An utility method to check if a (dotted or not) file extension is present
196 * in a list a whitespace separated list of dotted file extensions
197 */
198 static bool CheckExtensionIsInExtensions(const char* extension, const char* extensions);
199
200protected:
202 ~vtkImageReader2Factory() override = default;
203
204 static void InitializeReaders();
205
206private:
207 static vtkImageReader2Collection* AvailableReaders;
209 void operator=(const vtkImageReader2Factory&) = delete;
210
211 friend class vtkImageReader2FactoryCleanup;
212};
213
214#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:119
abstract base class for most VTK objects
Definition: vtkObject.h:79
#define VTK_NEWINSTANCE