VTK
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 
17 Copyright (c) 2006 Atamai, Inc.
18 
19 Use, modification and redistribution of the software, in source or
20 binary forms, are permitted provided that the following terms and
21 conditions are met:
22 
23 1) 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 
28 2) 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 
33 3) 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 
36 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45 POSSIBILITY OF SUCH DAMAGES.
46 
47 =========================================================================*/
67 #ifndef vtkMNIObjectReader_h
68 #define vtkMNIObjectReader_h
69 
70 #include "vtkIOMINCModule.h" // For export macro
71 #include "vtkPolyDataAlgorithm.h"
72 
73 class vtkProperty;
74 class vtkPolyData;
75 class vtkFloatArray;
76 class vtkIntArray;
77 class vtkPoints;
78 class vtkCellArray;
79 
81 {
82 public:
84 
86  virtual void PrintSelf(ostream& os, vtkIndent indent);
87 
89 
90  vtkSetStringMacro(FileName);
91  vtkGetStringMacro(FileName);
93 
95 
96  virtual const char* GetFileExtensions() {
97  return ".obj"; }
99 
101 
102  virtual const char* GetDescriptiveName() {
103  return "MNI object"; }
105 
107  virtual int CanReadFile(const char* name);
108 
110  virtual vtkProperty *GetProperty() { return this->Property; };
111 
112 protected:
115 
116  char *FileName;
118  int FileType;
119 
120  istream *InputStream;
122  char *LineText;
123  char *CharPointer;
124 
125  int ReadLine(char *text, unsigned int length);
129 
131  int ReadNumberOfCells(vtkIdType *numCells);
132  int ReadProperty(vtkProperty *property);
134  int ReadPoints(vtkPolyData *polyData, vtkIdType numPoints);
135  int ReadNormals(vtkPolyData *polyData, vtkIdType numPoints);
137  vtkIdType numPoints, vtkIdType numCells);
139 
142 
143  virtual int ReadFile(vtkPolyData *output);
144 
145  virtual int RequestData(vtkInformation* request,
146  vtkInformationVector** inInfo,
147  vtkInformationVector* outInfo);
148 
149 private:
150  vtkMNIObjectReader(const vtkMNIObjectReader&); // Not implemented
151  void operator=(const vtkMNIObjectReader&); // Not implemented
152 
153 };
154 
155 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkMNIObjectReader::ReadNumberOfPoints
int ReadNumberOfPoints(vtkIdType *numCells)
vtkMNIObjectReader::~vtkMNIObjectReader
~vtkMNIObjectReader()
vtkMNIObjectReader::GetDescriptiveName
virtual const char * GetDescriptiveName()
Definition: vtkMNIObjectReader.h:102
vtkMNIObjectReader::LineNumber
int LineNumber
Definition: vtkMNIObjectReader.h:121
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkMNIObjectReader::ReadNormals
int ReadNormals(vtkPolyData *polyData, vtkIdType numPoints)
vtkMNIObjectReader::ReadPoints
int ReadPoints(vtkPolyData *polyData, vtkIdType numPoints)
vtkMNIObjectReader::New
static vtkMNIObjectReader * New()
vtkMNIObjectReader::ReadCells
int ReadCells(vtkPolyData *data, vtkIdType numCells, int cellType)
vtkIdType
int vtkIdType
Definition: vtkType.h:275
VTKIOMINC_EXPORT
#define VTKIOMINC_EXPORT
Definition: vtkIOMINCModule.h:15
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:49
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkMNIObjectReader::ReadFile
virtual int ReadFile(vtkPolyData *output)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkMNIObjectReader::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkMNIObjectReader::ReadLineThickness
int ReadLineThickness(vtkProperty *property)
vtkMNIObjectReader::vtkMNIObjectReader
vtkMNIObjectReader()
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkgl::length
GLuint GLsizei GLsizei * length
Definition: vtkgl.h:11992
vtkMNIObjectReader::InputStream
istream * InputStream
Definition: vtkMNIObjectReader.h:120
vtkPolyDataAlgorithm.h
vtkMNIObjectReader
A reader for MNI surface mesh files.
Definition: vtkMNIObjectReader.h:81
vtkMNIObjectReader::GetFileExtensions
virtual const char * GetFileExtensions()
Definition: vtkMNIObjectReader.h:96
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkMNIObjectReader::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkMNIObjectReader::LineText
char * LineText
Definition: vtkMNIObjectReader.h:122
vtkMNIObjectReader::CanReadFile
virtual int CanReadFile(const char *name)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:53
vtkMNIObjectReader::SkipWhitespace
int SkipWhitespace()
vtkMNIObjectReader::ReadLine
int ReadLine(char *text, unsigned int length)
vtkMNIObjectReader::CharPointer
char * CharPointer
Definition: vtkMNIObjectReader.h:123
vtkDax::detail::cellType
CellTypeInDataSet cellType(vtkDataSet *input)
Definition: vtkDaxDetailCommon.h:36
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkMNIObjectReader::Property
vtkProperty * Property
Definition: vtkMNIObjectReader.h:117
vtkMNIObjectReader::FileType
int FileType
Definition: vtkMNIObjectReader.h:118
vtkMNIObjectReader::FileName
char * FileName
Definition: vtkMNIObjectReader.h:116
vtkMNIObjectReader::ParseIdValue
int ParseIdValue(vtkIdType *value)
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkIOMINCModule.h
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkMNIObjectReader::ReadLineObject
int ReadLineObject(vtkPolyData *output)
vtkMNIObjectReader::ReadPolygonObject
int ReadPolygonObject(vtkPolyData *output)
vtkMNIObjectReader::ReadNumberOfCells
int ReadNumberOfCells(vtkIdType *numCells)
vtkMNIObjectReader::ParseValues
int ParseValues(vtkDataArray *array, vtkIdType n)
vtkMNIObjectReader::GetProperty
virtual vtkProperty * GetProperty()
Definition: vtkMNIObjectReader.h:110
vtkMNIObjectReader::ReadProperty
int ReadProperty(vtkProperty *property)
vtkMNIObjectReader::ReadColors
int ReadColors(vtkProperty *property, vtkPolyData *data, vtkIdType numPoints, vtkIdType numCells)
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44