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 "vtkExporter.h"
33 
34 class vtkLight;
35 class vtkActor;
36 class vtkActor2D;
37 class vtkPoints;
38 class vtkDataArray;
41 class vtkRenderer;
42 
44 {
45 public:
46  static vtkX3DExporter *New();
47  vtkTypeMacro(vtkX3DExporter,vtkExporter);
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
52  vtkSetStringMacro(FileName);
53  vtkGetStringMacro(FileName);
55 
57 
58  vtkSetMacro(Speed,double);
59  vtkGetMacro(Speed,double);
61 
63 
64  vtkSetClampMacro(Binary, int, 0, 1);
65  vtkBooleanMacro(Binary, int);
66  vtkGetMacro(Binary, int);
68 
70 
71  vtkSetClampMacro(Fastest, int, 0, 1);
72  vtkBooleanMacro(Fastest, int);
73  vtkGetMacro(Fastest, int);
75 
77 
78  vtkSetMacro(WriteToOutputString,int);
79  vtkGetMacro(WriteToOutputString,int);
80  vtkBooleanMacro(WriteToOutputString,int);
82 
84 
87  vtkGetMacro(OutputStringLength, int);
88  vtkGetStringMacro(OutputString);
89  unsigned char *GetBinaryOutputString()
90  {
91  return reinterpret_cast<unsigned char *>(this->OutputString);
92  }
94 
98  char *RegisterAndGetOutputString();
99 
100 protected:
101  vtkX3DExporter();
102  ~vtkX3DExporter();
103 
104  // Stream management
108 
110  void WriteData();
111 
112  void WriteALight(vtkLight *aLight, vtkX3DExporterWriter* writer);
113  void WriteAnActor(vtkActor *anActor, vtkX3DExporterWriter* writer,
114  int index);
115  void WritePointData(vtkPoints *points, vtkDataArray *normals,
116  vtkDataArray *tcoords, vtkUnsignedCharArray *colors,
117  vtkX3DExporterWriter* writer, int index);
118  void WriteATextActor2D(vtkActor2D *anTextActor2D,
119  vtkX3DExporterWriter* writer);
120  void WriteATexture(vtkActor *anActor, vtkX3DExporterWriter* writer);
121  void WriteAnAppearance(vtkActor *anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
122  int HasHeadLight(vtkRenderer* ren);
123  char *FileName;
124  double Speed;
125  int Binary;
126  int Fastest;
127 
128 private:
129 
130  vtkX3DExporter(const vtkX3DExporter&); // Not implemented.
131  void operator=(const vtkX3DExporter&); // Not implemented.
132 };
133 
134 
135 #endif