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 =========================================================================*/
31 #ifndef vtkSTLWriter_h
32 #define vtkSTLWriter_h
33 
34 #include "vtkIOGeometryModule.h" // For export macro
35 #include "vtkWriter.h"
36 
37 class vtkCellArray;
38 class vtkPoints;
39 class vtkPolyData;
40 
42 {
43 public:
44  static vtkSTLWriter *New();
45  vtkTypeMacro(vtkSTLWriter,vtkWriter);
46  virtual void PrintSelf(ostream& os, vtkIndent indent);
47 
49 
53 
55 
56  vtkSetStringMacro(FileName);
57  vtkGetStringMacro(FileName);
59 
61 
62  vtkSetClampMacro(FileType,int,VTK_ASCII,VTK_BINARY);
63  vtkGetMacro(FileType,int);
64  void SetFileTypeToASCII() {this->SetFileType(VTK_ASCII);};
65  void SetFileTypeToBinary() {this->SetFileType(VTK_BINARY);};
67 
68 protected:
69  vtkSTLWriter();
71  {
72  delete[] this->FileName;
73  delete[] this->Header;
74  }
75 
76  void WriteData();
77 
78  void WriteBinarySTL(vtkPoints *pts, vtkCellArray *polys);
79  void WriteAsciiSTL(vtkPoints *pts, vtkCellArray *polys);
80 
81  char* FileName;
82  char *Header;
83  int FileType;
84 
86 
87 private:
88  vtkSTLWriter(const vtkSTLWriter&); // Not implemented.
89  void operator=(const vtkSTLWriter&); // Not implemented.
90 };
91 
92 #endif
93 
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
#define VTK_ASCII
Definition: vtkWriter.h:41
char * FileName
Definition: vtkSTLWriter.h:81
#define VTKIOGEOMETRY_EXPORT
void SetFileTypeToASCII()
Definition: vtkSTLWriter.h:64
abstract class to write data to file(s)
Definition: vtkWriter.h:44
char * Header
Definition: vtkSTLWriter.h:82
void SetFileTypeToBinary()
Definition: vtkSTLWriter.h:65
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkDataObject * GetInput()
#define VTK_BINARY
Definition: vtkWriter.h:42
virtual int FillInputPortInformation(int port, vtkInformation *info)
object to represent cell connectivity
Definition: vtkCellArray.h:49
write stereo lithography files
Definition: vtkSTLWriter.h:41
static vtkAlgorithm * New()
virtual void WriteData()=0
void PrintSelf(ostream &os, vtkIndent indent)
represent and manipulate 3D points
Definition: vtkPoints.h:38