VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkIOImportModule.h" // For export macro
58 #include "vtkImporter.h"
59 
60 class vtkActor;
61 class vtkAlgorithm;
62 class vtkProperty;
63 class vtkCamera;
64 class vtkLight;
65 class vtkTransform;
66 class vtkLookupTable;
67 class vtkFloatArray;
68 class vtkPolyDataMapper;
69 class vtkPoints;
70 class vtkIdTypeArray;
71 class vtkVRMLImporterInternal;
72 class vtkCellArray;
73 
75 {
76 public:
77  static vtkVRMLImporter *New();
78 
80  void PrintSelf(ostream& os, vtkIndent indent);
81 
87  vtkObject *GetVRMLDEFObject(const char *name);
88 
90 
91  void enterNode(const char *);
92  void exitNode();
93  void enterField(const char *);
94  void exitField();
95  void useNode(const char *);
97 
99 
100  vtkSetStringMacro(FileName);
101  vtkGetStringMacro(FileName);
103 
105  FILE *GetFileFD() {return this->FileFD;};
106 
107 //BTX
108 
109  friend int yylex ( vtkVRMLImporter* );
110 
111 //ETX
112 
113 protected:
114  vtkVRMLImporter();
115  ~vtkVRMLImporter();
116 
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 
124  int OpenImportFile();
125  char *FileName;
126  FILE *FileFD;
127 
128 private:
129  vtkActor *CurrentActor;
130  vtkProperty *CurrentProperty;
131  vtkCamera *CurrentCamera;
132  vtkLight *CurrentLight;
133  vtkTransform *CurrentTransform;
134  vtkAlgorithm *CurrentSource;
135  vtkPoints *CurrentPoints;
136  vtkFloatArray *CurrentNormals;
137  vtkCellArray *CurrentNormalCells;
138  vtkFloatArray *CurrentTCoords;
139  vtkCellArray *CurrentTCoordCells;
140  vtkLookupTable *CurrentLut;
141  vtkFloatArray *CurrentScalars;
142  vtkPolyDataMapper *CurrentMapper;
143 
144  vtkPoints* PointsNew();
145  vtkFloatArray* FloatArrayNew();
146  vtkIdTypeArray* IdTypeArrayNew();
147 
148  void DeleteObject(vtkObject*);
149 
150  vtkVRMLImporterInternal* Internal;
151 
152 private:
153  vtkVRMLImporter(const vtkVRMLImporter&); // Not implemented.
154  void operator=(const vtkVRMLImporter&); // Not implemented.
155 };
156 
157 #endif
158 
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
GLuint const GLchar * name
Definition: vtkgl.h:11983
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
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:39