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 
86  void SetLocator(vtkIncrementalPointLocator* locator);
87  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
89 
99  vtkGetStringMacro(Header);
100 
107  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
108 
109 protected:
110  vtkSTLReader();
111  ~vtkSTLReader() override;
112 
116  vtkIncrementalPointLocator* NewDefaultLocator();
117 
121  vtkSetStringMacro(Header);
122  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
123 
127  char* Header;
129 
131  bool ReadBinarySTL(FILE* fp, vtkPoints*, vtkCellArray*);
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
vtkSTLReader
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:46
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkAbstractPolyDataReader
Superclass for algorithms that read models from a file.
Definition: vtkAbstractPolyDataReader.h:36
vtkSTLReader::Header
char * Header
Definition: vtkSTLReader.h:127
vtkSTLReader::BinaryHeader
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:128
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:179
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkAbstractPolyDataReader.h
vtkSTLReader::ScalarTags
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:125
vtkAbstractPolyDataReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSTLReader::Merging
vtkTypeBool Merging
Definition: vtkSTLReader.h:124
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
vtkSTLReader::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkSTLReader.h:126