core/vgui/vrml/vgui_vrml_draw_visitor.h
Go to the documentation of this file.
00001 // This is core/vgui/vrml/vgui_vrml_draw_visitor.h
00002 #ifndef vgui_vrml_draw_visitor_h_
00003 #define vgui_vrml_draw_visitor_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //
00008 // .NAME vgui_vrml_draw_visitor
00009 // .LIBRARY vgui-vrml
00010 // .HEADER vxl Package
00011 // .INCLUDE vgui/vrml/vgui_vrml_draw_visitor.h
00012 // .FILE vgui_vrml_draw_visitor.cxx
00013 //
00014 // .SECTION Author
00015 //              Philip C. Pritchett, 15 Oct 99
00016 //              Robotics Research Group, University of Oxford
00017 //
00018 // .SECTION Modifications
00019 //   990109 AWF Initial version.
00020 //
00021 //-----------------------------------------------------------------------------
00022 
00023 #include <Qv/QvVisitor.h>
00024 
00025 //these may be typedefs in the glu header (linux),
00026 //so they can't be forward declared like this.
00027 //cf vcl_istream, vcl_ostream
00028 //class GLUquadricObj;
00029 #include <vgui/vgui_gl.h>
00030 #include <vgui/vgui_glu.h>
00031 
00032 class vgui_vrml_draw_visitor : public QvVisitor
00033 {
00034  public:
00035 
00036   // Constructors/Destructors--------------------------------------------------
00037 
00038   vgui_vrml_draw_visitor();
00039  ~vgui_vrml_draw_visitor();
00040 
00041   bool Visit(QvSeparator* node);
00042   bool Visit(QvTransformSeparator* node);
00043   bool Visit(QvCube* node);
00044   bool Visit(QvSphere* node);
00045   bool Visit(QvCylinder* node);
00046   bool Visit(QvCone* node);
00047   bool Visit(QvPointSet* ps);
00048   bool Visit(QvIndexedLineSet* node);
00049   bool Visit(QvIndexedFaceSet* node);
00050   bool Visit(QvAsciiText* node);
00051   bool Visit(QvTransform* node);
00052   bool Visit(QvScale* node);
00053   bool Visit(QvRotation* node);
00054   bool Visit(QvTranslation* node);
00055   bool Visit(QvMaterial* node);
00056   bool Visit(QvTexture2* node);
00057   bool Visit(QvShapeHints* node);
00058 
00059   // Dummy implementations of parent's virtual functions:
00060   bool Visit(QvNode *node)      { return QvVisitor::Visit(node); }
00061   bool Visit(QvGroup *node)     { return QvVisitor::Visit(node); }
00062   bool Visit(QvSwitch *node)    { return QvVisitor::Visit(node); }
00063   bool Visit(QvWWWInline *node) { return QvVisitor::Visit(node); }
00064   bool Visit(QvCoordinate3 *) { return false; }
00065   bool Visit(QvDirectionalLight *) { return false; }
00066   bool Visit(QvFontStyle *) { return false; }
00067   bool Visit(QvInfo *) { return false; }
00068   bool Visit(QvLOD *) { return false; }
00069   bool Visit(QvMaterialBinding *) { return false; }
00070   bool Visit(QvMatrixTransform *) { return false; }
00071   bool Visit(QvNormal *) { return false; }
00072   bool Visit(QvNormalBinding *) { return false; }
00073   bool Visit(QvOrthographicCamera *) { return false; }
00074   bool Visit(QvPerspectiveCamera *) { return false; }
00075   bool Visit(QvPointLight *) { return false; }
00076   bool Visit(QvSpotLight *) { return false; }
00077   bool Visit(QvTexture2Transform *) { return false; }
00078   bool Visit(QvTextureCoordinate2 *) { return false; }
00079   bool Visit(QvWWWAnchor *) { return false; }
00080   bool Visit(QvUnknownNode *) { return false; }
00081   bool Visit(QvLabel *) { return false; }
00082   bool Visit(QvLightModel *) { return false; }
00083 
00084   enum mode_type {wireframe, textured, shaded};
00085 
00086   mode_type get_gl_mode() {
00087     return gl_mode;
00088   }
00089 
00090   void set_gl_mode(mode_type gl_new) {
00091     if (gl_new == textured) remake_texture = true;
00092     gl_mode = gl_new;
00093   }
00094 
00095  protected:
00096   GLUquadricObj *quadric;
00097   mode_type gl_mode;
00098   bool twosided;
00099   bool remake_texture;
00100 };
00101 
00102 #endif // vgui_vrml_draw_visitor_h_