VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/Import/vtkVRMLImporter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkVRMLImporter.h
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 =========================================================================*/
00056 #ifndef vtkVRMLImporter_h
00057 #define vtkVRMLImporter_h
00058 
00059 #include "vtkIOImportModule.h" // For export macro
00060 #include "vtkImporter.h"
00061 
00062 class vtkActor;
00063 class vtkAlgorithm;
00064 class vtkProperty;
00065 class vtkLight;
00066 class vtkTransform;
00067 class vtkLookupTable;
00068 class vtkFloatArray;
00069 class vtkPolyDataMapper;
00070 class vtkPoints;
00071 class vtkIdTypeArray;
00072 class vtkVRMLImporterInternal;
00073 class vtkVRMLYaccData;
00074 class vtkCellArray;
00075 
00076 class VTKIOIMPORT_EXPORT vtkVRMLImporter : public vtkImporter
00077 {
00078 public:
00079   static vtkVRMLImporter *New();
00080 
00081   vtkTypeMacro(vtkVRMLImporter, vtkImporter);
00082   void PrintSelf(ostream& os, vtkIndent indent);
00083 
00085 
00086   vtkSetStringMacro(FileName);
00087   vtkGetStringMacro(FileName);
00089 
00091 
00093   vtkSetMacro(ShapeResolution, int);
00094   vtkGetMacro(ShapeResolution, int);
00096 
00102   vtkObject* GetVRMLDEFObject(const char *name);
00103 
00104 protected:
00105   vtkVRMLImporter();
00106   ~vtkVRMLImporter();
00107 
00108   int OpenImportFile();
00109   virtual int ImportBegin();
00110   virtual void ImportEnd();
00111   virtual void ImportActors(vtkRenderer*) {}
00112   virtual void ImportCameras(vtkRenderer*) {}
00113   virtual void ImportLights(vtkRenderer*) {}
00114   virtual void ImportProperties(vtkRenderer*) {}
00115 
00117 
00118   virtual void enterNode(const char*);
00119   virtual void exitNode();
00120   virtual void enterField(const char*);
00121   virtual void exitField();
00122   virtual void useNode(const char*);
00124 
00126   FILE *GetFileFD() { return this->FileFD; }
00127 
00128   char *FileName;
00129   FILE *FileFD;
00130   int ShapeResolution;
00131 
00132   friend class vtkVRMLYaccData;
00133 
00134 private:
00135   vtkPoints* PointsNew();
00136   vtkFloatArray* FloatArrayNew();
00137   vtkIdTypeArray* IdTypeArrayNew();
00138 
00139   void DeleteObject(vtkObject*);
00140 
00141   vtkVRMLImporterInternal* Internal;
00142   vtkVRMLYaccData* Parser;
00143   vtkActor* CurrentActor;
00144   vtkProperty* CurrentProperty;
00145   vtkLight* CurrentLight;
00146   vtkTransform* CurrentTransform;
00147   vtkAlgorithm* CurrentSource;
00148   vtkPoints* CurrentPoints;
00149   vtkFloatArray* CurrentNormals;
00150   vtkCellArray* CurrentNormalCells;
00151   vtkFloatArray* CurrentTCoords;
00152   vtkCellArray* CurrentTCoordCells;
00153   vtkLookupTable* CurrentLut;
00154   vtkFloatArray* CurrentScalars;
00155   vtkPolyDataMapper* CurrentMapper;
00156 
00157 private:
00158   vtkVRMLImporter(const vtkVRMLImporter&);  // Not implemented.
00159   void operator=(const vtkVRMLImporter&);  // Not implemented.
00160 };
00161 
00162 #endif