VTK  9.3.20240329
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
124 #ifndef vtkVRMLImporter_h
125 #define vtkVRMLImporter_h
126 
127 #include "vtkIOImportModule.h" // For export macro
128 #include "vtkImporter.h"
129 
130 VTK_ABI_NAMESPACE_BEGIN
131 class vtkActor;
132 class vtkAlgorithm;
133 class vtkProperty;
134 class vtkLight;
135 class vtkTransform;
136 class vtkLookupTable;
137 class vtkFloatArray;
138 class vtkPolyDataMapper;
139 class vtkPoints;
140 class vtkIdTypeArray;
141 class vtkVRMLImporterInternal;
142 class vtkVRMLYaccData;
143 class vtkCellArray;
144 
145 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
146 {
147 public:
148  static vtkVRMLImporter* New();
149 
150  vtkTypeMacro(vtkVRMLImporter, vtkImporter);
151  void PrintSelf(ostream& os, vtkIndent indent) override;
152 
154 
160 
162 
166  vtkSetMacro(ShapeResolution, int);
167  vtkGetMacro(ShapeResolution, int);
169 
179 
184 
185 protected:
187  ~vtkVRMLImporter() override;
188 
190  int ImportBegin() override;
191  void ImportEnd() override;
192  void ImportActors(vtkRenderer*) override {}
193  void ImportCameras(vtkRenderer*) override {}
194  void ImportLights(vtkRenderer*) override {}
195  void ImportProperties(vtkRenderer*) override {}
196 
198 
201  virtual void enterNode(const char*);
202  virtual void exitNode();
203  virtual void enterField(const char*);
204  virtual void exitField();
205  virtual void useNode(const char*);
207 
211  FILE* GetFileFD() { return this->FileFD; }
212 
213  char* FileName;
214  FILE* FileFD;
216 
217  friend class vtkVRMLYaccData;
218 
219 private:
220  vtkPoints* PointsNew();
221  vtkFloatArray* FloatArrayNew();
222  vtkIdTypeArray* IdTypeArrayNew();
223 
224  void DeleteObject(vtkObject*);
225 
226  vtkVRMLImporterInternal* Internal;
227  vtkVRMLYaccData* Parser;
228  vtkActor* CurrentActor;
229  vtkProperty* CurrentProperty;
230  vtkLight* CurrentLight;
231  vtkTransform* CurrentTransform;
232  vtkAlgorithm* CurrentSource;
233  vtkPoints* CurrentPoints;
234  vtkFloatArray* CurrentNormals;
235  vtkCellArray* CurrentNormalCells;
236  vtkFloatArray* CurrentTCoords;
237  vtkCellArray* CurrentTCoordCells;
238  vtkLookupTable* CurrentLut;
239  vtkFloatArray* CurrentScalars;
240  vtkPolyDataMapper* CurrentMapper;
241 
242  vtkVRMLImporter(const vtkVRMLImporter&) = delete;
243  void operator=(const vtkVRMLImporter&) = delete;
244 };
245 
246 VTK_ABI_NAMESPACE_END
247 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:151
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:162
object to represent cell connectivity
Definition: vtkCellArray.h:286
dynamic, self-adjusting array of float
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:52
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
Definition: vtkProperty.h:167
abstract specification for renderers
Definition: vtkRenderer.h:172
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:160
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
static vtkVRMLImporter * New()
FILE * GetFileFD()
Return the file pointer to the open file.
vtkSetFilePathMacro(FileName)
Specify the name of the file to read.
std::string GetOutputsDescription() override
Get a printable string describing the outputs.
void ImportEnd() override
virtual void enterField(const char *)
Needed by the yacc/lex grammar used.
void ImportProperties(vtkRenderer *) override
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...
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
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:219
@ string
Definition: vtkX3D.h:490