VTK  9.3.20240327
vtkMNIObjectReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) 2006 Atamai, Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
24 #ifndef vtkMNIObjectReader_h
25 #define vtkMNIObjectReader_h
26 
27 #include "vtkIOMINCModule.h" // For export macro
28 #include "vtkPolyDataAlgorithm.h"
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkProperty;
32 class vtkPolyData;
33 class vtkFloatArray;
34 class vtkIntArray;
35 class vtkPoints;
36 class vtkCellArray;
37 
38 class VTKIOMINC_EXPORT vtkMNIObjectReader : public vtkPolyDataAlgorithm
39 {
40 public:
42 
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
53 
57  virtual const char* GetFileExtensions() { return ".obj"; }
58 
62  virtual const char* GetDescriptiveName() { return "MNI object"; }
63 
67  virtual int CanReadFile(VTK_FILEPATH const char* name);
68 
72  virtual vtkProperty* GetProperty() { return this->Property; }
73 
74 protected:
76  ~vtkMNIObjectReader() override;
77 
78  char* FileName;
80  int FileType;
81 
82  istream* InputStream;
84  char* LineText;
85  char* CharPointer;
86 
87  int ReadLine(char* text, unsigned int length);
91 
92  int ReadNumberOfPoints(vtkIdType* numCells);
93  int ReadNumberOfCells(vtkIdType* numCells);
94  int ReadProperty(vtkProperty* property);
96  int ReadPoints(vtkPolyData* polyData, vtkIdType numPoints);
97  int ReadNormals(vtkPolyData* polyData, vtkIdType numPoints);
98  int ReadColors(vtkProperty* property, vtkPolyData* data, vtkIdType numPoints, vtkIdType numCells);
99  int ReadCells(vtkPolyData* data, vtkIdType numCells, int cellType);
100 
103 
104  virtual int ReadFile(vtkPolyData* output);
105 
107  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
108 
109 private:
110  vtkMNIObjectReader(const vtkMNIObjectReader&) = delete;
111  void operator=(const vtkMNIObjectReader&) = delete;
112 };
113 
114 VTK_ABI_NAMESPACE_END
115 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:285
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:144
A reader for MNI surface mesh files.
int ReadLine(char *text, unsigned int length)
int RequestData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
This is called by the superclass.
int ReadNormals(vtkPolyData *polyData, vtkIdType numPoints)
int ReadNumberOfPoints(vtkIdType *numCells)
virtual const char * GetDescriptiveName()
Get the name of this file format.
int ParseValues(vtkDataArray *array, vtkIdType n)
int ReadCells(vtkPolyData *data, vtkIdType numCells, int cellType)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ReadColors(vtkProperty *property, vtkPolyData *data, vtkIdType numPoints, vtkIdType numCells)
virtual int CanReadFile(VTK_FILEPATH const char *name)
Test whether the specified file can be read.
int ReadLineThickness(vtkProperty *property)
int ParseIdValue(vtkIdType *value)
~vtkMNIObjectReader() override
int ReadPoints(vtkPolyData *polyData, vtkIdType numPoints)
virtual vtkProperty * GetProperty()
Get the property associated with the object.
int ReadNumberOfCells(vtkIdType *numCells)
int ReadProperty(vtkProperty *property)
static vtkMNIObjectReader * New()
virtual int ReadFile(vtkPolyData *output)
int ReadPolygonObject(vtkPolyData *output)
vtkSetFilePathMacro(FileName)
Set the file name.
vtkGetFilePathMacro(FileName)
Set the file name.
vtkProperty * Property
int ReadLineObject(vtkPolyData *output)
virtual const char * GetFileExtensions()
Get the extension for this file format.
represent and manipulate 3D points
Definition: vtkPoints.h:138
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
represent surface properties of a geometric object
Definition: vtkProperty.h:166
@ length
Definition: vtkX3D.h:393
@ value
Definition: vtkX3D.h:220
@ name
Definition: vtkX3D.h:219
@ data
Definition: vtkX3D.h:315
int vtkIdType
Definition: vtkType.h:315
#define VTK_FILEPATH