VTK  9.5.2
vtkVRMLImporter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
48
49#ifndef vtkVRMLImporter_h
50#define vtkVRMLImporter_h
51
52#include "vtkIOImportModule.h" // For export macro
53#include "vtkImporter.h"
54
55VTK_ABI_NAMESPACE_BEGIN
56class vtkActor;
57class vtkAlgorithm;
58class vtkProperty;
59class vtkLight;
60class vtkTransform;
61class vtkLookupTable;
62class vtkFloatArray;
64class vtkPoints;
65class vtkIdTypeArray;
66class vtkVRMLImporterInternal;
67class vtkVRMLYaccData;
68class vtkCellArray;
69
70class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
71{
72public:
74
76 void PrintSelf(ostream& os, vtkIndent indent) override;
77
79
85
87
91 vtkSetMacro(ShapeResolution, int);
92 vtkGetMacro(ShapeResolution, int);
94
103 vtkObject* GetVRMLDEFObject(const char* name);
104
108 std::string GetOutputsDescription() override;
109
110protected:
113
115 int ImportBegin() override;
116 void ImportEnd() override;
117 void ImportActors(vtkRenderer*) override {}
118 void ImportCameras(vtkRenderer*) override {}
119 void ImportLights(vtkRenderer*) override {}
120 void ImportProperties(vtkRenderer*) override {}
121
123
126 virtual void enterNode(const char*);
127 virtual void exitNode();
128 virtual void enterField(const char*);
129 virtual void exitField();
130 virtual void useNode(const char*);
132
136 FILE* GetFileFD() { return this->FileFD; }
137
138 char* FileName;
139 FILE* FileFD;
141
142 friend class vtkVRMLYaccData;
143
144private:
145 vtkPoints* PointsNew();
146 vtkFloatArray* FloatArrayNew();
147 vtkIdTypeArray* IdTypeArrayNew();
148
149 void DeleteObject(vtkObject*);
150
151 vtkVRMLImporterInternal* Internal;
152 vtkVRMLYaccData* Parser;
153 vtkActor* CurrentActor;
154 vtkProperty* CurrentProperty;
155 vtkLight* CurrentLight;
156 vtkTransform* CurrentTransform;
157 vtkAlgorithm* CurrentSource;
158 vtkPoints* CurrentPoints;
159 vtkFloatArray* CurrentNormals;
160 vtkCellArray* CurrentNormalCells;
161 vtkFloatArray* CurrentTCoords;
162 vtkCellArray* CurrentTCoordCells;
163 vtkLookupTable* CurrentLut;
164 vtkFloatArray* CurrentScalars;
165 vtkPolyDataMapper* CurrentMapper;
166
167 vtkVRMLImporter(const vtkVRMLImporter&) = delete;
168 void operator=(const vtkVRMLImporter&) = delete;
169};
170
171VTK_ABI_NAMESPACE_END
172#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
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
a simple class to control print indentation
Definition vtkIndent.h:29
a virtual light for 3D rendering
Definition vtkLight.h:50
map scalar values into colors via a lookup table
represent and manipulate 3D points
Definition vtkPoints.h:30
map vtkPolyData to graphics primitives
represent surface properties of a geometric object
Definition vtkProperty.h:61
abstract specification for renderers
Definition vtkRenderer.h:60
describes linear transformations via a 4x4 matrix
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.
friend class vtkVRMLYaccData
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.