VTK  9.2.6
vtkVRMLImporter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkVRMLImporter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
66#ifndef vtkVRMLImporter_h
67#define vtkVRMLImporter_h
68
69#include "vtkIOImportModule.h" // For export macro
70#include "vtkImporter.h"
71
72class vtkActor;
73class vtkAlgorithm;
74class vtkProperty;
75class vtkLight;
76class vtkTransform;
77class vtkLookupTable;
78class vtkFloatArray;
80class vtkPoints;
81class vtkIdTypeArray;
82class vtkVRMLImporterInternal;
83class vtkVRMLYaccData;
84class vtkCellArray;
85
86class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
87{
88public:
90
92 void PrintSelf(ostream& os, vtkIndent indent) override;
93
95
101
103
107 vtkSetMacro(ShapeResolution, int);
108 vtkGetMacro(ShapeResolution, int);
110
119 vtkObject* GetVRMLDEFObject(const char* name);
120
124 std::string GetOutputsDescription() override;
125
126protected:
129
131 int ImportBegin() override;
132 void ImportEnd() override;
133 void ImportActors(vtkRenderer*) override {}
134 void ImportCameras(vtkRenderer*) override {}
135 void ImportLights(vtkRenderer*) override {}
136 void ImportProperties(vtkRenderer*) override {}
137
139
142 virtual void enterNode(const char*);
143 virtual void exitNode();
144 virtual void enterField(const char*);
145 virtual void exitField();
146 virtual void useNode(const char*);
148
152 FILE* GetFileFD() { return this->FileFD; }
153
154 char* FileName;
155 FILE* FileFD;
157
158 friend class vtkVRMLYaccData;
159
160private:
161 vtkPoints* PointsNew();
162 vtkFloatArray* FloatArrayNew();
163 vtkIdTypeArray* IdTypeArrayNew();
164
165 void DeleteObject(vtkObject*);
166
167 vtkVRMLImporterInternal* Internal;
168 vtkVRMLYaccData* Parser;
169 vtkActor* CurrentActor;
170 vtkProperty* CurrentProperty;
171 vtkLight* CurrentLight;
172 vtkTransform* CurrentTransform;
173 vtkAlgorithm* CurrentSource;
174 vtkPoints* CurrentPoints;
175 vtkFloatArray* CurrentNormals;
176 vtkCellArray* CurrentNormalCells;
177 vtkFloatArray* CurrentTCoords;
178 vtkCellArray* CurrentTCoordCells;
179 vtkLookupTable* CurrentLut;
180 vtkFloatArray* CurrentScalars;
181 vtkPolyDataMapper* CurrentMapper;
182
183private:
184 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
185 void operator=(const vtkVRMLImporter&) = delete;
186};
187
188#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:61
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:60
a simple class to control print indentation
Definition vtkIndent.h:49
a virtual light for 3D rendering
Definition vtkLight.h:69
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition vtkObject.h:72
represent and manipulate 3D points
Definition vtkPoints.h:49
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition vtkProperty.h:77
abstract specification for renderers
Definition vtkRenderer.h:82
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.