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 =========================================================================*/
136 #ifndef vtkVRMLImporter_h
137 #define vtkVRMLImporter_h
138 
139 #include "vtkIOImportModule.h" // For export macro
140 #include "vtkImporter.h"
141 
142 class vtkActor;
143 class vtkAlgorithm;
144 class vtkProperty;
145 class vtkLight;
146 class vtkTransform;
147 class vtkLookupTable;
148 class vtkFloatArray;
149 class vtkPolyDataMapper;
150 class vtkPoints;
151 class vtkIdTypeArray;
152 class vtkVRMLImporterInternal;
153 class vtkVRMLYaccData;
154 class vtkCellArray;
155 
156 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
157 {
158 public:
159  static vtkVRMLImporter* New();
160 
161  vtkTypeMacro(vtkVRMLImporter, vtkImporter);
162  void PrintSelf(ostream& os, vtkIndent indent) override;
163 
165 
171 
173 
177  vtkSetMacro(ShapeResolution, int);
178  vtkGetMacro(ShapeResolution, int);
180 
190 
195 
196 protected:
198  ~vtkVRMLImporter() override;
199 
201  int ImportBegin() override;
202  void ImportEnd() override;
203  void ImportActors(vtkRenderer*) override {}
204  void ImportCameras(vtkRenderer*) override {}
205  void ImportLights(vtkRenderer*) override {}
206  void ImportProperties(vtkRenderer*) override {}
207 
209 
212  virtual void enterNode(const char*);
213  virtual void exitNode();
214  virtual void enterField(const char*);
215  virtual void exitField();
216  virtual void useNode(const char*);
218 
222  FILE* GetFileFD() { return this->FileFD; }
223 
224  char* FileName;
225  FILE* FileFD;
227 
228  friend class vtkVRMLYaccData;
229 
230 private:
231  vtkPoints* PointsNew();
232  vtkFloatArray* FloatArrayNew();
233  vtkIdTypeArray* IdTypeArrayNew();
234 
235  void DeleteObject(vtkObject*);
236 
237  vtkVRMLImporterInternal* Internal;
238  vtkVRMLYaccData* Parser;
239  vtkActor* CurrentActor;
240  vtkProperty* CurrentProperty;
241  vtkLight* CurrentLight;
242  vtkTransform* CurrentTransform;
243  vtkAlgorithm* CurrentSource;
244  vtkPoints* CurrentPoints;
245  vtkFloatArray* CurrentNormals;
246  vtkCellArray* CurrentNormalCells;
247  vtkFloatArray* CurrentTCoords;
248  vtkCellArray* CurrentTCoordCells;
249  vtkLookupTable* CurrentLut;
250  vtkFloatArray* CurrentScalars;
251  vtkPolyDataMapper* CurrentMapper;
252 
253 private:
254  vtkVRMLImporter(const vtkVRMLImporter&) = delete;
255  void operator=(const vtkVRMLImporter&) = delete;
256 };
257 
258 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:122
object to represent cell connectivity
Definition: vtkCellArray.h:296
dynamic, self-adjusting array of float
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:60
a simple class to control print indentation
Definition: vtkIndent.h:119
a virtual light for 3D rendering
Definition: vtkLight.h:169
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition: vtkObject.h:82
represent and manipulate 3D points
Definition: vtkPoints.h:149
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition: vtkProperty.h:177
abstract specification for renderers
Definition: vtkRenderer.h:182
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:170
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