VTK  9.7.0
vtkVRMLImporter.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
49
50#ifndef vtkVRMLImporter_h
51#define vtkVRMLImporter_h
52
53#include "vtkIOImportModule.h" // For export macro
54#include "vtkImporter.h"
55
56VTK_ABI_NAMESPACE_BEGIN
57class vtkActor;
58class vtkAlgorithm;
59class vtkProperty;
60class vtkLight;
61class vtkTransform;
62class vtkLookupTable;
63class vtkFloatArray;
65class vtkPoints;
66class vtkIdTypeArray;
67class vtkVRMLImporterInternal;
68class vtkVRMLYaccData;
69class vtkCellArray;
70class vtkPolyData;
71
72class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
73{
74public:
76
78 void PrintSelf(ostream& os, vtkIndent indent) override;
79
81
85 vtkSetMacro(ShapeResolution, int);
86 vtkGetMacro(ShapeResolution, int);
88
97 vtkObject* GetVRMLDEFObject(const char* name);
98
102 std::string GetOutputsDescription() override;
103
104protected:
107
109 int ImportBegin() override;
110 void ImportEnd() override;
111 void ImportActors(vtkRenderer*) override {}
112 void ImportCameras(vtkRenderer*) override {}
113 void ImportLights(vtkRenderer*) override {}
114 void ImportProperties(vtkRenderer*) override {}
115
117
120 virtual void enterNode(const char*);
121 virtual void exitNode();
122 virtual void enterField(const char*);
123 virtual void exitField();
124 virtual void useNode(const char*);
126
130 FILE* GetFileFD() { return this->FileFD; }
131
132 FILE* FileFD;
134
135 friend class vtkVRMLYaccData;
136
137private:
138 vtkPoints* PointsNew();
139 vtkFloatArray* FloatArrayNew();
140 vtkIdTypeArray* IdTypeArrayNew();
141
142 void DeleteObject(vtkObject*);
143
144 vtkVRMLImporterInternal* Internal;
145 vtkVRMLYaccData* Parser;
146 vtkActor* CurrentActor;
147 vtkProperty* CurrentProperty;
149 vtkLight* CurrentLight;
150 vtkTransform* CurrentTransform;
151 vtkAlgorithm* CurrentSource;
152 vtkPoints* CurrentPoints;
153 vtkFloatArray* CurrentNormals;
154 vtkCellArray* CurrentNormalCells;
155 vtkFloatArray* CurrentTCoords;
156 vtkCellArray* CurrentTCoordCells;
157 vtkLookupTable* CurrentLut;
158 vtkFloatArray* CurrentScalars;
159 vtkPolyDataMapper* CurrentMapper;
160 struct ExtrusionOptions
161 {
162 bool beginCap;
163 bool endCap;
164 } CurrenExtrusionOptions;
165 struct TransformOptions
166 {
167 double scale[3];
168 float rotation[4];
169 double translation[3];
170 bool scaleSet;
171 bool rotationSet;
172 bool translationSet;
173 } CurrentTransformOptions;
174
175 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
176 void operator=(const vtkVRMLImporter&) = delete;
177};
178
179VTK_ABI_NAMESPACE_END
180#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
object to represent cell connectivity
dynamic, self-adjusting array of float
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
a virtual light for 3D rendering
Definition vtkLight.h:50
map scalar values into colors via a lookup table
represent and manipulate 3D points
Definition vtkPoints.h:31
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
represent surface properties of a geometric object
Definition vtkProperty.h:60
abstract specification for renderers
Definition vtkRenderer.h:64
Hold a reference to a vtkObjectBase instance.
describes linear transformations via a 4x4 matrix
void ImportLights(vtkRenderer *) override
void ImportCameras(vtkRenderer *) override
void ImportActors(vtkRenderer *) override
virtual void useNode(const char *)
Needed by the yacc/lex grammar used.
virtual void exitNode()
Needed by the yacc/lex grammar used.
~vtkVRMLImporter() override
std::string GetOutputsDescription() override
Get a printable string describing the outputs.
vtkObject * GetVRMLDEFObject(const char *name)
In the VRML spec you can DEF and USE nodes (name them), This routine will return the associated VTK o...
void ImportEnd() override
virtual void enterField(const char *)
Needed by the yacc/lex grammar used.
FILE * GetFileFD()
Return the file pointer to the open file.
void ImportProperties(vtkRenderer *) override
virtual void enterNode(const char *)
Needed by the yacc/lex grammar used.
int ImportBegin() override
static vtkVRMLImporter * New()
virtual void exitField()
Needed by the yacc/lex grammar used.
friend class vtkVRMLYaccData
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define vtkAlgorithm