contrib/brl/bseg/segv/segv_vtol2D_tableau.h
Go to the documentation of this file.
00001 // This is brl/bseg/segv/segv_vtol2D_tableau.h
00002 #ifndef segv_vtol2D_tableau_h_
00003 #define segv_vtol2D_tableau_h_
00004 //--------------------------------------------------------------------------------
00005 //:
00006 // \file
00007 // \brief A child tableau of vgui_easy2D_tableau that knows how to display vtol objects.
00008 // \author
00009 //   J.L. Mundy
00010 //
00011 // \verbatim
00012 //  Modifications:
00013 //   J.L. Mundy November 28, 2002    Initial version.
00014 // \endverbatim
00015 //--------------------------------------------------------------------------------
00016 #include <vcl_vector.h>
00017 #include <vtol/vtol_vertex_2d.h>
00018 #include <vtol/vtol_edge_2d.h>
00019 #include <vtol/vtol_vertex_2d_sptr.h>
00020 #include <vtol/vtol_edge_2d_sptr.h>
00021 #include <vtol/vtol_face_2d_sptr.h>
00022 #include <vgui/vgui_tableau_sptr.h>
00023 #include <vgui/vgui_image_tableau_sptr.h>
00024 #include <vgui/vgui_easy2D_tableau.h>
00025 
00026 #include "segv_vtol2D_tableau_sptr.h"
00027 
00028 class segv_vtol_soview2D_vertex;
00029 class segv_vtol_soview2D_edge;
00030 class segv_vtol_soview2D_edge_group;
00031 class segv_vtol_soview2D_face;
00032 
00033 class segv_vtol2D_tableau : public vgui_easy2D_tableau
00034 {
00035  public:
00036   segv_vtol2D_tableau(const char* n="unnamed");
00037 
00038   segv_vtol2D_tableau(vgui_image_tableau_sptr const& it,
00039                       const char* n="unnamed");
00040 
00041   segv_vtol2D_tableau(vgui_tableau_sptr const& t,
00042                       const char* n="unnamed");
00043 
00044   ~segv_vtol2D_tableau(){}
00045 
00046   //: the vtol display methods
00047   segv_vtol_soview2D_vertex* add_vertex(vtol_vertex_2d_sptr& v);
00048   segv_vtol_soview2D_edge* add_edge(vtol_edge_2d_sptr& e);
00049 
00050   segv_vtol_soview2D_edge_group* add_edge_group(vcl_vector<vtol_edge_2d_sptr>&
00051                                                 edges);
00052   segv_vtol_soview2D_face* add_face(vtol_face_2d_sptr& f);
00053 };
00054 
00055 //this stuff is needed to establish inheritance between tableau  smart pointers
00056 //cloned from xcv_image_tableau
00057 struct segv_vtol2D_tableau_new : public segv_vtol2D_tableau_sptr
00058 {
00059   typedef segv_vtol2D_tableau_sptr base;
00060 
00061   segv_vtol2D_tableau_new(const char* n="unnamed") :
00062     base(new segv_vtol2D_tableau(n)) { }
00063   segv_vtol2D_tableau_new(vgui_image_tableau_sptr const& it,
00064                           const char* n="unnamed") :
00065     base(new segv_vtol2D_tableau(it,n)) { }
00066 
00067   segv_vtol2D_tableau_new(vgui_tableau_sptr const& t, const char* n="unnamed")
00068     :  base(new segv_vtol2D_tableau(t, n)) { }
00069 
00070   operator vgui_easy2D_tableau_sptr () const { vgui_easy2D_tableau_sptr tt; tt.vertical_cast(*this); return tt; }
00071 };
00072 
00073 #endif // segv_vtol2D_tableau_h_