VTK  9.2.6
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
30#ifndef vtkSTLWriter_h
31#define vtkSTLWriter_h
32
33#include "vtkIOGeometryModule.h" // For export macro
34#include "vtkWriter.h"
35
36class vtkCellArray;
37class vtkPoints;
38class vtkPolyData;
40
41class VTKIOGEOMETRY_EXPORT vtkSTLWriter : public vtkWriter
42{
43public:
44 static vtkSTLWriter* New();
45 vtkTypeMacro(vtkSTLWriter, vtkWriter);
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
49
55
57
63
65
69 vtkSetStringMacro(Header);
70 vtkGetStringMacro(Header);
72
74
80 virtual void SetBinaryHeader(vtkUnsignedCharArray* binaryHeader);
83
85
88 vtkSetClampMacro(FileType, int, VTK_ASCII, VTK_BINARY);
89 vtkGetMacro(FileType, int);
93
94protected:
96 ~vtkSTLWriter() override;
97
98 void WriteData() override;
99
102
103 char* FileName;
104 char* Header;
107
108 int FillInputPortInformation(int port, vtkInformation* info) override;
109
110private:
111 vtkSTLWriter(const vtkSTLWriter&) = delete;
112 void operator=(const vtkSTLWriter&) = delete;
113};
114
115#endif
object to represent cell connectivity
a simple class to control print indentation
Definition vtkIndent.h:34
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
virtual void SetFileType(int)
Specify file type (ASCII or BINARY) for vtk data file.
virtual void SetBinaryHeader(vtkUnsignedCharArray *binaryHeader)
Set binary header for the file.
vtkPolyData * GetInput(int port)
Get the input to this writer.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkSTLWriter() override
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void WriteAsciiSTL(vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips)
void SetFileTypeToASCII()
Specify file type (ASCII or BINARY) for vtk data file.
static vtkSTLWriter * New()
vtkSetFilePathMacro(FileName)
Specify file name of vtk polygon data file to write.
vtkPolyData * GetInput()
Get the input to this writer.
void SetFileTypeToBinary()
Specify file type (ASCII or BINARY) for vtk data file.
vtkUnsignedCharArray * BinaryHeader
vtkGetFilePathMacro(FileName)
Specify file name of vtk polygon data file to write.
void WriteData() override
void WriteBinarySTL(vtkPoints *pts, vtkCellArray *polys, vtkCellArray *strips)
dynamic, self-adjusting array of unsigned char
#define VTK_BINARY
Definition vtkWriter.h:43
#define VTK_ASCII
Definition vtkWriter.h:42