VTK  9.3.0
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
35 #ifndef vtkSTLReader_h
36 #define vtkSTLReader_h
37 
39 #include "vtkIOGeometryModule.h" // For export macro
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkCellArray;
43 class vtkFloatArray;
45 class vtkPoints;
46 
47 class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkAbstractPolyDataReader
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
56  static vtkSTLReader* New();
57 
62  vtkMTimeType GetMTime() override;
63 
65 
68  vtkSetMacro(Merging, vtkTypeBool);
69  vtkGetMacro(Merging, vtkTypeBool);
70  vtkBooleanMacro(Merging, vtkTypeBool);
72 
74 
77  vtkSetMacro(ScalarTags, vtkTypeBool);
78  vtkGetMacro(ScalarTags, vtkTypeBool);
79  vtkBooleanMacro(ScalarTags, vtkTypeBool);
81 
83 
88  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
90 
100  vtkGetStringMacro(Header);
101 
108  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
109 
110 protected:
112  ~vtkSTLReader() override;
113 
118 
122  vtkSetStringMacro(Header);
123  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
124 
128  char* Header;
130 
133  bool ReadASCIISTL(FILE* fp, vtkPoints*, vtkCellArray*, vtkFloatArray* scalars = nullptr);
134  int GetSTLFileType(const char* filename);
135 
136 private:
137  vtkSTLReader(const vtkSTLReader&) = delete;
138  void operator=(const vtkSTLReader&) = delete;
139 };
140 
141 VTK_ABI_NAMESPACE_END
142 #endif
Superclass for algorithms that read models from a file.
object to represent cell connectivity
Definition: vtkCellArray.h:185
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:38
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:48
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:127
static vtkSTLReader * New()
Construct object with merging set to true.
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:126
int GetSTLFileType(const char *filename)
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:129
vtkTypeBool Merging
Definition: vtkSTLReader.h:125
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