VTK  9.3.1
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
26 #ifndef vtkSTLReader_h
27 #define vtkSTLReader_h
28 
30 #include "vtkIOGeometryModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkCellArray;
34 class vtkFloatArray;
36 class vtkPoints;
37 
38 class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkAbstractPolyDataReader
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  static vtkSTLReader* New();
48 
53  vtkMTimeType GetMTime() override;
54 
56 
59  vtkSetMacro(Merging, vtkTypeBool);
60  vtkGetMacro(Merging, vtkTypeBool);
61  vtkBooleanMacro(Merging, vtkTypeBool);
63 
65 
68  vtkSetMacro(ScalarTags, vtkTypeBool);
69  vtkGetMacro(ScalarTags, vtkTypeBool);
70  vtkBooleanMacro(ScalarTags, vtkTypeBool);
72 
74 
78  void SetLocator(vtkIncrementalPointLocator* locator);
79  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
81 
91  vtkGetStringMacro(Header);
92 
99  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
100 
101 protected:
102  vtkSTLReader();
103  ~vtkSTLReader() override;
104 
108  vtkIncrementalPointLocator* NewDefaultLocator();
109 
113  vtkSetStringMacro(Header);
114  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
115 
119  char* Header;
121 
123  bool ReadBinarySTL(FILE* fp, vtkPoints*, vtkCellArray*);
124  bool ReadASCIISTL(FILE* fp, vtkPoints*, vtkCellArray*, vtkFloatArray* scalars = nullptr);
125  int GetSTLFileType(const char* filename);
126 
127 private:
128  vtkSTLReader(const vtkSTLReader&) = delete;
129  void operator=(const vtkSTLReader&) = delete;
130 };
131 
132 VTK_ABI_NAMESPACE_END
133 #endif
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:120
Store vtkAlgorithm input/output information.
vtkTypeBool Merging
Definition: vtkSTLReader.h:116
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:38
Abstract class in support of both point location and point insertion.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:30
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:117
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for algorithms that read models from a file.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkIncrementalPointLocator * Locator
Definition: vtkSTLReader.h:118
virtual vtkMTimeType GetMTime()
Return this object's modified time.
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:175
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represent and manipulate 3D points
Definition: vtkPoints.h:28