VTK  9.3.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
54#ifndef vtkVRMLImporter_h
55#define vtkVRMLImporter_h
56
57#include "vtkIOImportModule.h" // For export macro
58#include "vtkImporter.h"
59
60VTK_ABI_NAMESPACE_BEGIN
61class vtkActor;
62class vtkAlgorithm;
63class vtkProperty;
64class vtkLight;
65class vtkTransform;
66class vtkLookupTable;
67class vtkFloatArray;
69class vtkPoints;
70class vtkIdTypeArray;
71class vtkVRMLImporterInternal;
72class vtkVRMLYaccData;
73class vtkCellArray;
74
75class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
76{
77public:
79
81 void PrintSelf(ostream& os, vtkIndent indent) override;
82
84
90
92
96 vtkSetMacro(ShapeResolution, int);
97 vtkGetMacro(ShapeResolution, int);
99
108 vtkObject* GetVRMLDEFObject(const char* name);
109
113 std::string GetOutputsDescription() override;
114
115protected:
118
120 int ImportBegin() override;
121 void ImportEnd() override;
122 void ImportActors(vtkRenderer*) override {}
123 void ImportCameras(vtkRenderer*) override {}
124 void ImportLights(vtkRenderer*) override {}
125 void ImportProperties(vtkRenderer*) override {}
126
128
131 virtual void enterNode(const char*);
132 virtual void exitNode();
133 virtual void enterField(const char*);
134 virtual void exitField();
135 virtual void useNode(const char*);
137
141 FILE* GetFileFD() { return this->FileFD; }
142
143 char* FileName;
144 FILE* FileFD;
146
147 friend class vtkVRMLYaccData;
148
149private:
150 vtkPoints* PointsNew();
151 vtkFloatArray* FloatArrayNew();
152 vtkIdTypeArray* IdTypeArrayNew();
153
154 void DeleteObject(vtkObject*);
155
156 vtkVRMLImporterInternal* Internal;
157 vtkVRMLYaccData* Parser;
158 vtkActor* CurrentActor;
159 vtkProperty* CurrentProperty;
160 vtkLight* CurrentLight;
161 vtkTransform* CurrentTransform;
162 vtkAlgorithm* CurrentSource;
163 vtkPoints* CurrentPoints;
164 vtkFloatArray* CurrentNormals;
165 vtkCellArray* CurrentNormalCells;
166 vtkFloatArray* CurrentTCoords;
167 vtkCellArray* CurrentTCoordCells;
168 vtkLookupTable* CurrentLut;
169 vtkFloatArray* CurrentScalars;
170 vtkPolyDataMapper* CurrentMapper;
171
172 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
173 void operator=(const vtkVRMLImporter&) = delete;
174};
175
176VTK_ABI_NAMESPACE_END
177#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:50
Superclass for all sources, filters, and sinks in VTK.
object to represent cell connectivity
dynamic, self-adjusting array of float
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition vtkImporter.h:49
a simple class to control print indentation
Definition vtkIndent.h:38
a virtual light for 3D rendering
Definition vtkLight.h:58
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition vtkObject.h:58
represent and manipulate 3D points
Definition vtkPoints.h:38
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition vtkProperty.h:66
abstract specification for renderers
Definition vtkRenderer.h:68
describes linear transformations via a 4x4 matrix
imports VRML 2.0 files.
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
vtkSetFilePathMacro(FileName)
Specify the name of the file to read.
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
vtkGetFilePathMacro(FileName)
Specify the name of the file to read.
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.