VTK  9.2.6
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 =========================================================================*/
57 #ifndef vtkVRMLImporter_h
58 #define vtkVRMLImporter_h
59 
60 #include "vtkIOImportModule.h" // For export macro
61 #include "vtkImporter.h"
62 
63 class vtkActor;
64 class vtkAlgorithm;
65 class vtkProperty;
66 class vtkLight;
67 class vtkTransform;
68 class vtkLookupTable;
69 class vtkFloatArray;
70 class vtkPolyDataMapper;
71 class vtkPoints;
72 class vtkIdTypeArray;
73 class vtkVRMLImporterInternal;
74 class vtkVRMLYaccData;
75 class vtkCellArray;
76 
77 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
78 {
79 public:
80  static vtkVRMLImporter* New();
81 
82  vtkTypeMacro(vtkVRMLImporter, vtkImporter);
83  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
86 
89  vtkSetFilePathMacro(FileName);
90  vtkGetFilePathMacro(FileName);
92 
94 
98  vtkSetMacro(ShapeResolution, int);
99  vtkGetMacro(ShapeResolution, int);
101 
110  vtkObject* GetVRMLDEFObject(const char* name);
111 
116 
117 protected:
118  vtkVRMLImporter();
119  ~vtkVRMLImporter() override;
120 
121  int OpenImportFile();
122  int ImportBegin() override;
123  void ImportEnd() override;
124  void ImportActors(vtkRenderer*) override {}
125  void ImportCameras(vtkRenderer*) override {}
126  void ImportLights(vtkRenderer*) override {}
127  void ImportProperties(vtkRenderer*) override {}
128 
130 
133  virtual void enterNode(const char*);
134  virtual void exitNode();
135  virtual void enterField(const char*);
136  virtual void exitField();
137  virtual void useNode(const char*);
139 
143  FILE* GetFileFD() { return this->FileFD; }
144 
145  char* FileName;
146  FILE* FileFD;
148 
149  friend class vtkVRMLYaccData;
150 
151 private:
152  vtkPoints* PointsNew();
153  vtkFloatArray* FloatArrayNew();
154  vtkIdTypeArray* IdTypeArrayNew();
155 
156  void DeleteObject(vtkObject*);
157 
158  vtkVRMLImporterInternal* Internal;
159  vtkVRMLYaccData* Parser;
160  vtkActor* CurrentActor;
161  vtkProperty* CurrentProperty;
162  vtkLight* CurrentLight;
163  vtkTransform* CurrentTransform;
164  vtkAlgorithm* CurrentSource;
165  vtkPoints* CurrentPoints;
166  vtkFloatArray* CurrentNormals;
167  vtkCellArray* CurrentNormalCells;
168  vtkFloatArray* CurrentTCoords;
169  vtkCellArray* CurrentTCoordCells;
170  vtkLookupTable* CurrentLut;
171  vtkFloatArray* CurrentScalars;
172  vtkPolyDataMapper* CurrentMapper;
173 
174 private:
175  vtkVRMLImporter(const vtkVRMLImporter&) = delete;
176  void operator=(const vtkVRMLImporter&) = delete;
177 };
178 
179 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
void ImportActors(vtkRenderer *) override
abstract base class for most VTK objects
Definition: vtkObject.h:62
represent surface properties of a geometric object
Definition: vtkProperty.h:67
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:41
map scalar values into colors via a lookup table
void ImportLights(vtkRenderer *) override
abstract specification for renderers
Definition: vtkRenderer.h:72
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:59
virtual void ImportEnd()
Definition: vtkImporter.h:159
virtual int ImportBegin()
Definition: vtkImporter.h:158
void ImportProperties(vtkRenderer *) override
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:62
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual light for 3D rendering
Definition: vtkLight.h:59
virtual std::string GetOutputsDescription()
Recover a printable string that let importer implementation Describe their outputs.
Definition: vtkImporter.h:98
void ImportCameras(vtkRenderer *) override
map vtkPolyData to graphics primitives
object to represent cell connectivity
Definition: vtkCellArray.h:186
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:39