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
45#ifndef vtkVRMLImporter_h
46#define vtkVRMLImporter_h
47
48#include "vtkIOImportModule.h" // For export macro
49#include "vtkImporter.h"
50
51VTK_ABI_NAMESPACE_BEGIN
52class vtkActor;
53class vtkAlgorithm;
54class vtkProperty;
55class vtkLight;
56class vtkTransform;
57class vtkLookupTable;
58class vtkFloatArray;
60class vtkPoints;
61class vtkIdTypeArray;
62class vtkVRMLImporterInternal;
63class vtkVRMLYaccData;
64class vtkCellArray;
65
66class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
67{
68public:
70
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
75
81
83
87 vtkSetMacro(ShapeResolution, int);
88 vtkGetMacro(ShapeResolution, int);
90
99 vtkObject* GetVRMLDEFObject(const char* name);
100
104 std::string GetOutputsDescription() override;
105
106protected:
109
111 int ImportBegin() override;
112 void ImportEnd() override;
113 void ImportActors(vtkRenderer*) override {}
114 void ImportCameras(vtkRenderer*) override {}
115 void ImportLights(vtkRenderer*) override {}
116 void ImportProperties(vtkRenderer*) override {}
117
119
122 virtual void enterNode(const char*);
123 virtual void exitNode();
124 virtual void enterField(const char*);
125 virtual void exitField();
126 virtual void useNode(const char*);
128
132 FILE* GetFileFD() { return this->FileFD; }
133
134 char* FileName;
135 FILE* FileFD;
137
138 friend class vtkVRMLYaccData;
139
140private:
141 vtkPoints* PointsNew();
142 vtkFloatArray* FloatArrayNew();
143 vtkIdTypeArray* IdTypeArrayNew();
144
145 void DeleteObject(vtkObject*);
146
147 vtkVRMLImporterInternal* Internal;
148 vtkVRMLYaccData* Parser;
149 vtkActor* CurrentActor;
150 vtkProperty* CurrentProperty;
151 vtkLight* CurrentLight;
152 vtkTransform* CurrentTransform;
153 vtkAlgorithm* CurrentSource;
154 vtkPoints* CurrentPoints;
155 vtkFloatArray* CurrentNormals;
156 vtkCellArray* CurrentNormalCells;
157 vtkFloatArray* CurrentTCoords;
158 vtkCellArray* CurrentTCoordCells;
159 vtkLookupTable* CurrentLut;
160 vtkFloatArray* CurrentScalars;
161 vtkPolyDataMapper* CurrentMapper;
162
163 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
164 void operator=(const vtkVRMLImporter&) = delete;
165};
166
167VTK_ABI_NAMESPACE_END
168#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:41
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:29
a virtual light for 3D rendering
Definition vtkLight.h:49
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition vtkObject.h:49
represent and manipulate 3D points
Definition vtkPoints.h:29
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition vtkProperty.h:57
abstract specification for renderers
Definition vtkRenderer.h:59
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.