core/vgui/vgui_easy3D_tableau.h
Go to the documentation of this file.
00001 // This is core/vgui/vgui_easy3D_tableau.h
00002 #ifndef vgui_easy3D_tableau_h_
00003 #define vgui_easy3D_tableau_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief  Tableau to display three-dimensional geometric objects.
00010 // \author Philip C. Pritchett, Robotics Research Group, University of Oxford
00011 // \date   24 Sep 99
00012 //
00013 //  Contains classes vgui_easy3D_tableau  vgui_easy3D_tableau_new
00014 //
00015 // \verbatim
00016 //  Modifications
00017 //   24-SEP-1999 P.Pritchett - Initial version.
00018 //   26-APR-2002 K.Y.McGaul - Added some doxygen-style documentation.
00019 //   01-OCT-2002 K.Y.McGaul - Moved vgui_easy3D to vgui_easy3D_tableau.
00020 // \endverbatim
00021 
00022 #include "vgui_easy3D_tableau_sptr.h"
00023 #include "vgui_displaylist3D_tableau.h"
00024 #include "vgui_style_sptr.h"
00025 class vgui_point3D;
00026 class vgui_lineseg3D;
00027 class vgui_triangle3D;
00028 
00029 //: Tableau to display three-dimensional geometric objects.
00030 //
00031 //  Three-dimensional objects (see vgui_soview3D) can be added using add, or add_point, add_line.
00032 class vgui_easy3D_tableau : public vgui_displaylist3D_tableau
00033 {
00034  public:
00035   //: Constructor - don't use this, use vgui_easy3D_tableau_new.
00036   vgui_easy3D_tableau();
00037 
00038   //: Returns the tableau name.
00039   vcl_string type_name() const { return "vgui_easy3D_tableau"; }
00040 
00041   //: Add the given vgui_soview3D to the display.
00042   void add(vgui_soview3D*);
00043 
00044   //: Add a 3D-point at the given location.
00045   vgui_point3D* add_point(float x, float y, float z);
00046 
00047   //: Add a 3D-line with the given start and end points.
00048   vgui_lineseg3D* add_line(float x0, float y0, float z0,
00049                            float x1, float y1, float z1);
00050 
00051   //: Add a 3D-triangle with the given vertices.
00052   vgui_triangle3D* add_triangle(float x0, float y0, float z0,
00053                                 float x1, float y1, float z1,
00054                                 float x2, float y2, float z2);
00055 
00056   //: Set the colour of objects to the given RGB value.
00057   void set_foreground(float red, float green, float blue);
00058 
00059   //: Set the line width of all objects to the given width.
00060   void set_line_width(float new_width);
00061 
00062   //: Set the radius of all points to the given radius.
00063   void set_point_radius(float new_radius);
00064 
00065   void save_e3d(char const* filename);
00066   void load_e3d(char const* filename);
00067 
00068 
00069  protected:
00070   //: Destructor - called by vgui_easy3D_tableau_sptr.
00071   ~vgui_easy3D_tableau() { }
00072 
00073   vgui_style_sptr style_;
00074 };
00075 
00076 //: Create a smart-pointer to a vgui_easy3D_tableau tableau.
00077 struct vgui_easy3D_tableau_new : public vgui_easy3D_tableau_sptr
00078 {
00079   typedef vgui_easy3D_tableau_sptr base;
00080 
00081   //: Constructor - create an empty vgui_easy3D_tableau.
00082   vgui_easy3D_tableau_new() : base(new vgui_easy3D_tableau()) { }
00083 };
00084 
00085 #endif // vgui_easy3D_tableau_h_