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 
110  vtkObject* GetVRMLDEFObject(const char *name);
111 
112 protected:
113  vtkVRMLImporter();
114  ~vtkVRMLImporter();
115 
116  int OpenImportFile();
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:51
abstract base class for most VTK objects
Definition: vtkObject.h:59
represent surface properties of a geometric object
Definition: vtkProperty.h:64
FILE * GetFileFD()
Return the file pointer to the open file.
virtual void ImportProperties(vtkRenderer *)
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
map scalar values into colors via a lookup table
abstract specification for renderers
Definition: vtkRenderer.h:63
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:54
virtual void ImportEnd()
Definition: vtkImporter.h:97
virtual int ImportBegin()
Definition: vtkImporter.h:96
virtual void ImportActors(vtkRenderer *)
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:59
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual light for 3D rendering
Definition: vtkLight.h:61
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
map vtkPolyData to graphics primitives
object to represent cell connectivity
Definition: vtkCellArray.h:50
virtual void ImportCameras(vtkRenderer *)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void ImportLights(vtkRenderer *)
imports VRML 2.0 files.
represent and manipulate 3D points
Definition: vtkPoints.h:39