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