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 =========================================================================*/
54 #ifndef vtkVRMLImporter_h
55 #define vtkVRMLImporter_h
56 
57 #include "vtkIOImportModule.h" // For export macro
58 #include "vtkImporter.h"
59 
60 class vtkActor;
61 class vtkAlgorithm;
62 class vtkProperty;
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 vtkVRMLYaccData;
72 class vtkCellArray;
73 
74 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
75 {
76 public:
77  static vtkVRMLImporter *New();
78 
79  vtkTypeMacro(vtkVRMLImporter, vtkImporter);
80  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
81 
83 
86  vtkSetStringMacro(FileName);
87  vtkGetStringMacro(FileName);
89 
91 
95  vtkSetMacro(ShapeResolution, int);
96  vtkGetMacro(ShapeResolution, int);
98 
107  vtkObject* GetVRMLDEFObject(const char *name);
108 
109 protected:
110  vtkVRMLImporter();
111  ~vtkVRMLImporter() VTK_OVERRIDE;
112 
113  int OpenImportFile();
114  int ImportBegin() VTK_OVERRIDE;
115  void ImportEnd() VTK_OVERRIDE;
116  void ImportActors(vtkRenderer*) VTK_OVERRIDE {}
117  void ImportCameras(vtkRenderer*) VTK_OVERRIDE {}
118  void ImportLights(vtkRenderer*) VTK_OVERRIDE {}
119  void ImportProperties(vtkRenderer*) VTK_OVERRIDE {}
120 
122 
125  virtual void enterNode(const char*);
126  virtual void exitNode();
127  virtual void enterField(const char*);
128  virtual void exitField();
129  virtual void useNode(const char*);
131 
135  FILE *GetFileFD() { return this->FileFD; }
136 
137  char *FileName;
138  FILE *FileFD;
140 
141  friend class vtkVRMLYaccData;
142 
143 private:
144  vtkPoints* PointsNew();
145  vtkFloatArray* FloatArrayNew();
146  vtkIdTypeArray* IdTypeArrayNew();
147 
148  void DeleteObject(vtkObject*);
149 
150  vtkVRMLImporterInternal* Internal;
151  vtkVRMLYaccData* Parser;
152  vtkActor* CurrentActor;
153  vtkProperty* CurrentProperty;
154  vtkLight* CurrentLight;
155  vtkTransform* CurrentTransform;
156  vtkAlgorithm* CurrentSource;
157  vtkPoints* CurrentPoints;
158  vtkFloatArray* CurrentNormals;
159  vtkCellArray* CurrentNormalCells;
160  vtkFloatArray* CurrentTCoords;
161  vtkCellArray* CurrentTCoordCells;
162  vtkLookupTable* CurrentLut;
163  vtkFloatArray* CurrentScalars;
164  vtkPolyDataMapper* CurrentMapper;
165 
166 private:
167  vtkVRMLImporter(const vtkVRMLImporter&) VTK_DELETE_FUNCTION;
168  void operator=(const vtkVRMLImporter&) VTK_DELETE_FUNCTION;
169 };
170 
171 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
abstract base class for most VTK objects
Definition: vtkObject.h:53
represent surface properties of a geometric object
Definition: vtkProperty.h:58
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
FILE * GetFileFD()
Return the file pointer to the open file.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
map scalar values into colors via a lookup table
void ImportLights(vtkRenderer *) override
abstract specification for renderers
Definition: vtkRenderer.h:57
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:54
void ImportProperties(vtkRenderer *) override
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
a simple class to control print indentation
Definition: vtkIndent.h:33
a virtual light for 3D rendering
Definition: vtkLight.h:55
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
void ImportCameras(vtkRenderer *) override
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:44
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
imports VRML 2.0 files.
represent and manipulate 3D points
Definition: vtkPoints.h:33