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