Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Hybrid/vtkVRMLImporter.h

Go to the documentation of this file.
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 =========================================================================*/
00050 #ifndef __vtkVRMLImporter_h
00051 #define __vtkVRMLImporter_h
00052 
00053 // Includes for the yacc/lex parser
00054 #include "vtkImporter.h"
00055 
00056 class vtkActor;
00057 class vtkProperty;
00058 class vtkCamera;
00059 class vtkLight;
00060 class vtkTransform;
00061 class vtkSource;
00062 class vtkLookupTable;
00063 class vtkFloatArray;
00064 class vtkPolyDataMapper;
00065 class vtkPoints;
00066 class vtkIdTypeArray;
00067 class vtkVRMLImporterInternal;
00068 class vtkCellArray;
00069 
00070 class VTK_HYBRID_EXPORT vtkVRMLImporter : public vtkImporter
00071 {
00072 public:
00073   static vtkVRMLImporter *New();
00074 
00075   vtkTypeRevisionMacro(vtkVRMLImporter,vtkImporter);
00076   void PrintSelf(ostream& os, vtkIndent indent);
00077 
00083   vtkObject *GetVRMLDEFObject(const char *name);
00084 
00086 
00087   void enterNode(const char *);
00088   void exitNode();
00089   void enterField(const char *);
00090   void exitField();
00091   void useNode(const char *);
00093 
00095 
00096   vtkSetStringMacro(FileName);
00097   vtkGetStringMacro(FileName);
00099 
00101   FILE *GetFileFD() {return this->FileFD;};
00102 
00103 //BTX
00104 
00105   friend int yylex ( vtkVRMLImporter* );
00106 
00107 //ETX
00108 
00109 protected:
00110   vtkVRMLImporter();
00111   ~vtkVRMLImporter();
00112 
00113   virtual int ImportBegin ();
00114   virtual void ImportEnd ();
00115   virtual void ImportActors (vtkRenderer *) {};
00116   virtual void ImportCameras (vtkRenderer *) {};
00117   virtual void ImportLights (vtkRenderer *) {};
00118   virtual void ImportProperties (vtkRenderer *) {};
00119 
00120   int OpenImportFile();
00121   char *FileName;
00122   FILE *FileFD;
00123 
00124 private:
00125   vtkActor             *CurrentActor;
00126   vtkProperty          *CurrentProperty;
00127   vtkCamera            *CurrentCamera;
00128   vtkLight             *CurrentLight;
00129   vtkTransform         *CurrentTransform;
00130   vtkSource            *CurrentSource;
00131   vtkPoints            *CurrentPoints;
00132   vtkFloatArray        *CurrentNormals;
00133   vtkFloatArray        *CurrentTCoords;
00134   vtkCellArray         *CurrentTCoordCells;
00135   vtkLookupTable       *CurrentLut;
00136   vtkFloatArray        *CurrentScalars;
00137   vtkPolyDataMapper    *CurrentMapper;
00138 
00139   vtkPoints* PointsNew();
00140   vtkFloatArray* FloatArrayNew();
00141   vtkIdTypeArray* IdTypeArrayNew();
00142 
00143   void DeleteObject(vtkObject*);
00144 
00145   vtkVRMLImporterInternal* Internal;
00146 
00147 private:
00148   vtkVRMLImporter(const vtkVRMLImporter&);  // Not implemented.
00149   void operator=(const vtkVRMLImporter&);  // Not implemented.
00150 };
00151 
00152 #endif
00153