VTK
vtkSTLWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSTLWriter.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 =========================================================================*/
29 #ifndef vtkSTLWriter_h
30 #define vtkSTLWriter_h
31 
32 #include "vtkIOGeometryModule.h" // For export macro
33 #include "vtkWriter.h"
34 
35 class vtkCellArray;
36 class vtkPoints;
37 class vtkPolyData;
38 
39 class VTKIOGEOMETRY_EXPORT vtkSTLWriter : public vtkWriter
40 {
41 public:
42  static vtkSTLWriter *New();
43  vtkTypeMacro(vtkSTLWriter,vtkWriter);
44  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
45 
47 
53 
55 
58  vtkSetStringMacro(FileName);
59  vtkGetStringMacro(FileName);
61 
63 
66  vtkSetStringMacro(Header);
67  vtkGetStringMacro(Header);
69 
71 
74  vtkSetClampMacro(FileType,int,VTK_ASCII,VTK_BINARY);
75  vtkGetMacro(FileType,int);
76  void SetFileTypeToASCII() {this->SetFileType(VTK_ASCII);};
77  void SetFileTypeToBinary() {this->SetFileType(VTK_BINARY);};
79 
80 protected:
81  vtkSTLWriter();
82  ~vtkSTLWriter() VTK_OVERRIDE
83  {
84  delete[] this->FileName;
85  delete[] this->Header;
86  }
87 
88  void WriteData() VTK_OVERRIDE;
89 
90  void WriteBinarySTL(
91  vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips);
92  void WriteAsciiSTL(
93  vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips);
94 
95  char* FileName;
96  char *Header;
97  int FileType;
98 
99  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
100 
101 private:
102  vtkSTLWriter(const vtkSTLWriter&) VTK_DELETE_FUNCTION;
103  void operator=(const vtkSTLWriter&) VTK_DELETE_FUNCTION;
104 };
105 
106 #endif
107 
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
#define VTK_ASCII
Definition: vtkWriter.h:39
~vtkSTLWriter() override
Definition: vtkSTLWriter.h:82
void SetFileTypeToASCII()
Specify file type (ASCII or BINARY) for vtk data file.
Definition: vtkSTLWriter.h:76
abstract class to write data to file(s)
Definition: vtkWriter.h:42
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetFileTypeToBinary()
Specify file type (ASCII or BINARY) for vtk data file.
Definition: vtkSTLWriter.h:77
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDataObject * GetInput()
#define VTK_BINARY
Definition: vtkWriter.h:40
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
object to represent cell connectivity
Definition: vtkCellArray.h:44
write stereo lithography files
Definition: vtkSTLWriter.h:39
static vtkAlgorithm * New()
virtual void WriteData()=0
represent and manipulate 3D points
Definition: vtkPoints.h:33