VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkProStarReader.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00029 #ifndef __vtkProStarReader_h 00030 #define __vtkProStarReader_h 00031 00032 #include "vtkIOGeometryModule.h" // For export macro 00033 #include "vtkUnstructuredGridAlgorithm.h" 00034 00035 class VTKIOGEOMETRY_EXPORT vtkProStarReader : public vtkUnstructuredGridAlgorithm 00036 { 00037 public: 00038 static vtkProStarReader *New(); 00039 vtkTypeMacro(vtkProStarReader,vtkUnstructuredGridAlgorithm); 00040 void PrintSelf(ostream& os, vtkIndent indent); 00041 00043 00045 vtkSetStringMacro(FileName); 00046 vtkGetStringMacro(FileName); 00048 00050 00052 vtkSetClampMacro(ScaleFactor, double, 0, VTK_DOUBLE_MAX); 00053 vtkGetMacro(ScaleFactor, double); 00055 00057 00058 enum cellType 00059 { 00060 starcdFluidType = 1, 00061 starcdSolidType = 2, 00062 starcdBaffleType = 3, 00063 starcdShellType = 4, 00064 starcdLineType = 5, 00065 starcdPointType = 6 00066 }; 00068 00070 00071 enum shapeType 00072 { 00073 starcdPoint = 1, 00074 starcdLine = 2, 00075 starcdShell = 3, 00076 starcdHex = 11, 00077 starcdPrism = 12, 00078 starcdTet = 13, 00079 starcdPyr = 14, 00080 starcdPoly = 255 00081 }; 00083 00084 protected: 00085 vtkProStarReader(); 00086 ~vtkProStarReader(); 00087 00088 int RequestInformation 00089 (vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00090 int RequestData 00091 (vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00092 00097 char *FileName; 00098 00101 double ScaleFactor; 00102 00103 private: 00104 // 00105 // Internal Classes/Structures 00106 // 00107 struct idMapping; 00108 00109 FILE* OpenFile(const char *ext); 00110 00111 bool ReadVrtFile(vtkUnstructuredGrid *output, idMapping& pointMapping); 00112 bool ReadCelFile(vtkUnstructuredGrid *output, const idMapping& pointMapping); 00113 00114 vtkProStarReader(const vtkProStarReader&); // Not implemented. 00115 void operator=(const vtkProStarReader&); // Not implemented. 00116 }; 00117 #endif