VTK  9.2.5
vtkSTLReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSTLReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
147 #ifndef vtkSTLReader_h
148 #define vtkSTLReader_h
149 
151 #include "vtkIOGeometryModule.h" // For export macro
152 
153 class vtkCellArray;
154 class vtkFloatArray;
156 class vtkPoints;
157 
158 class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkAbstractPolyDataReader
159 {
160 public:
162  void PrintSelf(ostream& os, vtkIndent indent) override;
163 
167  static vtkSTLReader* New();
168 
173  vtkMTimeType GetMTime() override;
174 
176 
179  vtkSetMacro(Merging, vtkTypeBool);
180  vtkGetMacro(Merging, vtkTypeBool);
181  vtkBooleanMacro(Merging, vtkTypeBool);
183 
185 
188  vtkSetMacro(ScalarTags, vtkTypeBool);
189  vtkGetMacro(ScalarTags, vtkTypeBool);
190  vtkBooleanMacro(ScalarTags, vtkTypeBool);
192 
194 
199  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
201 
211  vtkGetStringMacro(Header);
212 
219  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
220 
221 protected:
223  ~vtkSTLReader() override;
224 
229 
233  vtkSetStringMacro(Header);
234  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
235 
239  char* Header;
241 
244  bool ReadASCIISTL(FILE* fp, vtkPoints*, vtkCellArray*, vtkFloatArray* scalars = nullptr);
245  int GetSTLFileType(const char* filename);
246 
247 private:
248  vtkSTLReader(const vtkSTLReader&) = delete;
249  void operator=(const vtkSTLReader&) = delete;
250 };
251 
252 #endif
Superclass for algorithms that read models from a file.
object to represent cell connectivity
Definition: vtkCellArray.h:296
dynamic, self-adjusting array of float
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:149
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:159
void SetLocator(vtkIncrementalPointLocator *locator)
Specify a spatial locator for merging points.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIncrementalPointLocator * Locator
Definition: vtkSTLReader.h:238
static vtkSTLReader * New()
Construct object with merging set to true.
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:237
int GetSTLFileType(const char *filename)
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:240
vtkTypeBool Merging
Definition: vtkSTLReader.h:236
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkIncrementalPointLocator * NewDefaultLocator()
Create default locator.
virtual void SetBinaryHeader(vtkUnsignedCharArray *binaryHeader)
~vtkSTLReader() override
bool ReadASCIISTL(FILE *fp, vtkPoints *, vtkCellArray *, vtkFloatArray *scalars=nullptr)
bool ReadBinarySTL(FILE *fp, vtkPoints *, vtkCellArray *)
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287