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 
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 
103 
104 protected:
107 
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
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkVRMLImporter::ImportLights
virtual void ImportLights(vtkRenderer *)
Definition: vtkVRMLImporter.h:113
vtkVRMLImporter::vtkVRMLImporter
vtkVRMLImporter()
vtkVRMLImporter::GetFileFD
FILE * GetFileFD()
Definition: vtkVRMLImporter.h:126
vtkImporter
importer abstract class
Definition: vtkImporter.h:54
vtkLight
a virtual light for 3D rendering
Definition: vtkLight.h:61
vtkImporter.h
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:49
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
vtkVRMLImporter::FileFD
FILE * FileFD
Definition: vtkVRMLImporter.h:129
vtkVRMLImporter::ImportCameras
virtual void ImportCameras(vtkRenderer *)
Definition: vtkVRMLImporter.h:112
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkVRMLImporter::enterNode
virtual void enterNode(const char *)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkVRMLImporter::enterField
virtual void enterField(const char *)
vtkVRMLImporter::ImportProperties
virtual void ImportProperties(vtkRenderer *)
Definition: vtkVRMLImporter.h:114
vtkVRMLImporter::ShapeResolution
int ShapeResolution
Definition: vtkVRMLImporter.h:130
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkVRMLImporter::ImportActors
virtual void ImportActors(vtkRenderer *)
Definition: vtkVRMLImporter.h:111
vtkIOImportModule.h
vtkVRMLImporter::OpenImportFile
int OpenImportFile()
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkVRMLImporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkVRMLImporter::exitNode
virtual void exitNode()
vtkVRMLImporter::exitField
virtual void exitField()
vtkVRMLImporter::FileName
char * FileName
Definition: vtkVRMLImporter.h:128
VTKIOIMPORT_EXPORT
#define VTKIOIMPORT_EXPORT
Definition: vtkIOImportModule.h:15
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:74
vtkVRMLImporter::useNode
virtual void useNode(const char *)
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:49
vtkVRMLImporter::New
static vtkVRMLImporter * New()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkVRMLImporter::GetVRMLDEFObject
vtkObject * GetVRMLDEFObject(const char *name)
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkVRMLImporter::ImportBegin
virtual int ImportBegin()
vtkVRMLImporter
imports VRML 2.0 files.
Definition: vtkVRMLImporter.h:77
vtkVRMLImporter::ImportEnd
virtual void ImportEnd()
vtkVRMLImporter::~vtkVRMLImporter
~vtkVRMLImporter()
vtkVRMLYaccData
Definition: vtkVRMLImporter_Yacc.h:118