00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkParticleReader.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00046 #ifndef __vtkParticleReader_h 00047 #define __vtkParticleReader_h 00048 00049 #include "vtkPolyDataSource.h" 00050 00051 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0 00052 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1 00053 00054 class VTK_IO_EXPORT vtkParticleReader : public vtkPolyDataSource 00055 { 00056 public: 00057 static vtkParticleReader *New(); 00058 vtkTypeRevisionMacro(vtkParticleReader,vtkPolyDataSource); 00059 void PrintSelf(ostream& os, vtkIndent indent); 00060 00062 00063 vtkSetStringMacro(FileName); 00064 vtkGetStringMacro(FileName); 00066 00068 00078 void SetDataByteOrderToBigEndian(); 00079 void SetDataByteOrderToLittleEndian(); 00080 int GetDataByteOrder(); 00081 void SetDataByteOrder(int); 00082 const char *GetDataByteOrderAsString(); 00084 00086 00087 vtkSetMacro(SwapBytes,int); 00088 int GetSwapBytes() {return this->SwapBytes;} 00089 vtkBooleanMacro(SwapBytes,int); 00091 00092 protected: 00093 vtkParticleReader(); 00094 ~vtkParticleReader(); 00095 00096 void OpenFile(); 00097 00098 char *FileName; 00099 ifstream *File; 00100 int SwapBytes; 00101 00102 unsigned long NumberOfPoints; 00103 00104 void ExecuteInformation(); 00105 void Execute(); 00106 private: 00107 vtkParticleReader(const vtkParticleReader&); // Not implemented. 00108 void operator=(const vtkParticleReader&); // Not implemented. 00109 }; 00110 00111 #endif