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