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 =========================================================================*/
41 #ifndef vtkSTLReader_h
42 #define vtkSTLReader_h
43 
44 #include "vtkIOGeometryModule.h" // For export macro
46 
47 class vtkCellArray;
48 class vtkFloatArray;
50 class vtkPoints;
51 
52 class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkAbstractPolyDataReader
53 {
54 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
61  static vtkSTLReader *New();
62 
67  vtkMTimeType GetMTime() override;
68 
70 
73  vtkSetMacro(Merging,vtkTypeBool);
74  vtkGetMacro(Merging,vtkTypeBool);
75  vtkBooleanMacro(Merging,vtkTypeBool);
77 
79 
82  vtkSetMacro(ScalarTags,vtkTypeBool);
83  vtkGetMacro(ScalarTags,vtkTypeBool);
84  vtkBooleanMacro(ScalarTags,vtkTypeBool);
86 
88 
93  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
95 
105  vtkGetStringMacro(Header);
106 
113  vtkGetObjectMacro(BinaryHeader, vtkUnsignedCharArray);
114 
115 protected:
117  ~vtkSTLReader() override;
118 
123 
127  vtkSetStringMacro(Header);
128  virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
129 
133  char* Header;
135 
139  vtkFloatArray* scalars=nullptr);
140  int GetSTLFileType(const char *filename);
141 private:
142  vtkSTLReader(const vtkSTLReader&) = delete;
143  void operator=(const vtkSTLReader&) = delete;
144 };
145 
146 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkSTLReader::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
Specify a spatial locator for merging points.
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
vtkSTLReader
read ASCII or binary stereo lithography files
Definition: vtkSTLReader.h:53
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:42
vtkSTLReader::New
static vtkSTLReader * New()
Construct object with merging set to true.
vtkSTLReader::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkAbstractPolyDataReader
Superclass for algorithms that read models from a file.
Definition: vtkAbstractPolyDataReader.h:37
vtkSTLReader::Header
char * Header
Definition: vtkSTLReader.h:133
vtkSTLReader::BinaryHeader
vtkUnsignedCharArray * BinaryHeader
Definition: vtkSTLReader.h:134
vtkSTLReader::GetSTLFileType
int GetSTLFileType(const char *filename)
vtkSTLReader::vtkSTLReader
vtkSTLReader()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:52
vtkSTLReader::NewDefaultLocator
vtkIncrementalPointLocator * NewDefaultLocator()
Create default locator.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSTLReader::~vtkSTLReader
~vtkSTLReader() override
vtkSTLReader::SetBinaryHeader
virtual void SetBinaryHeader(vtkUnsignedCharArray *binaryHeader)
vtkSTLReader::ReadBinarySTL
bool ReadBinarySTL(FILE *fp, vtkPoints *, vtkCellArray *)
vtkAbstractPolyDataReader.h
vtkSTLReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSTLReader::ScalarTags
vtkTypeBool ScalarTags
Definition: vtkSTLReader.h:131
vtkSTLReader::GetMTime
vtkMTimeType GetMTime() override
Overload standard modified time function.
vtkSTLReader::Merging
vtkTypeBool Merging
Definition: vtkSTLReader.h:130
vtkSTLReader::ReadASCIISTL
bool ReadASCIISTL(FILE *fp, vtkPoints *, vtkCellArray *, vtkFloatArray *scalars=nullptr)
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkSTLReader::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkSTLReader.h:132