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 =========================================================================*/
29 #ifndef vtkX3DExporter_h
30 #define vtkX3DExporter_h
31 
32 #include "vtkIOExportModule.h" // For export macro
33 #include "vtkExporter.h"
34 
35 class vtkLight;
36 class vtkActor;
37 class vtkActor2D;
38 class vtkPoints;
39 class vtkDataArray;
42 class vtkRenderer;
43 
45 {
46 public:
47  static vtkX3DExporter *New();
48  vtkTypeMacro(vtkX3DExporter,vtkExporter);
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
53  vtkSetStringMacro(FileName);
54  vtkGetStringMacro(FileName);
56 
58 
59  vtkSetMacro(Speed,double);
60  vtkGetMacro(Speed,double);
62 
64 
65  vtkSetClampMacro(Binary, int, 0, 1);
66  vtkBooleanMacro(Binary, int);
67  vtkGetMacro(Binary, int);
69 
71 
72  vtkSetClampMacro(Fastest, int, 0, 1);
73  vtkBooleanMacro(Fastest, int);
74  vtkGetMacro(Fastest, int);
76 
78 
79  vtkSetMacro(WriteToOutputString,int);
80  vtkGetMacro(WriteToOutputString,int);
81  vtkBooleanMacro(WriteToOutputString,int);
83 
85 
88  vtkGetMacro(OutputStringLength, int);
89  vtkGetStringMacro(OutputString);
90  unsigned char *GetBinaryOutputString()
91  {
92  return reinterpret_cast<unsigned char *>(this->OutputString);
93  }
95 
99  char *RegisterAndGetOutputString();
100 
101 protected:
102  vtkX3DExporter();
103  ~vtkX3DExporter();
104 
105  // Stream management
109 
111  void WriteData();
112 
113  void WriteALight(vtkLight *aLight, vtkX3DExporterWriter* writer);
114  void WriteAnActor(vtkActor *anActor, vtkX3DExporterWriter* writer,
115  int index);
116  void WritePointData(vtkPoints *points, vtkDataArray *normals,
117  vtkDataArray *tcoords, vtkUnsignedCharArray *colors,
118  vtkX3DExporterWriter* writer, int index);
119  void WriteATextActor2D(vtkActor2D *anTextActor2D,
120  vtkX3DExporterWriter* writer);
121  void WriteATexture(vtkActor *anActor, vtkX3DExporterWriter* writer);
122  void WriteAnAppearance(vtkActor *anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
123  int HasHeadLight(vtkRenderer* ren);
124  char *FileName;
125  double Speed;
126  int Binary;
127  int Fastest;
128 
129 private:
130 
131  vtkX3DExporter(const vtkX3DExporter&); // Not implemented.
132  void operator=(const vtkX3DExporter&); // Not implemented.
133 };
134 
135 
136 #endif
abstract class to write a scene to a file
Definition: vtkExporter.h:45
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
X3D Exporter Writer.
virtual void WriteData()=0
a actor that draws 2D data
Definition: vtkActor2D.h:44
#define VTKIOEXPORT_EXPORT
abstract specification for renderers
Definition: vtkRenderer.h:63
unsigned char * GetBinaryOutputString()
create an x3d file
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual light for 3D rendering
Definition: vtkLight.h:60
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
dynamic, self-adjusting array of unsigned char
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38