Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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   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 =========================================================================*/
00044 #ifndef __vtkSTLReader_h
00045 #define __vtkSTLReader_h
00046 
00047 #include "vtkPolyDataSource.h"
00048 
00049 class vtkCellArray;
00050 class vtkFloatArray;
00051 class vtkPointLocator;
00052 class vtkPoints;
00053 
00054 class VTK_IO_EXPORT vtkSTLReader : public vtkPolyDataSource 
00055 {
00056 public:
00057   vtkTypeRevisionMacro(vtkSTLReader,vtkPolyDataSource);
00058   void PrintSelf(ostream& os, vtkIndent indent);
00059 
00061   static vtkSTLReader *New();
00062 
00065   unsigned long GetMTime();
00066 
00068 
00069   vtkSetStringMacro(FileName);
00070   vtkGetStringMacro(FileName);
00072 
00074 
00075   vtkSetMacro(Merging,int);
00076   vtkGetMacro(Merging,int);
00077   vtkBooleanMacro(Merging,int);
00079 
00081 
00082   vtkSetMacro(ScalarTags,int);
00083   vtkGetMacro(ScalarTags,int);
00084   vtkBooleanMacro(ScalarTags,int);
00086 
00088 
00090   void SetLocator(vtkPointLocator *locator);
00091   vtkGetObjectMacro(Locator,vtkPointLocator);
00093 
00095   void CreateDefaultLocator();
00096 
00097 protected:
00098   vtkSTLReader();
00099   ~vtkSTLReader();
00100 
00101   char *FileName;
00102   int Merging;
00103   int ScalarTags;
00104   vtkPointLocator *Locator;
00105 
00106   void Execute();
00107   int ReadBinarySTL(FILE *fp, vtkPoints*, vtkCellArray*);
00108   int ReadASCIISTL(FILE *fp, vtkPoints*, vtkCellArray*, 
00109                    vtkFloatArray* scalars=0);
00110   int GetSTLFileType(FILE *fp);
00111 private:
00112   vtkSTLReader(const vtkSTLReader&);  // Not implemented.
00113   void operator=(const vtkSTLReader&);  // Not implemented.
00114 };
00115 
00116 #endif
00117 
00118