VTK  9.2.6
vtkMNIObjectReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMNIObjectReader.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=========================================================================*/
15/*=========================================================================
16
17Copyright (c) 2006 Atamai, Inc.
18
19Use, modification and redistribution of the software, in source or
20binary forms, are permitted provided that the following terms and
21conditions are met:
22
231) Redistribution of the source code, in verbatim or modified
24 form, must retain the above copyright notice, this license,
25 the following disclaimer, and any notices that refer to this
26 license and/or the following disclaimer.
27
282) Redistribution in binary form must include the above copyright
29 notice, a copy of this license and the following disclaimer
30 in the documentation or with other materials provided with the
31 distribution.
32
333) Modified copies of the source code must be clearly marked as such,
34 and must not be misrepresented as verbatim copies of the source code.
35
36THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45POSSIBILITY OF SUCH DAMAGES.
46
47=========================================================================*/
67
68#ifndef vtkMNIObjectReader_h
69#define vtkMNIObjectReader_h
70
71#include "vtkIOMINCModule.h" // For export macro
73
74class vtkProperty;
75class vtkPolyData;
76class vtkFloatArray;
77class vtkIntArray;
78class vtkPoints;
79class vtkCellArray;
80
81class VTKIOMINC_EXPORT vtkMNIObjectReader : public vtkPolyDataAlgorithm
82{
83public:
85
87 void PrintSelf(ostream& os, vtkIndent indent) override;
88
90
96
100 virtual const char* GetFileExtensions() { return ".obj"; }
101
105 virtual const char* GetDescriptiveName() { return "MNI object"; }
106
110 virtual int CanReadFile(VTK_FILEPATH const char* name);
111
115 virtual vtkProperty* GetProperty() { return this->Property; }
116
117protected:
120
121 char* FileName;
124
125 istream* InputStream;
127 char* LineText;
129
130 int ReadLine(char* text, unsigned int length);
134
137 int ReadProperty(vtkProperty* property);
139 int ReadPoints(vtkPolyData* polyData, vtkIdType numPoints);
140 int ReadNormals(vtkPolyData* polyData, vtkIdType numPoints);
141 int ReadColors(vtkProperty* property, vtkPolyData* data, vtkIdType numPoints, vtkIdType numCells);
142 int ReadCells(vtkPolyData* data, vtkIdType numCells, int cellType);
143
146
147 virtual int ReadFile(vtkPolyData* output);
148
150 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
151
152private:
153 vtkMNIObjectReader(const vtkMNIObjectReader&) = delete;
154 void operator=(const vtkMNIObjectReader&) = delete;
155};
156
157#endif
object to represent cell connectivity
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition vtkIntArray.h:46
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 vtkProperty * GetProperty()
Get the property associated with the object.
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)
static vtkMNIObjectReader * New()
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)
int ReadNumberOfCells(vtkIdType *numCells)
int ReadProperty(vtkProperty *property)
virtual int ReadFile(vtkPolyData *output)
virtual const char * GetFileExtensions()
Get the extension for this file format.
int ReadPolygonObject(vtkPolyData *output)
vtkSetFilePathMacro(FileName)
Set the file name.
vtkGetFilePathMacro(FileName)
Set the file name.
int ReadLineObject(vtkPolyData *output)
represent and manipulate 3D points
Definition vtkPoints.h:40
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:91
represent surface properties of a geometric object
Definition vtkProperty.h:68
#define vtkDataArray
int vtkIdType
Definition vtkType.h:332
#define VTK_FILEPATH