VTK  9.2.5
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 =========================================================================*/
49 #ifndef vtkX3DExporter_h
50 #define vtkX3DExporter_h
51 
52 #include "vtkExporter.h"
53 #include "vtkIOExportModule.h" // For export macro
54 
55 class vtkActor;
56 class vtkActor2D;
57 class vtkDataArray;
58 class vtkLight;
59 class vtkPoints;
60 class vtkPolyData;
61 class vtkRenderer;
64 
65 class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter
66 {
67 public:
68  static vtkX3DExporter* New();
69  vtkTypeMacro(vtkX3DExporter, vtkExporter);
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
73 
79 
81 
84  vtkSetMacro(Speed, double);
85  vtkGetMacro(Speed, double);
87 
89 
92  vtkSetClampMacro(Binary, vtkTypeBool, 0, 1);
93  vtkBooleanMacro(Binary, vtkTypeBool);
94  vtkGetMacro(Binary, vtkTypeBool);
96 
98 
101  vtkSetClampMacro(Fastest, vtkTypeBool, 0, 1);
102  vtkBooleanMacro(Fastest, vtkTypeBool);
103  vtkGetMacro(Fastest, vtkTypeBool);
105 
107 
110  vtkSetMacro(WriteToOutputString, vtkTypeBool);
111  vtkGetMacro(WriteToOutputString, vtkTypeBool);
112  vtkBooleanMacro(WriteToOutputString, vtkTypeBool);
114 
116 
121  vtkGetMacro(OutputStringLength, vtkIdType);
122  vtkGetStringMacro(OutputString);
123  unsigned char* GetBinaryOutputString()
124  {
125  return reinterpret_cast<unsigned char*>(this->OutputString);
126  }
128 
135 
136 protected:
138  ~vtkX3DExporter() override;
139 
140  // Stream management
144 
148  void WriteData() override;
149 
150  void WriteALight(vtkLight* aLight, vtkX3DExporterWriter* writer);
151  void WriteAnActor(vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
152  void WriteAPiece(vtkPolyData* piece, vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
154  vtkUnsignedCharArray* colors, vtkX3DExporterWriter* writer, int index);
155  void WriteATextActor2D(vtkActor2D* anTextActor2D, vtkX3DExporterWriter* writer);
156  void WriteATexture(vtkActor* anActor, vtkX3DExporterWriter* writer);
157  void WriteAnAppearance(vtkActor* anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
158 
159  // Called to give subclasses a chance to write additional nodes to the file.
160  // Default implementation does nothing.
161  virtual void WriteAdditionalNodes(vtkX3DExporterWriter* vtkNotUsed(writer)) {}
162 
164 
165  char* FileName;
166  double Speed;
169 
170 private:
171  vtkX3DExporter(const vtkX3DExporter&) = delete;
172  void operator=(const vtkX3DExporter&) = delete;
173 };
174 
175 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:155
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
abstract class to write a scene to a file
Definition: vtkExporter.h:48
a simple class to control print indentation
Definition: vtkIndent.h:119
a virtual light for 3D rendering
Definition: vtkLight.h:169
represent and manipulate 3D points
Definition: vtkPoints.h:149
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
abstract specification for renderers
Definition: vtkRenderer.h:182
dynamic, self-adjusting array of unsigned char
X3D Exporter Writer.
create an x3d file
int HasHeadLight(vtkRenderer *ren)
unsigned char * GetBinaryOutputString()
When WriteToOutputString in on, then a string is allocated, written to, and can be retrieved with the...
vtkTypeBool WriteToOutputString
vtkTypeBool Fastest
vtkSetFilePathMacro(FileName)
Set/Get the output file name.
vtkGetFilePathMacro(FileName)
Set/Get the output file name.
void WriteALight(vtkLight *aLight, vtkX3DExporterWriter *writer)
vtkIdType OutputStringLength
void WriteATexture(vtkActor *anActor, vtkX3DExporterWriter *writer)
void WriteAnAppearance(vtkActor *anActor, bool writeEmissiveColor, vtkX3DExporterWriter *writer)
virtual void WriteAdditionalNodes(vtkX3DExporterWriter *vtkNotUsed(writer))
void WriteAPiece(vtkPolyData *piece, vtkActor *anActor, vtkX3DExporterWriter *writer, int index)
void WriteAnActor(vtkActor *anActor, vtkX3DExporterWriter *writer, int index)
void WriteData() override
Write data to output.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkX3DExporter() override
vtkTypeBool Binary
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to nullptr, so that the user is responsible...
void WriteATextActor2D(vtkActor2D *anTextActor2D, vtkX3DExporterWriter *writer)
static vtkX3DExporter * New()
void WritePointData(vtkPoints *points, vtkDataArray *normals, vtkDataArray *tcoords, vtkUnsignedCharArray *colors, vtkX3DExporterWriter *writer, int index)
@ points
Definition: vtkX3D.h:452
@ index
Definition: vtkX3D.h:252
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332