VTK  9.6.20260526
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
128
129#ifndef vtkVRMLImporter_h
130#define vtkVRMLImporter_h
131
132#include "vtkIOImportModule.h" // For export macro
133#include "vtkImporter.h"
134
135VTK_ABI_NAMESPACE_BEGIN
136class vtkActor;
137class vtkAlgorithm;
138class vtkProperty;
139class vtkLight;
140class vtkTransform;
141class vtkLookupTable;
142class vtkFloatArray;
144class vtkPoints;
145class vtkIdTypeArray;
146class vtkVRMLImporterInternal;
147class vtkVRMLYaccData;
148class vtkCellArray;
149class vtkPolyData;
150
151class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
152{
153public:
155
157 void PrintSelf(ostream& os, vtkIndent indent) override;
158
160
164 vtkSetMacro(ShapeResolution, int);
165 vtkGetMacro(ShapeResolution, int);
167
176 vtkObject* GetVRMLDEFObject(const char* name);
177
181 std::string GetOutputsDescription() override;
182
183protected:
186
188 int ImportBegin() override;
189 void ImportEnd() override;
190 void ImportActors(vtkRenderer*) override {}
191 void ImportCameras(vtkRenderer*) override {}
192 void ImportLights(vtkRenderer*) override {}
193 void ImportProperties(vtkRenderer*) override {}
194
196
199 virtual void enterNode(const char*);
200 virtual void exitNode();
201 virtual void enterField(const char*);
202 virtual void exitField();
203 virtual void useNode(const char*);
205
209 FILE* GetFileFD() { return this->FileFD; }
210
211 FILE* FileFD;
213
214 friend class vtkVRMLYaccData;
215
216private:
217 vtkPoints* PointsNew();
218 vtkFloatArray* FloatArrayNew();
219 vtkIdTypeArray* IdTypeArrayNew();
220
221 void DeleteObject(vtkObject*);
222
223 vtkVRMLImporterInternal* Internal;
224 vtkVRMLYaccData* Parser;
225 vtkActor* CurrentActor;
226 vtkProperty* CurrentProperty;
228 vtkLight* CurrentLight;
229 vtkTransform* CurrentTransform;
230 vtkAlgorithm* CurrentSource;
231 vtkPoints* CurrentPoints;
232 vtkFloatArray* CurrentNormals;
233 vtkCellArray* CurrentNormalCells;
234 vtkFloatArray* CurrentTCoords;
235 vtkCellArray* CurrentTCoordCells;
236 vtkLookupTable* CurrentLut;
237 vtkFloatArray* CurrentScalars;
238 vtkPolyDataMapper* CurrentMapper;
239 struct ExtrusionOptions
240 {
241 bool beginCap;
242 bool endCap;
243 } CurrenExtrusionOptions;
244 struct TransformOptions
245 {
246 double scale[3];
247 float rotation[4];
248 double translation[3];
249 bool scaleSet;
250 bool rotationSet;
251 bool translationSet;
252 } CurrentTransformOptions;
253
254 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
255 void operator=(const vtkVRMLImporter&) = delete;
256};
257
258VTK_ABI_NAMESPACE_END
259#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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:108
a virtual light for 3D rendering
Definition vtkLight.h:159
map scalar values into colors via a lookup table
represent and manipulate 3D points
Definition vtkPoints.h:140
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a geometric object
abstract specification for renderers
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