00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkVRMLImporter.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00062 #ifndef __vtkVRMLImporter_h 00063 #define __vtkVRMLImporter_h 00064 00065 // Includes for the yacc/lex parser 00066 #include "vtkImporter.h" 00067 00068 class vtkActor; 00069 class vtkProperty; 00070 class vtkCamera; 00071 class vtkLight; 00072 class vtkTransform; 00073 class vtkSource; 00074 class vtkLookupTable; 00075 class vtkFloatArray; 00076 class vtkPolyDataMapper; 00077 class vtkPoints; 00078 class vtkIdTypeArray; 00079 class vtkVRMLImporterInternal; 00080 class vtkCellArray; 00081 00082 class VTK_HYBRID_EXPORT vtkVRMLImporter : public vtkImporter 00083 { 00084 public: 00085 static vtkVRMLImporter *New(); 00086 00087 vtkTypeRevisionMacro(vtkVRMLImporter,vtkImporter); 00088 void PrintSelf(ostream& os, vtkIndent indent); 00089 00095 vtkObject *GetVRMLDEFObject(const char *name); 00096 00098 00099 void enterNode(const char *); 00100 void exitNode(); 00101 void enterField(const char *); 00102 void exitField(); 00103 void useNode(const char *); 00105 00107 00108 vtkSetStringMacro(FileName); 00109 vtkGetStringMacro(FileName); 00111 00113 FILE *GetFileFD() {return this->FileFD;}; 00114 00115 //BTX 00116 00117 friend int yylex ( vtkVRMLImporter* ); 00118 00119 //ETX 00120 00121 protected: 00122 vtkVRMLImporter(); 00123 ~vtkVRMLImporter(); 00124 00125 virtual int ImportBegin (); 00126 virtual void ImportEnd (); 00127 virtual void ImportActors (vtkRenderer *) {}; 00128 virtual void ImportCameras (vtkRenderer *) {}; 00129 virtual void ImportLights (vtkRenderer *) {}; 00130 virtual void ImportProperties (vtkRenderer *) {}; 00131 00132 int OpenImportFile(); 00133 char *FileName; 00134 FILE *FileFD; 00135 00136 private: 00137 vtkActor *CurrentActor; 00138 vtkProperty *CurrentProperty; 00139 vtkCamera *CurrentCamera; 00140 vtkLight *CurrentLight; 00141 vtkTransform *CurrentTransform; 00142 vtkSource *CurrentSource; 00143 vtkPoints *CurrentPoints; 00144 vtkFloatArray *CurrentNormals; 00145 vtkFloatArray *CurrentTCoords; 00146 vtkCellArray *CurrentTCoordCells; 00147 vtkLookupTable *CurrentLut; 00148 vtkFloatArray *CurrentScalars; 00149 vtkPolyDataMapper *CurrentMapper; 00150 00151 vtkPoints* PointsNew(); 00152 vtkFloatArray* FloatArrayNew(); 00153 vtkIdTypeArray* IdTypeArrayNew(); 00154 00155 void DeleteObject(vtkObject*); 00156 00157 vtkVRMLImporterInternal* Internal; 00158 00159 private: 00160 vtkVRMLImporter(const vtkVRMLImporter&); // Not implemented. 00161 void operator=(const vtkVRMLImporter&); // Not implemented. 00162 }; 00163 00164 #endif 00165