VTK  9.3.0
vtkX3DExporter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
27#ifndef vtkX3DExporter_h
28#define vtkX3DExporter_h
29
30#include "vtkExporter.h"
31#include "vtkIOExportModule.h" // For export macro
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkActor;
35class vtkActor2D;
36class vtkDataArray;
37class vtkLight;
38class vtkPoints;
39class vtkPolyData;
40class vtkRenderer;
43
44class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter
45{
46public:
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
58
60
63 vtkSetMacro(Speed, double);
64 vtkGetMacro(Speed, double);
66
68
71 vtkSetClampMacro(Binary, vtkTypeBool, 0, 1);
72 vtkBooleanMacro(Binary, vtkTypeBool);
73 vtkGetMacro(Binary, vtkTypeBool);
75
77
80 vtkSetClampMacro(Fastest, vtkTypeBool, 0, 1);
81 vtkBooleanMacro(Fastest, vtkTypeBool);
82 vtkGetMacro(Fastest, vtkTypeBool);
84
86
89 vtkSetMacro(WriteToOutputString, vtkTypeBool);
90 vtkGetMacro(WriteToOutputString, vtkTypeBool);
91 vtkBooleanMacro(WriteToOutputString, vtkTypeBool);
93
95
100 vtkGetMacro(OutputStringLength, vtkIdType);
101 vtkGetStringMacro(OutputString);
102 unsigned char* GetBinaryOutputString()
103 {
104 return reinterpret_cast<unsigned char*>(this->OutputString);
105 }
107
114
115protected:
117 ~vtkX3DExporter() override;
118
119 // Stream management
123
127 void WriteData() override;
128
130 void WriteAnActor(vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
131 void WriteAPiece(vtkPolyData* piece, vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
132 void WritePointData(vtkPoints* points, vtkDataArray* normals, vtkDataArray* tcoords,
133 vtkUnsignedCharArray* colors, vtkX3DExporterWriter* writer, int index);
134 void WriteATextActor2D(vtkActor2D* anTextActor2D, vtkX3DExporterWriter* writer);
136 void WriteAnAppearance(vtkActor* anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
137
138 // Called to give subclasses a chance to write additional nodes to the file.
139 // Default implementation does nothing.
140 virtual void WriteAdditionalNodes(vtkX3DExporterWriter* vtkNotUsed(writer)) {}
141
143
144 char* FileName;
145 double Speed;
148
149private:
150 vtkX3DExporter(const vtkX3DExporter&) = delete;
151 void operator=(const vtkX3DExporter&) = delete;
152};
153
154VTK_ABI_NAMESPACE_END
155#endif
a actor that draws 2D data
Definition vtkActor2D.h:44
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:50
abstract superclass for arrays of numeric data
abstract class to write a scene to a file
Definition vtkExporter.h:37
a simple class to control print indentation
Definition vtkIndent.h:38
a virtual light for 3D rendering
Definition vtkLight.h:58
represent and manipulate 3D points
Definition vtkPoints.h:38
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:89
abstract specification for renderers
Definition vtkRenderer.h:68
dynamic, self-adjusting array of unsigned char
X3D Exporter Writer.
create an x3d file
vtkTypeBool WriteToOutputString
vtkTypeBool Fastest
vtkSetFilePathMacro(FileName)
Set/Get the output file name.
vtkGetFilePathMacro(FileName)
Set/Get the output file name.
unsigned char * GetBinaryOutputString()
When WriteToOutputString in on, then a string is allocated, written to, and can be retrieved with the...
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to nullptr, so that the user is responsible...
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.
vtkTypeBool HasHeadLight(vtkRenderer *ren)
~vtkX3DExporter() override
vtkTypeBool Binary
static vtkX3DExporter * New()
void WriteATextActor2D(vtkActor2D *anTextActor2D, vtkX3DExporterWriter *writer)
void WritePointData(vtkPoints *points, vtkDataArray *normals, vtkDataArray *tcoords, vtkUnsignedCharArray *colors, vtkX3DExporterWriter *writer, int index)
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315