VTK
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 
38 #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*,
133  vtkFloatArray* scalars=nullptr);
134  int GetSTLFileType(const char *filename);
135 private:
136  vtkSTLReader(const vtkSTLReader&) = delete;
137  void operator=(const vtkSTLReader&) = delete;
138 };
139 
140 #endif
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:128
Store vtkAlgorithm input/output information.
vtkTypeBool Merging
Definition: vtkSTLReader.h:124
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
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:46
Abstract class in support of both point location and point insertion.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:125
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
Superclass for algorithms that read models from a file.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIncrementalPointLocator * Locator
Definition: vtkSTLReader.h:126
virtual vtkMTimeType GetMTime()
Return this object's modified time.
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:44
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:33