VTK  9.1.0
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=========================================================================*/
133#ifndef vtkVRMLImporter_h
134#define vtkVRMLImporter_h
135
136#include "vtkIOImportModule.h" // For export macro
137#include "vtkImporter.h"
138
139class vtkActor;
140class vtkAlgorithm;
141class vtkProperty;
142class vtkLight;
143class vtkTransform;
144class vtkLookupTable;
145class vtkFloatArray;
147class vtkPoints;
148class vtkIdTypeArray;
149class vtkVRMLImporterInternal;
150class vtkVRMLYaccData;
151class vtkCellArray;
152
153class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
154{
155public:
157
159 void PrintSelf(ostream& os, vtkIndent indent) override;
160
162
168
170
174 vtkSetMacro(ShapeResolution, int);
175 vtkGetMacro(ShapeResolution, int);
177
187
192
193protected:
196
198 int ImportBegin() override;
199 void ImportEnd() override;
200 void ImportActors(vtkRenderer*) override {}
201 void ImportCameras(vtkRenderer*) override {}
202 void ImportLights(vtkRenderer*) override {}
203 void ImportProperties(vtkRenderer*) override {}
204
206
209 virtual void enterNode(const char*);
210 virtual void exitNode();
211 virtual void enterField(const char*);
212 virtual void exitField();
213 virtual void useNode(const char*);
215
219 FILE* GetFileFD() { return this->FileFD; }
220
221 char* FileName;
222 FILE* FileFD;
224
225 friend class vtkVRMLYaccData;
226
227private:
228 vtkPoints* PointsNew();
229 vtkFloatArray* FloatArrayNew();
230 vtkIdTypeArray* IdTypeArrayNew();
231
232 void DeleteObject(vtkObject*);
233
234 vtkVRMLImporterInternal* Internal;
235 vtkVRMLYaccData* Parser;
236 vtkActor* CurrentActor;
237 vtkProperty* CurrentProperty;
238 vtkLight* CurrentLight;
239 vtkTransform* CurrentTransform;
240 vtkAlgorithm* CurrentSource;
241 vtkPoints* CurrentPoints;
242 vtkFloatArray* CurrentNormals;
243 vtkCellArray* CurrentNormalCells;
244 vtkFloatArray* CurrentTCoords;
245 vtkCellArray* CurrentTCoordCells;
246 vtkLookupTable* CurrentLut;
247 vtkFloatArray* CurrentScalars;
248 vtkPolyDataMapper* CurrentMapper;
249
250private:
251 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
252 void operator=(const vtkVRMLImporter&) = delete;
253};
254
255#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:114
object to represent cell connectivity
Definition: vtkCellArray.h:290
dynamic, self-adjusting array of float
dynamic, self-adjusting array of vtkIdType
importer abstract class
Definition: vtkImporter.h:60
a simple class to control print indentation
Definition: vtkIndent.h:113
a virtual light for 3D rendering
Definition: vtkLight.h:166
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition: vtkObject.h:73
represent and manipulate 3D points
Definition: vtkPoints.h:143
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition: vtkProperty.h:171
abstract specification for renderers
Definition: vtkRenderer.h:173
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:164
imports VRML 2.0 files.
void ImportLights(vtkRenderer *) override
void ImportCameras(vtkRenderer *) override
void ImportActors(vtkRenderer *) override
virtual void useNode(const char *)
Needed by the yacc/lex grammar used.
virtual void exitNode()
Needed by the yacc/lex grammar used.
~vtkVRMLImporter() override
vtkSetFilePathMacro(FileName)
Specify the name of the file to read.
std::string GetOutputsDescription() override
Get a printable string describing the outputs.
vtkObject * GetVRMLDEFObject(const char *name)
In the VRML spec you can DEF and USE nodes (name them), This routine will return the associated VTK o...
void ImportEnd() override
virtual void enterField(const char *)
Needed by the yacc/lex grammar used.
FILE * GetFileFD()
Return the file pointer to the open file.
void ImportProperties(vtkRenderer *) override
vtkGetFilePathMacro(FileName)
Specify the name of the file to read.
virtual void enterNode(const char *)
Needed by the yacc/lex grammar used.
int ImportBegin() override
static vtkVRMLImporter * New()
virtual void exitField()
Needed by the yacc/lex grammar used.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
@ name
Definition: vtkX3D.h:225
@ string
Definition: vtkX3D.h:496