00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00067 #ifndef __vtkMNIObjectReader_h
00068 #define __vtkMNIObjectReader_h
00069
00070 #include "vtkPolyDataAlgorithm.h"
00071
00072 class vtkProperty;
00073 class vtkPolyData;
00074 class vtkFloatArray;
00075 class vtkIntArray;
00076 class vtkPoints;
00077 class vtkCellArray;
00078
00079 class VTK_HYBRID_EXPORT vtkMNIObjectReader : public vtkPolyDataAlgorithm
00080 {
00081 public:
00082 vtkTypeMacro(vtkMNIObjectReader,vtkPolyDataAlgorithm);
00083
00084 static vtkMNIObjectReader *New();
00085 virtual void PrintSelf(ostream& os, vtkIndent indent);
00086
00088
00089 vtkSetStringMacro(FileName);
00090 vtkGetStringMacro(FileName);
00092
00094
00095 virtual const char* GetFileExtensions() {
00096 return ".obj"; }
00098
00100
00101 virtual const char* GetDescriptiveName() {
00102 return "MNI object"; }
00104
00106 virtual int CanReadFile(const char* name);
00107
00109 virtual vtkProperty *GetProperty() { return this->Property; };
00110
00111 protected:
00112 vtkMNIObjectReader();
00113 ~vtkMNIObjectReader();
00114
00115 char *FileName;
00116 vtkProperty *Property;
00117 int FileType;
00118
00119 istream *InputStream;
00120 int LineNumber;
00121 char *LineText;
00122 char *CharPointer;
00123
00124 int ReadLine(char *text, unsigned int length);
00125 int SkipWhitespace();
00126 int ParseValues(vtkDataArray *array, vtkIdType n);
00127 int ParseIdValue(vtkIdType *value);
00128
00129 int ReadNumberOfPoints(vtkIdType *numCells);
00130 int ReadNumberOfCells(vtkIdType *numCells);
00131 int ReadProperty(vtkProperty *property);
00132 int ReadLineThickness(vtkProperty *property);
00133 int ReadPoints(vtkPolyData *polyData, vtkIdType numPoints);
00134 int ReadNormals(vtkPolyData *polyData, vtkIdType numPoints);
00135 int ReadColors(vtkProperty *property, vtkPolyData *data,
00136 vtkIdType numPoints, vtkIdType numCells);
00137 int ReadCells(vtkPolyData *data, vtkIdType numCells, int cellType);
00138
00139 int ReadPolygonObject(vtkPolyData *output);
00140 int ReadLineObject(vtkPolyData *output);
00141
00142 virtual int ReadFile(vtkPolyData *output);
00143
00144 virtual int RequestData(vtkInformation* request,
00145 vtkInformationVector** inInfo,
00146 vtkInformationVector* outInfo);
00147
00148 private:
00149 vtkMNIObjectReader(const vtkMNIObjectReader&);
00150 void operator=(const vtkMNIObjectReader&);
00151
00152 };
00153
00154 #endif