VTK  9.7.1
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 struct vtkMNIObjectReaderFunctor;
38 
39 class VTKIOMINC_EXPORT vtkMNIObjectReader : public vtkPolyDataAlgorithm
40 {
41 public:
43 
44  static vtkMNIObjectReader* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
51  vtkSetFilePathMacro(FileName);
52  vtkGetFilePathMacro(FileName);
54 
58  virtual const char* GetFileExtensions() { return ".obj"; }
59 
63  virtual const char* GetDescriptiveName() { return "MNI object"; }
64 
68  virtual int CanReadFile(VTK_FILEPATH const char* name);
69 
73  virtual vtkProperty* GetProperty() { return this->Property; }
74 
75 protected:
77  ~vtkMNIObjectReader() override;
78 
79  char* FileName;
81  int FileType;
82 
83  istream* InputStream;
85  char* LineText;
86  char* CharPointer;
87 
88  int ReadLine(char* text, unsigned int length);
89  int SkipWhitespace();
90  int ParseValues(vtkDataArray* array, vtkIdType n);
91  int ParseIdValue(vtkIdType* value);
92 
93  int ReadNumberOfPoints(vtkIdType* numCells);
94  int ReadNumberOfCells(vtkIdType* numCells);
95  int ReadProperty(vtkProperty* property);
96  int ReadLineThickness(vtkProperty* property);
97  int ReadPoints(vtkPolyData* polyData, vtkIdType numPoints);
98  int ReadNormals(vtkPolyData* polyData, vtkIdType numPoints);
99  int ReadColors(vtkProperty* property, vtkPolyData* data, vtkIdType numPoints, vtkIdType numCells);
100  int ReadCells(vtkPolyData* data, vtkIdType numCells, int cellType);
101 
102  int ReadPolygonObject(vtkPolyData* output);
103  int ReadLineObject(vtkPolyData* output);
104 
105  virtual int ReadFile(vtkPolyData* output);
106 
107  int RequestData(
108  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
109 
110 private:
111  vtkMNIObjectReader(const vtkMNIObjectReader&) = delete;
112  void operator=(const vtkMNIObjectReader&) = delete;
113 
114  friend struct vtkMNIObjectReaderFunctor;
115 };
116 
117 VTK_ABI_NAMESPACE_END
118 #endif
virtual const char * GetDescriptiveName()
Get the name of this file format.
Store vtkAlgorithm input/output information.
represent surface properties of a geometric object
Definition: vtkProperty.h:59
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
A reader for MNI surface mesh files.
int vtkIdType
Definition: vtkType.h:363
virtual const char * GetFileExtensions()
Get the extension for this file format.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
static vtkPolyDataAlgorithm * New()
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:35
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
#define VTK_FILEPATH
object to represent cell connectivity
Definition: vtkCellArray.h:177
virtual vtkProperty * GetProperty()
Get the property associated with the object.
vtkProperty * Property
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.