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 =========================================================================*/
56 #ifndef vtkVRMLImporter_h
57 #define vtkVRMLImporter_h
58 
59 #include "vtkIOImportModule.h" // For export macro
60 #include "vtkImporter.h"
61 
62 class vtkActor;
63 class vtkAlgorithm;
64 class vtkProperty;
65 class vtkLight;
66 class vtkTransform;
67 class vtkLookupTable;
68 class vtkFloatArray;
69 class vtkPolyDataMapper;
70 class vtkPoints;
71 class vtkIdTypeArray;
72 class vtkVRMLImporterInternal;
73 class vtkVRMLYaccData;
74 class vtkCellArray;
75 
77 {
78 public:
79  static vtkVRMLImporter *New();
80 
81  vtkTypeMacro(vtkVRMLImporter, vtkImporter);
82  void PrintSelf(ostream& os, vtkIndent indent);
83 
85 
86  vtkSetStringMacro(FileName);
87  vtkGetStringMacro(FileName);
89 
91 
93  vtkSetMacro(ShapeResolution, int);
94  vtkGetMacro(ShapeResolution, int);
96 
102  vtkObject* GetVRMLDEFObject(const char *name);
103 
104 protected:
105  vtkVRMLImporter();
106  ~vtkVRMLImporter();
107 
108  int OpenImportFile();
109  virtual int ImportBegin();
110  virtual void ImportEnd();
111  virtual void ImportActors(vtkRenderer*) {}
112  virtual void ImportCameras(vtkRenderer*) {}
113  virtual void ImportLights(vtkRenderer*) {}
114  virtual void ImportProperties(vtkRenderer*) {}
115 
117 
118  virtual void enterNode(const char*);
119  virtual void exitNode();
120  virtual void enterField(const char*);
121  virtual void exitField();
122  virtual void useNode(const char*);
124 
126  FILE *GetFileFD() { return this->FileFD; }
127 
128  char *FileName;
129  FILE *FileFD;
131 
132  friend class vtkVRMLYaccData;
133 
134 private:
135  vtkPoints* PointsNew();
136  vtkFloatArray* FloatArrayNew();
137  vtkIdTypeArray* IdTypeArrayNew();
138 
139  void DeleteObject(vtkObject*);
140 
141  vtkVRMLImporterInternal* Internal;
142  vtkVRMLYaccData* Parser;
143  vtkActor* CurrentActor;
144  vtkProperty* CurrentProperty;
145  vtkLight* CurrentLight;
146  vtkTransform* CurrentTransform;
147  vtkAlgorithm* CurrentSource;
148  vtkPoints* CurrentPoints;
149  vtkFloatArray* CurrentNormals;
150  vtkCellArray* CurrentNormalCells;
151  vtkFloatArray* CurrentTCoords;
152  vtkCellArray* CurrentTCoordCells;
153  vtkLookupTable* CurrentLut;
154  vtkFloatArray* CurrentScalars;
155  vtkPolyDataMapper* CurrentMapper;
156 
157 private:
158  vtkVRMLImporter(const vtkVRMLImporter&); // Not implemented.
159  void operator=(const vtkVRMLImporter&); // Not implemented.
160 };
161 
162 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent surface properties of a geometric object
Definition: vtkProperty.h:63
virtual void ImportProperties(vtkRenderer *)
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
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:59
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:53
virtual void ImportEnd()
Definition: vtkImporter.h:91
virtual int ImportBegin()
Definition: vtkImporter.h:90
virtual void ImportActors(vtkRenderer *)
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual light for 3D rendering
Definition: vtkLight.h:60
void PrintSelf(ostream &os, vtkIndent indent)
map vtkPolyData to graphics primitives
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual void ImportCameras(vtkRenderer *)
#define VTKIOIMPORT_EXPORT
static vtkObject * New()
virtual void ImportLights(vtkRenderer *)
imports VRML 2.0 files.
represent and manipulate 3D points
Definition: vtkPoints.h:38