VTK
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 =========================================================================*/
57 #ifndef vtkVRMLImporter_h
58 #define vtkVRMLImporter_h
59 
60 #include "vtkIOImportModule.h" // For export macro
61 #include "vtkImporter.h"
62 
63 class vtkActor;
64 class vtkAlgorithm;
65 class vtkProperty;
66 class vtkLight;
67 class vtkTransform;
68 class vtkLookupTable;
69 class vtkFloatArray;
70 class vtkPolyDataMapper;
71 class vtkPoints;
72 class vtkIdTypeArray;
73 class vtkVRMLImporterInternal;
74 class vtkVRMLYaccData;
75 class vtkCellArray;
76 
77 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
78 {
79 public:
80  static vtkVRMLImporter *New();
81 
82  vtkTypeMacro(vtkVRMLImporter, vtkImporter);
83  void PrintSelf(ostream& os, vtkIndent indent);
84 
86 
89  vtkSetStringMacro(FileName);
90  vtkGetStringMacro(FileName);
92 
94 
98  vtkSetMacro(ShapeResolution, int);
99  vtkGetMacro(ShapeResolution, int);
101 
111 
112 protected:
115 
117  virtual int ImportBegin();
118  virtual void ImportEnd();
119  virtual void ImportActors(vtkRenderer*) {}
120  virtual void ImportCameras(vtkRenderer*) {}
121  virtual void ImportLights(vtkRenderer*) {}
122  virtual void ImportProperties(vtkRenderer*) {}
123 
125 
128  virtual void enterNode(const char*);
129  virtual void exitNode();
130  virtual void enterField(const char*);
131  virtual void exitField();
132  virtual void useNode(const char*);
134 
138  FILE *GetFileFD() { return this->FileFD; }
139 
140  char *FileName;
141  FILE *FileFD;
143 
144  friend class vtkVRMLYaccData;
145 
146 private:
147  vtkPoints* PointsNew();
148  vtkFloatArray* FloatArrayNew();
149  vtkIdTypeArray* IdTypeArrayNew();
150 
151  void DeleteObject(vtkObject*);
152 
153  vtkVRMLImporterInternal* Internal;
154  vtkVRMLYaccData* Parser;
155  vtkActor* CurrentActor;
156  vtkProperty* CurrentProperty;
157  vtkLight* CurrentLight;
158  vtkTransform* CurrentTransform;
159  vtkAlgorithm* CurrentSource;
160  vtkPoints* CurrentPoints;
161  vtkFloatArray* CurrentNormals;
162  vtkCellArray* CurrentNormalCells;
163  vtkFloatArray* CurrentTCoords;
164  vtkCellArray* CurrentTCoordCells;
165  vtkLookupTable* CurrentLut;
166  vtkFloatArray* CurrentScalars;
167  vtkPolyDataMapper* CurrentMapper;
168 
169 private:
170  vtkVRMLImporter(const vtkVRMLImporter&) VTK_DELETE_FUNCTION;
171  void operator=(const vtkVRMLImporter&) VTK_DELETE_FUNCTION;
172 };
173 
174 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
object to represent cell connectivity
Definition: vtkCellArray.h:51
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:55
a simple class to control print indentation
Definition: vtkIndent.h:40
a virtual light for 3D rendering
Definition: vtkLight.h:62
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition: vtkObject.h:60
represent and manipulate 3D points
Definition: vtkPoints.h:40
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition: vtkProperty.h:65
abstract specification for renderers
Definition: vtkRenderer.h:64
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
imports VRML 2.0 files.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void ImportProperties(vtkRenderer *)
virtual void ImportCameras(vtkRenderer *)
virtual void useNode(const char *)
virtual int ImportBegin()
virtual void exitNode()
static vtkVRMLImporter * New()
FILE * GetFileFD()
Return the file pointer to the open file.
virtual void ImportActors(vtkRenderer *)
virtual void enterField(const char *)
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...
virtual void ImportEnd()
virtual void enterNode(const char *)
Needed by the yacc/lex grammar used.
virtual void ImportLights(vtkRenderer *)
virtual void exitField()
@ name
Definition: vtkX3D.h:219
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.