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
18#ifndef vtkX3DExporter_h
19#define vtkX3DExporter_h
20
21#include "vtkExporter.h"
22#include "vtkIOExportModule.h" // For export macro
23
24VTK_ABI_NAMESPACE_BEGIN
25class vtkActor;
26class vtkActor2D;
27class vtkDataArray;
28class vtkLight;
29class vtkPoints;
30class vtkPolyData;
31class vtkRenderer;
34
35class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43
49
51
54 vtkSetMacro(Speed, double);
55 vtkGetMacro(Speed, double);
57
59
62 vtkSetClampMacro(Binary, vtkTypeBool, 0, 1);
63 vtkBooleanMacro(Binary, vtkTypeBool);
64 vtkGetMacro(Binary, vtkTypeBool);
66
68
71 vtkSetClampMacro(Fastest, vtkTypeBool, 0, 1);
72 vtkBooleanMacro(Fastest, vtkTypeBool);
73 vtkGetMacro(Fastest, vtkTypeBool);
75
77
80 vtkSetMacro(WriteToOutputString, vtkTypeBool);
81 vtkGetMacro(WriteToOutputString, vtkTypeBool);
82 vtkBooleanMacro(WriteToOutputString, vtkTypeBool);
84
86
91 vtkGetMacro(OutputStringLength, vtkIdType);
92 vtkGetStringMacro(OutputString);
93 unsigned char* GetBinaryOutputString()
94 {
95 return reinterpret_cast<unsigned char*>(this->OutputString);
96 }
98
105
106protected:
108 ~vtkX3DExporter() override;
109
110 // Stream management
114
118 void WriteData() override;
119
121 void WriteAnActor(vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
122 void WriteAPiece(vtkPolyData* piece, vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
123 void WritePointData(vtkPoints* points, vtkDataArray* normals, vtkDataArray* tcoords,
124 vtkUnsignedCharArray* colors, vtkX3DExporterWriter* writer, int index);
125 void WriteATextActor2D(vtkActor2D* anTextActor2D, vtkX3DExporterWriter* writer);
127 void WriteAnAppearance(vtkActor* anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
128
129 // Called to give subclasses a chance to write additional nodes to the file.
130 // Default implementation does nothing.
131 virtual void WriteAdditionalNodes(vtkX3DExporterWriter* vtkNotUsed(writer)) {}
132
134
135 char* FileName;
136 double Speed;
139
140private:
141 vtkX3DExporter(const vtkX3DExporter&) = delete;
142 void operator=(const vtkX3DExporter&) = delete;
143};
144
145VTK_ABI_NAMESPACE_END
146#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:41
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:29
a virtual light for 3D rendering
Definition vtkLight.h:49
represent and manipulate 3D points
Definition vtkPoints.h:29
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
abstract specification for renderers
Definition vtkRenderer.h:59
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