VTK  9.0.1
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 =========================================================================*/
35 #ifndef vtkSTLReader_h
36 #define vtkSTLReader_h
37 
39 #include "vtkIOGeometryModule.h" // For export macro
40 
41 class vtkCellArray;
42 class vtkFloatArray;
44 class vtkPoints;
45 
46 class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkAbstractPolyDataReader
47 {
48 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  static vtkSTLReader* New();
56 
61  vtkMTimeType GetMTime() override;
62 
64 
67  vtkSetMacro(Merging, vtkTypeBool);
68  vtkGetMacro(Merging, vtkTypeBool);
69  vtkBooleanMacro(Merging, vtkTypeBool);
71 
73 
76  vtkSetMacro(ScalarTags, vtkTypeBool);
77  vtkGetMacro(ScalarTags, vtkTypeBool);
78  vtkBooleanMacro(ScalarTags, vtkTypeBool);
80 
82 
87  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
89 
99  vtkGetStringMacro(Header);
100 
107  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
108 
109 protected:
111  ~vtkSTLReader() override;
112 
117 
121  vtkSetStringMacro(Header);
122  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
123 
127  char* Header;
129 
132  bool ReadASCIISTL(FILE* fp, vtkPoints*, vtkCellArray*, vtkFloatArray* scalars = nullptr);
133  int GetSTLFileType(const char* filename);
134 
135 private:
136  vtkSTLReader(const vtkSTLReader&) = delete;
137  void operator=(const vtkSTLReader&) = delete;
138 };
139 
140 #endif
Superclass for algorithms that read models from a file.
object to represent cell connectivity
Definition: vtkCellArray.h:180
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:34
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:47
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:126
static vtkSTLReader * New()
Construct object with merging set to true.
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:125
int GetSTLFileType(const char *filename)
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:128
vtkTypeBool Merging
Definition: vtkSTLReader.h:124
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:293