VTK: IO/Import/vtkVRMLImporter.h Source File

| VTK 9.3.1

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
60 VTK_ABI_NAMESPACE_BEGIN
61 class vtkActor;
62 class vtkAlgorithm;
63 class vtkProperty;
64 class vtkLight;
65 class vtkTransform;
66 class vtkLookupTable;
67 class vtkFloatArray;
68 class vtkPolyDataMapper;
69 class vtkPoints;
70 class vtkIdTypeArray;
71 class vtkVRMLImporterInternal;
72 class vtkVRMLYaccData;
73 class vtkCellArray;
74
75 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
76 {
77 public:
78 static vtkVRMLImporter* New();
79
80 vtkTypeMacro(vtkVRMLImporter, vtkImporter);
81 void PrintSelf(ostream& os, vtkIndent indent) override;
82
84
87 vtkSetFilePathMacro(FileName);
88 vtkGetFilePathMacro(FileName);
90
92
96 vtkSetMacro(ShapeResolution, int);
97 vtkGetMacro(ShapeResolution, int);
99
108 vtkObject* GetVRMLDEFObject(const char* name);
109
113 std::string GetOutputsDescription() override;
114
115 protected:
116 vtkVRMLImporter();
117 ~vtkVRMLImporter() override;
118
119 int OpenImportFile();
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;
145 int ShapeResolution;
146
147 friend class vtkVRMLYaccData;
148
149 private:
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
176 VTK_ABI_NAMESPACE_END
177 #endif
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:185
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkImporter
importer abstract class
Definition: vtkImporter.h:49
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkLight
a virtual light for 3D rendering
Definition: vtkLight.h:58
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:73
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:66
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
vtkVRMLImporter
imports VRML 2.0 files.
Definition: vtkVRMLImporter.h:76
vtkVRMLImporter::ImportLights
void ImportLights(vtkRenderer *) override
Definition: vtkVRMLImporter.h:124
vtkVRMLImporter::ImportCameras
void ImportCameras(vtkRenderer *) override
Definition: vtkVRMLImporter.h:123
vtkVRMLImporter::ImportActors
void ImportActors(vtkRenderer *) override
Definition: vtkVRMLImporter.h:122
vtkVRMLImporter::useNode
virtual void useNode(const char *)
Needed by the yacc/lex grammar used.
vtkVRMLImporter::FileName
char * FileName
Definition: vtkVRMLImporter.h:143
vtkVRMLImporter::FileFD
FILE * FileFD
Definition: vtkVRMLImporter.h:144
vtkVRMLImporter::ShapeResolution
int ShapeResolution
Definition: vtkVRMLImporter.h:145
vtkVRMLImporter::exitNode
virtual void exitNode()
Needed by the yacc/lex grammar used.
vtkVRMLImporter::~vtkVRMLImporter
~vtkVRMLImporter() override
vtkVRMLImporter::New
static vtkVRMLImporter * New()
vtkVRMLImporter::vtkVRMLImporter
vtkVRMLImporter()
vtkVRMLImporter::GetFileFD
FILE * GetFileFD()
Return the file pointer to the open file.
Definition: vtkVRMLImporter.h:141
vtkVRMLImporter::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
Specify the name of the file to read.
vtkVRMLImporter::GetOutputsDescription
std::string GetOutputsDescription() override
Get a printable string describing the outputs.
vtkVRMLImporter::ImportEnd
void ImportEnd() override
vtkVRMLImporter::enterField
virtual void enterField(const char *)
Needed by the yacc/lex grammar used.
vtkVRMLImporter::ImportProperties
void ImportProperties(vtkRenderer *) override
Definition: vtkVRMLImporter.h:125
vtkVRMLImporter::OpenImportFile
int OpenImportFile()
vtkVRMLImporter::GetVRMLDEFObject
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...
vtkVRMLImporter::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
Specify the name of the file to read.
vtkVRMLImporter::enterNode
virtual void enterNode(const char *)
Needed by the yacc/lex grammar used.
vtkVRMLImporter::ImportBegin
int ImportBegin() override
vtkVRMLImporter::exitField
virtual void exitField()
Needed by the yacc/lex grammar used.
vtkVRMLImporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVRMLYaccData
Definition: vtkVRMLImporter_Yacc.h:110
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkImporter.h