VTK
dox/IO/Geometry/vtkSTLReader.h
Go to the documentation of this file.
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 "vtkIOGeometryModule.h" // For export macro
00044 #include "vtkPolyDataAlgorithm.h"
00045 
00046 class vtkCellArray;
00047 class vtkFloatArray;
00048 class vtkIncrementalPointLocator;
00049 class vtkPoints;
00050 
00051 class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkPolyDataAlgorithm
00052 {
00053 public:
00054   vtkTypeMacro(vtkSTLReader,vtkPolyDataAlgorithm);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058   static vtkSTLReader *New();
00059 
00062   unsigned long GetMTime();
00063 
00065 
00066   vtkSetStringMacro(FileName);
00067   vtkGetStringMacro(FileName);
00069 
00071 
00072   vtkSetMacro(Merging,int);
00073   vtkGetMacro(Merging,int);
00074   vtkBooleanMacro(Merging,int);
00076 
00078 
00079   vtkSetMacro(ScalarTags,int);
00080   vtkGetMacro(ScalarTags,int);
00081   vtkBooleanMacro(ScalarTags,int);
00083 
00085 
00087   void SetLocator(vtkIncrementalPointLocator *locator);
00088   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00090 
00091 protected:
00092   vtkSTLReader();
00093   ~vtkSTLReader();
00094 
00096   vtkIncrementalPointLocator* NewDefaultLocator();
00097 
00098   char *FileName;
00099   int Merging;
00100   int ScalarTags;
00101   vtkIncrementalPointLocator *Locator;
00102 
00103   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00104   int ReadBinarySTL(FILE *fp, vtkPoints*, vtkCellArray*);
00105   int ReadASCIISTL(FILE *fp, vtkPoints*, vtkCellArray*,
00106                    vtkFloatArray* scalars=0);
00107   int GetSTLFileType(const char *filename);
00108 private:
00109   vtkSTLReader(const vtkSTLReader&);  // Not implemented.
00110   void operator=(const vtkSTLReader&);  // Not implemented.
00111 };
00112 
00113 #endif