VTK  9.3.20240329
vtkSTLReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
135 #ifndef vtkSTLReader_h
136 #define vtkSTLReader_h
137 
139 #include "vtkIOGeometryModule.h" // For export macro
140 
141 VTK_ABI_NAMESPACE_BEGIN
142 class vtkCellArray;
143 class vtkFloatArray;
145 class vtkPoints;
146 
147 class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkAbstractPolyDataReader
148 {
149 public:
151  void PrintSelf(ostream& os, vtkIndent indent) override;
152 
156  static vtkSTLReader* New();
157 
162  vtkMTimeType GetMTime() override;
163 
165 
168  vtkSetMacro(Merging, vtkTypeBool);
169  vtkGetMacro(Merging, vtkTypeBool);
170  vtkBooleanMacro(Merging, vtkTypeBool);
172 
174 
177  vtkSetMacro(ScalarTags, vtkTypeBool);
178  vtkGetMacro(ScalarTags, vtkTypeBool);
179  vtkBooleanMacro(ScalarTags, vtkTypeBool);
181 
183 
188  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
190 
200  vtkGetStringMacro(Header);
201 
208  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
209 
210 protected:
212  ~vtkSTLReader() override;
213 
218 
222  vtkSetStringMacro(Header);
223  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
224 
228  char* Header;
230 
233  bool ReadASCIISTL(FILE* fp, vtkPoints*, vtkCellArray*, vtkFloatArray* scalars = nullptr);
234  int GetSTLFileType(const char* filename);
235 
236 private:
237  vtkSTLReader(const vtkSTLReader&) = delete;
238  void operator=(const vtkSTLReader&) = delete;
239 };
240 
241 VTK_ABI_NAMESPACE_END
242 #endif
Superclass for algorithms that read models from a file.
object to represent cell connectivity
Definition: vtkCellArray.h:286
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:139
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:148
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:227
static vtkSTLReader * New()
Construct object with merging set to true.
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:226
int GetSTLFileType(const char *filename)
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:229
vtkTypeBool Merging
Definition: vtkSTLReader.h:225
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:64
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270