VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSTLReader.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 =========================================================================*/ 00040 #ifndef __vtkSTLReader_h 00041 #define __vtkSTLReader_h 00042 00043 #include "vtkPolyDataAlgorithm.h" 00044 00045 class vtkCellArray; 00046 class vtkFloatArray; 00047 class vtkIncrementalPointLocator; 00048 class vtkPoints; 00049 00050 class VTK_IO_EXPORT vtkSTLReader : public vtkPolyDataAlgorithm 00051 { 00052 public: 00053 vtkTypeMacro(vtkSTLReader,vtkPolyDataAlgorithm); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00057 static vtkSTLReader *New(); 00058 00061 unsigned long GetMTime(); 00062 00064 00065 vtkSetStringMacro(FileName); 00066 vtkGetStringMacro(FileName); 00068 00070 00071 vtkSetMacro(Merging,int); 00072 vtkGetMacro(Merging,int); 00073 vtkBooleanMacro(Merging,int); 00075 00077 00078 vtkSetMacro(ScalarTags,int); 00079 vtkGetMacro(ScalarTags,int); 00080 vtkBooleanMacro(ScalarTags,int); 00082 00084 00086 void SetLocator(vtkIncrementalPointLocator *locator); 00087 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); 00089 00090 protected: 00091 vtkSTLReader(); 00092 ~vtkSTLReader(); 00093 00095 vtkIncrementalPointLocator* NewDefaultLocator(); 00096 00097 char *FileName; 00098 int Merging; 00099 int ScalarTags; 00100 vtkIncrementalPointLocator *Locator; 00101 00102 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00103 int ReadBinarySTL(FILE *fp, vtkPoints*, vtkCellArray*); 00104 int ReadASCIISTL(FILE *fp, vtkPoints*, vtkCellArray*, 00105 vtkFloatArray* scalars=0); 00106 int GetSTLFileType(const char *filename); 00107 private: 00108 vtkSTLReader(const vtkSTLReader&); // Not implemented. 00109 void operator=(const vtkSTLReader&); // Not implemented. 00110 }; 00111 00112 #endif