VTK  9.4.20241219
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
37#ifndef vtkX3DExporter_h
38#define vtkX3DExporter_h
39
40#include "vtkExporter.h"
41#include "vtkIOExportModule.h" // For export macro
42
43VTK_ABI_NAMESPACE_BEGIN
44class vtkActor;
45class vtkActor2D;
46class vtkDataArray;
47class vtkLight;
48class vtkPoints;
49class vtkPolyData;
50class vtkRenderer;
53
54class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter
55{
56public:
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
62
68
70
73 vtkSetMacro(Speed, double);
74 vtkGetMacro(Speed, double);
76
78
81 vtkSetClampMacro(Binary, vtkTypeBool, 0, 1);
82 vtkBooleanMacro(Binary, vtkTypeBool);
83 vtkGetMacro(Binary, vtkTypeBool);
85
87
90 vtkSetClampMacro(Fastest, vtkTypeBool, 0, 1);
91 vtkBooleanMacro(Fastest, vtkTypeBool);
92 vtkGetMacro(Fastest, vtkTypeBool);
94
96
99 vtkSetMacro(WriteToOutputString, vtkTypeBool);
100 vtkGetMacro(WriteToOutputString, vtkTypeBool);
101 vtkBooleanMacro(WriteToOutputString, vtkTypeBool);
103
105
110 vtkGetMacro(OutputStringLength, vtkIdType);
111 vtkGetStringMacro(OutputString);
112 unsigned char* GetBinaryOutputString()
113 {
114 return reinterpret_cast<unsigned char*>(this->OutputString);
115 }
117
124
125protected:
127 ~vtkX3DExporter() override;
128
129 // Stream management
133
137 void WriteData() override;
138
140 void WriteAnActor(vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
141 void WriteAPiece(vtkPolyData* piece, vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
142 void WritePointData(vtkPoints* points, vtkDataArray* normals, vtkDataArray* tcoords,
143 vtkUnsignedCharArray* colors, vtkX3DExporterWriter* writer, int index);
144 void WriteATextActor2D(vtkActor2D* anTextActor2D, vtkX3DExporterWriter* writer);
146 void WriteAnAppearance(vtkActor* anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
147
148 // Called to give subclasses a chance to write additional nodes to the file.
149 // Default implementation does nothing.
150 virtual void WriteAdditionalNodes(vtkX3DExporterWriter* vtkNotUsed(writer)) {}
151
153
154 char* FileName;
155 double Speed;
158
159private:
160 vtkX3DExporter(const vtkX3DExporter&) = delete;
161 void operator=(const vtkX3DExporter&) = delete;
162};
163
164VTK_ABI_NAMESPACE_END
165#endif
a actor that draws 2D data
Definition vtkActor2D.h:145
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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:108
a virtual light for 3D rendering
Definition vtkLight.h:159
represent and manipulate 3D points
Definition vtkPoints.h:139
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract specification for renderers
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