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 =========================================================================*/
53 #ifndef __vtkVRMLImporter_h
54 #define __vtkVRMLImporter_h
55 
56 // Includes for the yacc/lex parser
57 #include "vtkImporter.h"
58 
59 class vtkActor;
60 class vtkAlgorithm;
61 class vtkProperty;
62 class vtkCamera;
63 class vtkLight;
64 class vtkTransform;
65 class vtkLookupTable;
66 class vtkFloatArray;
67 class vtkPolyDataMapper;
68 class vtkPoints;
69 class vtkIdTypeArray;
70 class vtkVRMLImporterInternal;
71 class vtkCellArray;
72 
74 {
75 public:
76  static vtkVRMLImporter *New();
77 
79  void PrintSelf(ostream& os, vtkIndent indent);
80 
86  vtkObject *GetVRMLDEFObject(const char *name);
87 
89 
90  void enterNode(const char *);
91  void exitNode();
92  void enterField(const char *);
93  void exitField();
94  void useNode(const char *);
96 
98 
99  vtkSetStringMacro(FileName);
100  vtkGetStringMacro(FileName);
102 
104  FILE *GetFileFD() {return this->FileFD;};
105 
106 //BTX
107 
108  friend int yylex ( vtkVRMLImporter* );
109 
110 //ETX
111 
112 protected:
113  vtkVRMLImporter();
114  ~vtkVRMLImporter();
115 
116  virtual int ImportBegin ();
117  virtual void ImportEnd ();
118  virtual void ImportActors (vtkRenderer *) {};
119  virtual void ImportCameras (vtkRenderer *) {};
120  virtual void ImportLights (vtkRenderer *) {};
121  virtual void ImportProperties (vtkRenderer *) {};
122 
123  int OpenImportFile();
124  char *FileName;
125  FILE *FileFD;
126 
127 private:
128  vtkActor *CurrentActor;
129  vtkProperty *CurrentProperty;
130  vtkCamera *CurrentCamera;
131  vtkLight *CurrentLight;
132  vtkTransform *CurrentTransform;
133  vtkAlgorithm *CurrentSource;
134  vtkPoints *CurrentPoints;
135  vtkFloatArray *CurrentNormals;
136  vtkCellArray *CurrentNormalCells;
137  vtkFloatArray *CurrentTCoords;
138  vtkCellArray *CurrentTCoordCells;
139  vtkLookupTable *CurrentLut;
140  vtkFloatArray *CurrentScalars;
141  vtkPolyDataMapper *CurrentMapper;
142 
143  vtkPoints* PointsNew();
144  vtkFloatArray* FloatArrayNew();
145  vtkIdTypeArray* IdTypeArrayNew();
146 
147  void DeleteObject(vtkObject*);
148 
149  vtkVRMLImporterInternal* Internal;
150 
151 private:
152  vtkVRMLImporter(const vtkVRMLImporter&); // Not implemented.
153  void operator=(const vtkVRMLImporter&); // Not implemented.
154 };
155 
156 #endif
157 
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:60
represent surface properties of a geometric object
Definition: vtkProperty.h:61
virtual void ImportProperties(vtkRenderer *)
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
map scalar values into colors via a lookup table
abstract specification for renderers
Definition: vtkRenderer.h:69
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:52
virtual void ImportEnd()
Definition: vtkImporter.h:90
virtual int ImportBegin()
Definition: vtkImporter.h:89
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:37
a virtual camera for 3D rendering
Definition: vtkCamera.h:47
a virtual light for 3D rendering
Definition: vtkLight.h:59
void PrintSelf(ostream &os, vtkIndent indent)
map vtkPolyData to graphics primitives
object to represent cell connectivity
Definition: vtkCellArray.h:48
virtual void ImportCameras(vtkRenderer *)
static vtkObject * New()
#define VTK_HYBRID_EXPORT
virtual void ImportLights(vtkRenderer *)
imports VRML 2.0 files.
represent and manipulate 3D points
Definition: vtkPoints.h:38