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
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 
90 
92 
96  vtkSetMacro(ShapeResolution, int);
97  vtkGetMacro(ShapeResolution, int);
99 
109 
114 
115 protected:
117  ~vtkVRMLImporter() override;
118 
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;
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
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
object to represent cell connectivity
Definition: vtkCellArray.h:185
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:49
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual light for 3D rendering
Definition: vtkLight.h:58
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate 3D points
Definition: vtkPoints.h:38
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition: vtkProperty.h:66
abstract specification for renderers
Definition: vtkRenderer.h:71
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
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