Go to the documentation of this file.00001
00002 #ifndef bgui_vtol2D_tableau_h_
00003 #define bgui_vtol2D_tableau_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <vcl_vector.h>
00031 #include <vcl_map.h>
00032 #include <vcl_string.h>
00033 #include <vgui/vgui_style_sptr.h>
00034 #include <vtol/vtol_vertex_2d_sptr.h>
00035 #include <vtol/vtol_edge_2d_sptr.h>
00036 #include <vtol/vtol_face_2d_sptr.h>
00037 #include <vtol/vtol_topology_object_sptr.h>
00038 #include <vgui/vgui_tableau_sptr.h>
00039 #include <vgui/vgui_image_tableau_sptr.h>
00040 #include <bgui/bgui_vsol2D_tableau.h>
00041 #include <bgui/bgui_vsol2D_tableau_sptr.h>
00042
00043 #include "bgui_vtol2D_tableau_sptr.h"
00044
00045 class bgui_vtol_soview2D_vertex;
00046 class bgui_vtol_soview2D_edge;
00047 class bgui_vtol_soview2D_edge_group;
00048 class bgui_vtol_soview2D_face;
00049
00050 class bgui_vtol2D_tableau : public bgui_vsol2D_tableau
00051 {
00052 public:
00053 bgui_vtol2D_tableau(const char* n="unnamed");
00054
00055 bgui_vtol2D_tableau(vgui_image_tableau_sptr const& it,
00056 const char* n="unnamed");
00057
00058 bgui_vtol2D_tableau(vgui_tableau_sptr const& t,
00059 const char* n="unnamed");
00060
00061 ~bgui_vtol2D_tableau();
00062
00063 virtual vcl_string type_name() const { return "bgui_vtol2D_tableau"; }
00064
00065
00066 virtual bool handle(vgui_event const &);
00067
00068
00069 bgui_vtol_soview2D_vertex* add_vertex(vtol_vertex_2d_sptr const& v,
00070 const vgui_style_sptr& style = NULL);
00071
00072 bgui_vtol_soview2D_edge* add_edge(vtol_edge_2d_sptr const& e,
00073 const vgui_style_sptr& style = NULL);
00074
00075 bgui_vtol_soview2D_edge_group* add_edge_group(vcl_vector<vtol_edge_2d_sptr>& edges,
00076 const vgui_style_sptr& style = NULL);
00077
00078 bgui_vtol_soview2D_face* add_face(vtol_face_2d_sptr const& f,
00079 const vgui_style_sptr& style = NULL);
00080
00081
00082 void add_topology_object(vtol_topology_object_sptr const& tos,
00083 const vgui_style_sptr& style = NULL);
00084
00085 void add_topology_objects(vcl_vector<vtol_topology_object_sptr> const& tos,
00086 const vgui_style_sptr& style = NULL);
00087
00088 void add_edges(vcl_vector<vtol_edge_2d_sptr> const & edges,
00089 bool verts=false,
00090 const vgui_style_sptr& style = NULL);
00091
00092 void add_faces(vcl_vector<vtol_face_2d_sptr> const & faces, bool verts=false,
00093 const vgui_style_sptr& style = NULL);
00094
00095
00096 void clear_all();
00097
00098
00099
00100
00101 vtol_edge_2d_sptr get_mapped_edge(const int id);
00102 vtol_face_2d_sptr get_mapped_face(const int id);
00103
00104
00105 void set_vtol_topology_object_style(vtol_topology_object_sptr tos,
00106 const vgui_style_sptr& style = NULL);
00107 void set_vertex_style(const vgui_style_sptr& style);
00108 void set_edge_style(const vgui_style_sptr& style);
00109 void set_edge_group_style(const vgui_style_sptr& style);
00110 void set_face_style(const vgui_style_sptr& style);
00111
00112
00113 void set_temp(vtol_topology_object_sptr const& to) { temp_=to; }
00114 vtol_topology_object_sptr get_temp() { return temp_; }
00115 protected:
00116 vgui_style_sptr vertex_style_;
00117 vgui_style_sptr edge_style_;
00118 vgui_style_sptr edge_group_style_;
00119 vgui_style_sptr face_style_;
00120 void init();
00121 vtol_topology_object_sptr temp_;
00122 vcl_map<int, vtol_topology_object_sptr> obj_map_;
00123 };
00124
00125
00126
00127 struct bgui_vtol2D_tableau_new : public bgui_vtol2D_tableau_sptr
00128 {
00129 typedef bgui_vtol2D_tableau_sptr base;
00130
00131 bgui_vtol2D_tableau_new(const char* n="unnamed") :
00132 base(new bgui_vtol2D_tableau(n)) { }
00133 bgui_vtol2D_tableau_new(vgui_image_tableau_sptr const& it,
00134 const char* n="unnamed") :
00135 base(new bgui_vtol2D_tableau(it,n)) { }
00136
00137 bgui_vtol2D_tableau_new(vgui_tableau_sptr const& t, const char* n="unnamed")
00138 : base(new bgui_vtol2D_tableau(t, n)) { }
00139
00140 operator bgui_vsol2D_tableau_sptr () const { bgui_vsol2D_tableau_sptr tt; tt.vertical_cast(*this); return tt; }
00141 };
00142
00143 #endif // bgui_vtol2D_tableau_h_