VTK  9.1.0
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=========================================================================*/
36#ifndef vtkX3DExporter_h
37#define vtkX3DExporter_h
38
39#include "vtkExporter.h"
40#include "vtkIOExportModule.h" // For export macro
41
42class vtkActor;
43class vtkActor2D;
44class vtkDataArray;
45class vtkLight;
46class vtkPoints;
47class vtkPolyData;
48class vtkRenderer;
51
52class VTKIOEXPORT_EXPORT vtkX3DExporter : public vtkExporter
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
66
68
71 vtkSetMacro(Speed, double);
72 vtkGetMacro(Speed, double);
74
76
79 vtkSetClampMacro(Binary, vtkTypeBool, 0, 1);
80 vtkBooleanMacro(Binary, vtkTypeBool);
81 vtkGetMacro(Binary, vtkTypeBool);
83
85
88 vtkSetClampMacro(Fastest, vtkTypeBool, 0, 1);
89 vtkBooleanMacro(Fastest, vtkTypeBool);
90 vtkGetMacro(Fastest, vtkTypeBool);
92
94
97 vtkSetMacro(WriteToOutputString, vtkTypeBool);
98 vtkGetMacro(WriteToOutputString, vtkTypeBool);
99 vtkBooleanMacro(WriteToOutputString, vtkTypeBool);
101
103
108 vtkGetMacro(OutputStringLength, vtkIdType);
109 vtkGetStringMacro(OutputString);
110 unsigned char* GetBinaryOutputString()
111 {
112 return reinterpret_cast<unsigned char*>(this->OutputString);
113 }
115
122
123protected:
125 ~vtkX3DExporter() override;
126
127 // Stream management
131
135 void WriteData() override;
136
138 void WriteAnActor(vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
139 void WriteAPiece(vtkPolyData* piece, vtkActor* anActor, vtkX3DExporterWriter* writer, int index);
141 vtkUnsignedCharArray* colors, vtkX3DExporterWriter* writer, int index);
142 void WriteATextActor2D(vtkActor2D* anTextActor2D, vtkX3DExporterWriter* writer);
144 void WriteAnAppearance(vtkActor* anActor, bool writeEmissiveColor, vtkX3DExporterWriter* writer);
145
146 // Called to give subclasses a chance to write additional nodes to the file.
147 // Default implementation does nothing.
148 virtual void WriteAdditionalNodes(vtkX3DExporterWriter* vtkNotUsed(writer)) {}
149
151
152 char* FileName;
153 double Speed;
156
157private:
158 vtkX3DExporter(const vtkX3DExporter&) = delete;
159 void operator=(const vtkX3DExporter&) = delete;
160};
161
162#endif
a actor that draws 2D data
Definition: vtkActor2D.h:49
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:55
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
abstract class to write a scene to a file
Definition: vtkExporter.h:48
a simple class to control print indentation
Definition: vtkIndent.h:43
a virtual light for 3D rendering
Definition: vtkLight.h:66
represent and manipulate 3D points
Definition: vtkPoints.h:43
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:95
abstract specification for renderers
Definition: vtkRenderer.h:73
dynamic, self-adjusting array of unsigned char
X3D Exporter Writer.
create an x3d file
int HasHeadLight(vtkRenderer *ren)
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.
~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)
@ points
Definition: vtkX3D.h:452
@ index
Definition: vtkX3D.h:252
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332