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 =========================================================================*/
30 #ifndef vtkX3DExporter_h
31 #define vtkX3DExporter_h
32 
33 #include "vtkIOExportModule.h" // For export macro
34 #include "vtkExporter.h"
35 
36 class vtkLight;
37 class vtkActor;
38 class vtkActor2D;
39 class vtkPoints;
40 class vtkDataArray;
43 class vtkRenderer;
44 
45 class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter
46 {
47 public:
48  static vtkX3DExporter *New();
49  vtkTypeMacro(vtkX3DExporter,vtkExporter);
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
56  vtkSetStringMacro(FileName);
57  vtkGetStringMacro(FileName);
59 
61 
64  vtkSetMacro(Speed,double);
65  vtkGetMacro(Speed,double);
67 
69 
72  vtkSetClampMacro(Binary, int, 0, 1);
73  vtkBooleanMacro(Binary, int);
74  vtkGetMacro(Binary, int);
76 
78 
81  vtkSetClampMacro(Fastest, int, 0, 1);
82  vtkBooleanMacro(Fastest, int);
83  vtkGetMacro(Fastest, int);
85 
87 
90  vtkSetMacro(WriteToOutputString,int);
91  vtkGetMacro(WriteToOutputString,int);
92  vtkBooleanMacro(WriteToOutputString,int);
94 
96 
101  vtkGetMacro(OutputStringLength, int);
102  vtkGetStringMacro(OutputString);
103  unsigned char *GetBinaryOutputString()
104  {
105  return reinterpret_cast<unsigned char *>(this->OutputString);
106  }
108 
114  char *RegisterAndGetOutputString();
115 
116 protected:
117  vtkX3DExporter();
118  ~vtkX3DExporter();
119 
120  // Stream management
124 
128  void WriteData();
129 
130  void WriteALight(vtkLight *aLight, vtkX3DExporterWriter* writer);
131  void WriteAnActor(vtkActor *anActor, vtkX3DExporterWriter* writer,
132  int index);
133  void WritePointData(vtkPoints *points, vtkDataArray *normals,
134  vtkDataArray *tcoords, vtkUnsignedCharArray *colors,
135  vtkX3DExporterWriter* writer, int index);
136  void WriteATextActor2D(vtkActor2D *anTextActor2D,
137  vtkX3DExporterWriter* writer);
138  void WriteATexture(vtkActor *anActor, vtkX3DExporterWriter* writer);
139  void WriteAnAppearance(vtkActor *anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
140  int HasHeadLight(vtkRenderer* ren);
141  char *FileName;
142  double Speed;
143  int Binary;
144  int Fastest;
145 
146 private:
147 
148  vtkX3DExporter(const vtkX3DExporter&) VTK_DELETE_FUNCTION;
149  void operator=(const vtkX3DExporter&) VTK_DELETE_FUNCTION;
150 };
151 
152 
153 #endif
abstract class to write a scene to a file
Definition: vtkExporter.h:46
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
X3D Exporter Writer.
virtual void WriteData()=0
a actor that draws 2D data
Definition: vtkActor2D.h:45
abstract specification for renderers
Definition: vtkRenderer.h:63
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:39
a virtual light for 3D rendering
Definition: vtkLight.h:61
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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:39