VTK  9.0.20210409
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) override;
81 
83 
86  vtkSetStringMacro(FileName);
87  vtkGetStringMacro(FileName);
89 
91 
95  vtkSetMacro(ShapeResolution, int);
96  vtkGetMacro(ShapeResolution, int);
98 
108 
113 
114 protected:
116  ~vtkVRMLImporter() override;
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 
148 private:
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 
171 private:
172  vtkVRMLImporter(const vtkVRMLImporter&) = delete;
173  void operator=(const vtkVRMLImporter&) = delete;
174 };
175 
176 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:37
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
vtkVRMLImporter::vtkVRMLImporter
vtkVRMLImporter()
vtkVRMLImporter::GetFileFD
FILE * GetFileFD()
Return the file pointer to the open file.
Definition: vtkVRMLImporter.h:140
vtkImporter
importer abstract class
Definition: vtkImporter.h:60
vtkLight
a virtual light for 3D rendering
Definition: vtkLight.h:57
vtkImporter.h
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:64
vtkVRMLImporter::FileFD
FILE * FileFD
Definition: vtkVRMLImporter.h:143
vtkVRMLImporter::enterNode
virtual void enterNode(const char *)
Needed by the yacc/lex grammar used.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:63
vtkVRMLImporter::enterField
virtual void enterField(const char *)
vtkVRMLImporter::ImportEnd
void ImportEnd() override
vtkVRMLImporter::ShapeResolution
int ShapeResolution
Definition: vtkVRMLImporter.h:144
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
vtkVRMLImporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVRMLImporter::OpenImportFile
int OpenImportFile()
vtkVRMLImporter::ImportCameras
void ImportCameras(vtkRenderer *) override
Definition: vtkVRMLImporter.h:122
vtkVRMLImporter::ImportLights
void ImportLights(vtkRenderer *) override
Definition: vtkVRMLImporter.h:123
vtkVRMLImporter::ImportProperties
void ImportProperties(vtkRenderer *) override
Definition: vtkVRMLImporter.h:124
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:181
vtkVRMLImporter::exitNode
virtual void exitNode()
vtkVRMLImporter::exitField
virtual void exitField()
vtkVRMLImporter::GetOutputsDescription
std::string GetOutputsDescription() override
Get a printable string describing the outputs.
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkVRMLImporter::FileName
char * FileName
Definition: vtkVRMLImporter.h:142
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:69
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkVRMLImporter::useNode
virtual void useNode(const char *)
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:36
vtkVRMLImporter::New
static vtkVRMLImporter * New()
vtkVRMLImporter::ImportBegin
int ImportBegin() override
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkVRMLImporter::GetVRMLDEFObject
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...
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:62
vtkVRMLImporter
imports VRML 2.0 files.
Definition: vtkVRMLImporter.h:75
vtkVRMLImporter::ImportActors
void ImportActors(vtkRenderer *) override
Definition: vtkVRMLImporter.h:121
vtkVRMLImporter::~vtkVRMLImporter
~vtkVRMLImporter() override
vtkVRMLYaccData
Definition: vtkVRMLImporter_Yacc.h:119