VTK
vtkX3DExporter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkX3DExporter.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 =========================================================================*/
27 #ifndef vtkX3DExporter_h
28 #define vtkX3DExporter_h
29 
30 #include "vtkIOExportModule.h" // For export macro
31 #include "vtkExporter.h"
32 
33 class vtkLight;
34 class vtkActor;
35 class vtkActor2D;
36 class vtkPoints;
37 class vtkDataArray;
40 class vtkRenderer;
41 
42 class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter
43 {
44 public:
45  static vtkX3DExporter *New();
46  vtkTypeMacro(vtkX3DExporter,vtkExporter);
47  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
48 
50 
53  vtkSetStringMacro(FileName);
54  vtkGetStringMacro(FileName);
56 
58 
61  vtkSetMacro(Speed,double);
62  vtkGetMacro(Speed,double);
64 
66 
69  vtkSetClampMacro(Binary, int, 0, 1);
70  vtkBooleanMacro(Binary, int);
71  vtkGetMacro(Binary, int);
73 
75 
78  vtkSetClampMacro(Fastest, int, 0, 1);
79  vtkBooleanMacro(Fastest, int);
80  vtkGetMacro(Fastest, int);
82 
84 
87  vtkSetMacro(WriteToOutputString,int);
88  vtkGetMacro(WriteToOutputString,int);
89  vtkBooleanMacro(WriteToOutputString,int);
91 
93 
98  vtkGetMacro(OutputStringLength, int);
99  vtkGetStringMacro(OutputString);
100  unsigned char *GetBinaryOutputString()
101  {
102  return reinterpret_cast<unsigned char *>(this->OutputString);
103  }
105 
111  char *RegisterAndGetOutputString();
112 
113 protected:
114  vtkX3DExporter();
115  ~vtkX3DExporter() VTK_OVERRIDE;
116 
117  // Stream management
118  int WriteToOutputString;
119  char *OutputString;
120  int OutputStringLength;
121 
125  void WriteData() VTK_OVERRIDE;
126 
127  void WriteALight(vtkLight *aLight, vtkX3DExporterWriter* writer);
128  void WriteAnActor(vtkActor *anActor, vtkX3DExporterWriter* writer,
129  int index);
130  void WritePointData(vtkPoints *points, vtkDataArray *normals,
131  vtkDataArray *tcoords, vtkUnsignedCharArray *colors,
132  vtkX3DExporterWriter* writer, int index);
133  void WriteATextActor2D(vtkActor2D *anTextActor2D,
134  vtkX3DExporterWriter* writer);
135  void WriteATexture(vtkActor *anActor, vtkX3DExporterWriter* writer);
136  void WriteAnAppearance(vtkActor *anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
137  int HasHeadLight(vtkRenderer* ren);
138  char *FileName;
139  double Speed;
140  int Binary;
141  int Fastest;
142 
143 private:
144 
145  vtkX3DExporter(const vtkX3DExporter&) VTK_DELETE_FUNCTION;
146  void operator=(const vtkX3DExporter&) VTK_DELETE_FUNCTION;
147 };
148 
149 
150 #endif
abstract class to write a scene to a file
Definition: vtkExporter.h:46
represents an object (geometry &amp; properties) in a rendered scene
Definition: vtkActor.h:45
X3D Exporter Writer.
a actor that draws 2D data
Definition: vtkActor2D.h:39
abstract specification for renderers
Definition: vtkRenderer.h:57
unsigned char * GetBinaryOutputString()
When WriteToOutputString in on, then a string is allocated, written to, and can be retrieved with the...
create an x3d file
a simple class to control print indentation
Definition: vtkIndent.h:33
a virtual light for 3D rendering
Definition: vtkLight.h:55
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:33