VTK  9.1.0
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=========================================================================*/
63#ifndef vtkVRMLImporter_h
64#define vtkVRMLImporter_h
65
66#include "vtkIOImportModule.h" // For export macro
67#include "vtkImporter.h"
68
69class vtkActor;
70class vtkAlgorithm;
71class vtkProperty;
72class vtkLight;
73class vtkTransform;
74class vtkLookupTable;
75class vtkFloatArray;
77class vtkPoints;
78class vtkIdTypeArray;
79class vtkVRMLImporterInternal;
80class vtkVRMLYaccData;
81class vtkCellArray;
82
83class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
84{
85public:
87
89 void PrintSelf(ostream& os, vtkIndent indent) override;
90
92
98
100
104 vtkSetMacro(ShapeResolution, int);
105 vtkGetMacro(ShapeResolution, int);
107
117
122
123protected:
126
128 int ImportBegin() override;
129 void ImportEnd() override;
130 void ImportActors(vtkRenderer*) override {}
131 void ImportCameras(vtkRenderer*) override {}
132 void ImportLights(vtkRenderer*) override {}
133 void ImportProperties(vtkRenderer*) override {}
134
136
139 virtual void enterNode(const char*);
140 virtual void exitNode();
141 virtual void enterField(const char*);
142 virtual void exitField();
143 virtual void useNode(const char*);
145
149 FILE* GetFileFD() { return this->FileFD; }
150
151 char* FileName;
152 FILE* FileFD;
154
155 friend class vtkVRMLYaccData;
156
157private:
158 vtkPoints* PointsNew();
159 vtkFloatArray* FloatArrayNew();
160 vtkIdTypeArray* IdTypeArrayNew();
161
162 void DeleteObject(vtkObject*);
163
164 vtkVRMLImporterInternal* Internal;
165 vtkVRMLYaccData* Parser;
166 vtkActor* CurrentActor;
167 vtkProperty* CurrentProperty;
168 vtkLight* CurrentLight;
169 vtkTransform* CurrentTransform;
170 vtkAlgorithm* CurrentSource;
171 vtkPoints* CurrentPoints;
172 vtkFloatArray* CurrentNormals;
173 vtkCellArray* CurrentNormalCells;
174 vtkFloatArray* CurrentTCoords;
175 vtkCellArray* CurrentTCoordCells;
176 vtkLookupTable* CurrentLut;
177 vtkFloatArray* CurrentScalars;
178 vtkPolyDataMapper* CurrentMapper;
179
180private:
181 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
182 void operator=(const vtkVRMLImporter&) = delete;
183};
184
185#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:55
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:64
object to represent cell connectivity
Definition: vtkCellArray.h:190
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:60
a simple class to control print indentation
Definition: vtkIndent.h:43
a virtual light for 3D rendering
Definition: vtkLight.h:66
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition: vtkObject.h:63
represent and manipulate 3D points
Definition: vtkPoints.h:43
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition: vtkProperty.h:71
abstract specification for renderers
Definition: vtkRenderer.h:73
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:64
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.
@ name
Definition: vtkX3D.h:225
@ string
Definition: vtkX3D.h:496