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
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 
79  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
81 
91  vtkGetStringMacro(Header);
92 
99  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
100 
101 protected:
103  ~vtkSTLReader() override;
104 
109 
113  vtkSetStringMacro(Header);
114  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
115 
119  char* Header;
121 
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
Superclass for algorithms that read models from a file.
object to represent cell connectivity
Definition: vtkCellArray.h:176
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:29
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:39
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:118
static vtkSTLReader * New()
Construct object with merging set to true.
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:117
int GetSTLFileType(const char *filename)
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:120
vtkTypeBool Merging
Definition: vtkSTLReader.h:116
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