VTK  9.4.20241118
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#ifndef vtkVRMLImporter_h
129#define vtkVRMLImporter_h
130
131#include "vtkIOImportModule.h" // For export macro
132#include "vtkImporter.h"
133
134VTK_ABI_NAMESPACE_BEGIN
135class vtkActor;
136class vtkAlgorithm;
137class vtkProperty;
138class vtkLight;
139class vtkTransform;
140class vtkLookupTable;
141class vtkFloatArray;
143class vtkPoints;
144class vtkIdTypeArray;
145class vtkVRMLImporterInternal;
146class vtkVRMLYaccData;
147class vtkCellArray;
148
149class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
150{
151public:
153
155 void PrintSelf(ostream& os, vtkIndent indent) override;
156
158
164
166
170 vtkSetMacro(ShapeResolution, int);
171 vtkGetMacro(ShapeResolution, int);
173
182 vtkObject* GetVRMLDEFObject(const char* name);
183
187 std::string GetOutputsDescription() override;
188
189protected:
192
194 int ImportBegin() override;
195 void ImportEnd() override;
196 void ImportActors(vtkRenderer*) override {}
197 void ImportCameras(vtkRenderer*) override {}
198 void ImportLights(vtkRenderer*) override {}
199 void ImportProperties(vtkRenderer*) override {}
200
202
205 virtual void enterNode(const char*);
206 virtual void exitNode();
207 virtual void enterField(const char*);
208 virtual void exitField();
209 virtual void useNode(const char*);
211
215 FILE* GetFileFD() { return this->FileFD; }
216
217 char* FileName;
218 FILE* FileFD;
220
221 friend class vtkVRMLYaccData;
222
223private:
224 vtkPoints* PointsNew();
225 vtkFloatArray* FloatArrayNew();
226 vtkIdTypeArray* IdTypeArrayNew();
227
228 void DeleteObject(vtkObject*);
229
230 vtkVRMLImporterInternal* Internal;
231 vtkVRMLYaccData* Parser;
232 vtkActor* CurrentActor;
233 vtkProperty* CurrentProperty;
234 vtkLight* CurrentLight;
235 vtkTransform* CurrentTransform;
236 vtkAlgorithm* CurrentSource;
237 vtkPoints* CurrentPoints;
238 vtkFloatArray* CurrentNormals;
239 vtkCellArray* CurrentNormalCells;
240 vtkFloatArray* CurrentTCoords;
241 vtkCellArray* CurrentTCoordCells;
242 vtkLookupTable* CurrentLut;
243 vtkFloatArray* CurrentScalars;
244 vtkPolyDataMapper* CurrentMapper;
245
246 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
247 void operator=(const vtkVRMLImporter&) = delete;
248};
249
250VTK_ABI_NAMESPACE_END
251#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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:55
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
abstract base class for most VTK objects
Definition vtkObject.h:162
represent and manipulate 3D points
Definition vtkPoints.h:139
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
abstract specification for renderers
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.