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
45 #ifndef vtkVRMLImporter_h
46 #define vtkVRMLImporter_h
47 
48 #include "vtkIOImportModule.h" // For export macro
49 #include "vtkImporter.h"
50 
51 VTK_ABI_NAMESPACE_BEGIN
52 class vtkActor;
53 class vtkAlgorithm;
54 class vtkProperty;
55 class vtkLight;
56 class vtkTransform;
57 class vtkLookupTable;
58 class vtkFloatArray;
59 class vtkPolyDataMapper;
60 class vtkPoints;
61 class vtkIdTypeArray;
62 class vtkVRMLImporterInternal;
63 class vtkVRMLYaccData;
64 class vtkCellArray;
65 
66 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
67 {
68 public:
69  static vtkVRMLImporter* New();
70 
71  vtkTypeMacro(vtkVRMLImporter, vtkImporter);
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
75 
81 
83 
87  vtkSetMacro(ShapeResolution, int);
88  vtkGetMacro(ShapeResolution, int);
90 
100 
105 
106 protected:
108  ~vtkVRMLImporter() override;
109 
111  int ImportBegin() override;
112  void ImportEnd() override;
113  void ImportActors(vtkRenderer*) override {}
114  void ImportCameras(vtkRenderer*) override {}
115  void ImportLights(vtkRenderer*) override {}
116  void ImportProperties(vtkRenderer*) override {}
117 
119 
122  virtual void enterNode(const char*);
123  virtual void exitNode();
124  virtual void enterField(const char*);
125  virtual void exitField();
126  virtual void useNode(const char*);
128 
132  FILE* GetFileFD() { return this->FileFD; }
133 
134  char* FileName;
135  FILE* FileFD;
137 
138  friend class vtkVRMLYaccData;
139 
140 private:
141  vtkPoints* PointsNew();
142  vtkFloatArray* FloatArrayNew();
143  vtkIdTypeArray* IdTypeArrayNew();
144 
145  void DeleteObject(vtkObject*);
146 
147  vtkVRMLImporterInternal* Internal;
148  vtkVRMLYaccData* Parser;
149  vtkActor* CurrentActor;
150  vtkProperty* CurrentProperty;
151  vtkLight* CurrentLight;
152  vtkTransform* CurrentTransform;
153  vtkAlgorithm* CurrentSource;
154  vtkPoints* CurrentPoints;
155  vtkFloatArray* CurrentNormals;
156  vtkCellArray* CurrentNormalCells;
157  vtkFloatArray* CurrentTCoords;
158  vtkCellArray* CurrentTCoordCells;
159  vtkLookupTable* CurrentLut;
160  vtkFloatArray* CurrentScalars;
161  vtkPolyDataMapper* CurrentMapper;
162 
163  vtkVRMLImporter(const vtkVRMLImporter&) = delete;
164  void operator=(const vtkVRMLImporter&) = delete;
165 };
166 
167 VTK_ABI_NAMESPACE_END
168 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:52
object to represent cell connectivity
Definition: vtkCellArray.h:176
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:49
a simple class to control print indentation
Definition: vtkIndent.h:29
a virtual light for 3D rendering
Definition: vtkLight.h:49
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition: vtkObject.h:52
represent and manipulate 3D points
Definition: vtkPoints.h:29
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition: vtkProperty.h:57
abstract specification for renderers
Definition: vtkRenderer.h:62
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:50
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