Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkSTLReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSTLReader.h,v $
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 =========================================================================*/
00054 #ifndef __vtkSTLReader_h
00055 #define __vtkSTLReader_h
00056 
00057 #include "vtkPolyDataSource.h"
00058 
00059 class vtkCellArray;
00060 class vtkFloatArray;
00061 class vtkPointLocator;
00062 class vtkPoints;
00063 
00064 class VTK_IO_EXPORT vtkSTLReader : public vtkPolyDataSource 
00065 {
00066 public:
00067   vtkTypeRevisionMacro(vtkSTLReader,vtkPolyDataSource);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00071   static vtkSTLReader *New();
00072 
00075   unsigned long GetMTime();
00076 
00078 
00079   vtkSetStringMacro(FileName);
00080   vtkGetStringMacro(FileName);
00082 
00084 
00085   vtkSetMacro(Merging,int);
00086   vtkGetMacro(Merging,int);
00087   vtkBooleanMacro(Merging,int);
00089 
00091 
00092   vtkSetMacro(ScalarTags,int);
00093   vtkGetMacro(ScalarTags,int);
00094   vtkBooleanMacro(ScalarTags,int);
00096 
00098 
00100   void SetLocator(vtkPointLocator *locator);
00101   vtkGetObjectMacro(Locator,vtkPointLocator);
00103 
00105   void CreateDefaultLocator();
00106 
00107 protected:
00108   vtkSTLReader();
00109   ~vtkSTLReader();
00110 
00111   char *FileName;
00112   int Merging;
00113   int ScalarTags;
00114   vtkPointLocator *Locator;
00115 
00116   void Execute();
00117   int ReadBinarySTL(FILE *fp, vtkPoints*, vtkCellArray*);
00118   int ReadASCIISTL(FILE *fp, vtkPoints*, vtkCellArray*, 
00119                    vtkFloatArray* scalars=0);
00120   int GetSTLFileType(FILE *fp);
00121 private:
00122   vtkSTLReader(const vtkSTLReader&);  // Not implemented.
00123   void operator=(const vtkSTLReader&);  // Not implemented.
00124 };
00125 
00126 #endif
00127 
00128