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
38class vtkCellArray;
39class vtkPoints;
40class vtkPolyData;
41
42class VTKIOGEOMETRY_EXPORT vtkSTLWriter : public vtkWriter
43{
44public:
45 static vtkSTLWriter *New();
46 vtkTypeMacro(vtkSTLWriter,vtkWriter);
47 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
48
50
56
58
61 vtkSetStringMacro(FileName);
64
66
69 vtkSetStringMacro(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
83protected:
86 {
87 delete[] this->FileName;
88 delete[] this->Header;
89 }
90
91 void WriteData();
92
94 vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips);
96 vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips);
97
98 char* FileName;
99 char *Header;
101
103
104private:
105 vtkSTLWriter(const vtkSTLWriter&) VTK_DELETE_FUNCTION;
106 void operator=(const vtkSTLWriter&) VTK_DELETE_FUNCTION;
107};
108
109#endif
110
object to represent cell connectivity
Definition: vtkCellArray.h:51
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:40
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
write stereo lithography files
Definition: vtkSTLWriter.h:43
char * Header
Definition: vtkSTLWriter.h:99
vtkPolyData * GetInput(int port)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
char * FileName
Definition: vtkSTLWriter.h:98
void WriteAsciiSTL(vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips)
void SetFileTypeToASCII()
Definition: vtkSTLWriter.h:79
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
static vtkSTLWriter * New()
vtkPolyData * GetInput()
Get the input to this writer.
void SetFileTypeToBinary()
Definition: vtkSTLWriter.h:80
void WriteData()
void WriteBinarySTL(vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips)
abstract class to write data to file(s)
Definition: vtkWriter.h:43
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
#define VTK_BINARY
Definition: vtkWriter.h:40
#define VTK_ASCII
Definition: vtkWriter.h:39