VTK
dox/IO/vtkProStarReader.h
Go to the documentation of this file.
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 "vtkUnstructuredGridAlgorithm.h"
00033 
00034 class VTK_IO_EXPORT vtkProStarReader : public vtkUnstructuredGridAlgorithm
00035 {
00036 public:
00037   static vtkProStarReader *New();
00038   vtkTypeMacro(vtkProStarReader,vtkUnstructuredGridAlgorithm);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040 
00042 
00044   vtkSetStringMacro(FileName);
00045   vtkGetStringMacro(FileName);
00047 
00049 
00051   vtkSetClampMacro(ScaleFactor, double, 0, VTK_DOUBLE_MAX);
00052   vtkGetMacro(ScaleFactor, double);
00054 
00056 
00057   enum cellType
00058   {
00059     starcdFluidType = 1,
00060     starcdSolidType = 2,
00061     starcdBaffleType = 3,
00062     starcdShellType = 4,
00063     starcdLineType = 5,
00064     starcdPointType = 6
00065   };
00067 
00069 
00070   enum shapeType
00071   {
00072     starcdPoint = 1,
00073     starcdLine = 2,
00074     starcdShell = 3,
00075     starcdHex = 11,
00076     starcdPrism = 12,
00077     starcdTet = 13,
00078     starcdPyr = 14,
00079     starcdPoly = 255
00080   };
00082 
00083 protected:
00084   vtkProStarReader();
00085   ~vtkProStarReader();
00086 
00087   int RequestInformation
00088     (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00089   int RequestData
00090     (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00091 
00096   char *FileName;
00097 
00100   double ScaleFactor;
00101 
00102 private:
00103   //
00104   // Internal Classes/Structures
00105   //
00106   struct idMapping;
00107 
00108   FILE* OpenFile(const char *ext);
00109 
00110   bool ReadVrtFile(vtkUnstructuredGrid *output, idMapping& pointMapping);
00111   bool ReadCelFile(vtkUnstructuredGrid *output, const idMapping& pointMapping);
00112 
00113   vtkProStarReader(const vtkProStarReader&); // Not implemented.
00114   void operator=(const vtkProStarReader&); // Not implemented.
00115 };
00116 #endif