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=========================================================================*/
54#ifndef vtkVRMLImporter_h
55#define vtkVRMLImporter_h
56
57#include "vtkIOImportModule.h" // For export macro
58#include "vtkImporter.h"
59
60class vtkActor;
61class vtkAlgorithm;
62class vtkProperty;
63class vtkLight;
64class vtkTransform;
65class vtkLookupTable;
66class vtkFloatArray;
68class vtkPoints;
69class vtkIdTypeArray;
70class vtkVRMLImporterInternal;
71class vtkVRMLYaccData;
72class vtkCellArray;
73
74class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
75{
76public:
78
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
83
89
91
95 vtkSetMacro(ShapeResolution, int);
96 vtkGetMacro(ShapeResolution, int);
98
107 vtkObject* GetVRMLDEFObject(const char* name);
108
112 std::string GetOutputsDescription() override;
113
114protected:
117
119 int ImportBegin() override;
120 void ImportEnd() override;
121 void ImportActors(vtkRenderer*) override {}
122 void ImportCameras(vtkRenderer*) override {}
123 void ImportLights(vtkRenderer*) override {}
124 void ImportProperties(vtkRenderer*) override {}
125
127
130 virtual void enterNode(const char*);
131 virtual void exitNode();
132 virtual void enterField(const char*);
133 virtual void exitField();
134 virtual void useNode(const char*);
136
140 FILE* GetFileFD() { return this->FileFD; }
141
142 char* FileName;
143 FILE* FileFD;
145
146 friend class vtkVRMLYaccData;
147
148private:
149 vtkPoints* PointsNew();
150 vtkFloatArray* FloatArrayNew();
151 vtkIdTypeArray* IdTypeArrayNew();
152
153 void DeleteObject(vtkObject*);
154
155 vtkVRMLImporterInternal* Internal;
156 vtkVRMLYaccData* Parser;
157 vtkActor* CurrentActor;
158 vtkProperty* CurrentProperty;
159 vtkLight* CurrentLight;
160 vtkTransform* CurrentTransform;
161 vtkAlgorithm* CurrentSource;
162 vtkPoints* CurrentPoints;
163 vtkFloatArray* CurrentNormals;
164 vtkCellArray* CurrentNormalCells;
165 vtkFloatArray* CurrentTCoords;
166 vtkCellArray* CurrentTCoordCells;
167 vtkLookupTable* CurrentLut;
168 vtkFloatArray* CurrentScalars;
169 vtkPolyDataMapper* CurrentMapper;
170
171private:
172 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
173 void operator=(const vtkVRMLImporter&) = delete;
174};
175
176#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
Superclass for all sources, filters, and sinks in VTK.
object to represent cell connectivity
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:34
a virtual light for 3D rendering
Definition vtkLight.h:57
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition vtkObject.h:57
represent and manipulate 3D points
Definition vtkPoints.h:34
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition vtkProperty.h:62
abstract specification for renderers
Definition vtkRenderer.h:67
describes linear transformations via a 4x4 matrix
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.