VTK  9.3.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 
38 class VTKIOMINC_EXPORT vtkMNIObjectReader : public vtkPolyDataAlgorithm
39 {
40 public:
42 
43  static vtkMNIObjectReader* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  vtkSetFilePathMacro(FileName);
51  vtkGetFilePathMacro(FileName);
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);
88  int SkipWhitespace();
89  int ParseValues(vtkDataArray* array, vtkIdType n);
90  int ParseIdValue(vtkIdType* value);
91 
92  int ReadNumberOfPoints(vtkIdType* numCells);
93  int ReadNumberOfCells(vtkIdType* numCells);
94  int ReadProperty(vtkProperty* property);
95  int ReadLineThickness(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 
101  int ReadPolygonObject(vtkPolyData* output);
102  int ReadLineObject(vtkPolyData* output);
103 
104  virtual int ReadFile(vtkPolyData* output);
105 
106  int RequestData(
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
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:56
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:30
A reader for MNI surface mesh files.
int vtkIdType
Definition: vtkType.h:315
virtual const char * GetFileExtensions()
Get the extension for this file format.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
static vtkPolyDataAlgorithm * New()
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:34
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:175
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:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.