#include <bgui_picker_tableau.h>
Public Member Functions | |
bgui_picker_tableau (vgui_tableau_sptr const &) | |
Constructor, takes a child tableau. | |
~bgui_picker_tableau () | |
Destructor. | |
vcl_string | type_name () const |
bool | pick_point (float *x, float *y) |
Gets a user selected point. | |
void | pick_line (float *x1, float *y1, float *x2, float *y2) |
Gets a user selected line. | |
void | pick_box (float *x1, float *y1, float *x2, float *y2) |
Gets a user selected box specified by corner points). | |
void | anchored_pick_point (const float anch_x, const float anch_y, float *x, float *y) |
Gets a user selected polygon. | |
void | pick_polygon (vsol_polygon_2d_sptr &poly) |
Pick a polygon. | |
void | pick_polyline (vsol_polyline_2d_sptr &poly) |
pick a polyline (set of connected lines). | |
bool | pick_point_set (vcl_vector< vsol_point_2d_sptr > &ps_list, unsigned max) |
void | set_color (const float red=1.0f, const float green=1.0f, const float blue=1.0f) |
Set drawing style, [0 1.0] for colors. | |
void | set_line_width (const float width=2.0f) |
bool | handle (const vgui_event &) |
Handles all events for this tableau. | |
virtual vcl_string | name () const |
virtual vcl_string | file_name () const |
virtual vcl_string | pretty_name () const |
void | get_parents (vcl_vector< vgui_tableau_sptr > *out) const |
void | get_children (vcl_vector< vgui_tableau_sptr > *out) const |
vgui_tableau_sptr | get_child (unsigned i) const |
virtual bool | add_child (vgui_tableau_sptr const &) |
virtual bool | remove_child (vgui_tableau_sptr const &) |
virtual bool | notify_replaced_child (vgui_tableau_sptr const &old_child, vgui_tableau_sptr const &new_child) |
virtual void | add_popup (vgui_menu &) |
virtual void | get_popup (vgui_popup_params const &, vgui_menu &) |
virtual void | post_message (char const *, void const *) |
virtual void | post_redraw () |
virtual void | post_overlay_redraw () |
virtual void | post_idle_request () |
virtual bool | get_bounding_box (float low[3], float high[3]) const |
virtual bool | draw () |
virtual bool | mouse_down (int x, int y, vgui_button, vgui_modifier) |
virtual bool | mouse_up (int x, int y, vgui_button, vgui_modifier) |
virtual bool | motion (int x, int y) |
virtual bool | key_press (int x, int y, vgui_key, vgui_modifier) |
virtual bool | help () |
virtual bool | idle () |
void | ref () const |
void | unref () const |
Static Public Member Functions | |
static void | get_all (vcl_vector< vgui_tableau_sptr > *out) |
static bool | exists (vgui_tableau_sptr const &) |
Protected Attributes | |
vgui_parent_child_link | child_tab |
Private Types | |
enum | object_type { none_enum, point_enum, line_enum, anchor_enum, box_enum, poly_enum, point_set_enum, polyline_enum } |
List of possible objects to pick. More... | |
Private Member Functions | |
void | draw_line () |
Draw a line to help the user pick it. | |
void | draw_anchor_line () |
Draw a line to help the user pick it. | |
void | draw_box () |
draw box. | |
bool | next () |
Get next event in the event loop. | |
Private Attributes | |
bool | use_event_ |
Used in next() to indicate when the event has been used. | |
float | pointx1 |
Start and end points for line and box:. | |
float | pointy1 |
float | pointx2 |
float | pointy2 |
float | anchor_x |
Anchor point coordinates. | |
float | anchor_y |
bool | active |
For polygon. | |
vgui_event_condition | gesture0 |
vgui_event_condition | gesture1 |
vgui_event_condition | gesture2 |
vcl_vector< vsol_point_2d_sptr > | point_list |
vcl_vector< vsol_point_2d_sptr > | point_set_list |
float | last_x |
float | last_y |
float | r |
Style values. | |
float | g |
float | b |
float | w |
bool | FIRSTPOINT |
Whether this is the first (start) or second (end) point being selected. | |
float | pointx |
Coordinates for point:. | |
float | pointy |
bool | point_ret |
True if picked by left mouse button, else false. | |
bool | picking_completed |
True if we have completed picking the object. | |
Static Private Attributes | |
static object_type | obj_type = none_enum |
Type of object we are picking. |
Definition at line 34 of file bgui_picker_tableau.h.
enum bgui_picker_tableau::object_type [private] |
List of possible objects to pick.
none_enum | |
point_enum | |
line_enum | |
anchor_enum | |
box_enum | |
poly_enum | |
point_set_enum | |
polyline_enum |
Definition at line 90 of file bgui_picker_tableau.h.
bgui_picker_tableau::bgui_picker_tableau | ( | vgui_tableau_sptr const & | t | ) |
Constructor, takes a child tableau.
Definition at line 24 of file bgui_picker_tableau.cxx.
bgui_picker_tableau::~bgui_picker_tableau | ( | ) |
Destructor.
Definition at line 49 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::anchored_pick_point | ( | const float | anch_x, |
const float | anch_y, | ||
float * | x, | ||
float * | y | ||
) |
Gets a user selected polygon.
Gets a user selected point (x, y).
Pick a point with an anchored line indicator.
This function grabs the event loop and will not return until a mouse button down event occurs.
Definition at line 173 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::draw_anchor_line | ( | ) | [private] |
Draw a line to help the user pick it.
Definition at line 133 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::draw_box | ( | ) | [private] |
draw box.
Draw a box to help the user pick it.
Definition at line 114 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::draw_line | ( | ) | [private] |
Draw a line to help the user pick it.
Definition at line 99 of file bgui_picker_tableau.cxx.
bool bgui_picker_tableau::handle | ( | const vgui_event & | e | ) | [virtual] |
Handles all events for this tableau.
We grab events in this way rather than using a vgui_event_server because if we look at events outside the handle function then the gl state associated with those events will have changed. This means for a draw_overlay event we would end up drawing into the wrong buffer. For a mouse event we would not be able to get the position in the image using the projection_inspector (if e.g. the image was zoomed) since all the gl matrices would have been reset.
Reimplemented from vgui_tableau.
Definition at line 268 of file bgui_picker_tableau.cxx.
bool bgui_picker_tableau::next | ( | ) | [private] |
Get next event in the event loop.
Get next event in event loop.
Definition at line 483 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::pick_box | ( | float * | x1, |
float * | y1, | ||
float * | x2, | ||
float * | y2 | ||
) |
Gets a user selected box specified by corner points).
Definition at line 76 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::pick_line | ( | float * | x1, |
float * | y1, | ||
float * | x2, | ||
float * | y2 | ||
) |
Gets a user selected line.
This function grabs the event loop and will not return until two mouse down events occur. The parameters return the two points defining the line.
Definition at line 148 of file bgui_picker_tableau.cxx.
bool bgui_picker_tableau::pick_point | ( | float * | x, |
float * | y | ||
) |
Gets a user selected point.
This function grabs the event loop and will not return until a mouse down event occurs. Returns true if this is done with the left mouse button, otherwise false. The coordinates of the point are returned in the parameters.
Definition at line 59 of file bgui_picker_tableau.cxx.
bool bgui_picker_tableau::pick_point_set | ( | vcl_vector< vsol_point_2d_sptr > & | ps_list, |
unsigned | max | ||
) |
Definition at line 225 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::pick_polygon | ( | vsol_polygon_2d_sptr & | poly | ) |
Pick a polygon.
Definition at line 193 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::pick_polyline | ( | vsol_polyline_2d_sptr & | poly | ) |
pick a polyline (set of connected lines).
Definition at line 208 of file bgui_picker_tableau.cxx.
void bgui_picker_tableau::set_color | ( | const float | red = 1.0f , |
const float | green = 1.0f , |
||
const float | blue = 1.0f |
||
) | [inline] |
Set drawing style, [0 1.0] for colors.
Definition at line 69 of file bgui_picker_tableau.h.
void bgui_picker_tableau::set_line_width | ( | const float | width = 2.0f | ) | [inline] |
Definition at line 71 of file bgui_picker_tableau.h.
vcl_string bgui_picker_tableau::type_name | ( | ) | const [inline, virtual] |
Reimplemented from vgui_tableau.
Definition at line 42 of file bgui_picker_tableau.h.
bool bgui_picker_tableau::active [private] |
For polygon.
Definition at line 106 of file bgui_picker_tableau.h.
float bgui_picker_tableau::anchor_x [private] |
Anchor point coordinates.
Definition at line 103 of file bgui_picker_tableau.h.
float bgui_picker_tableau::anchor_y [private] |
Definition at line 103 of file bgui_picker_tableau.h.
float bgui_picker_tableau::b [private] |
Definition at line 120 of file bgui_picker_tableau.h.
vgui_parent_child_link bgui_picker_tableau::child_tab [protected] |
Definition at line 77 of file bgui_picker_tableau.h.
bool bgui_picker_tableau::FIRSTPOINT [private] |
Whether this is the first (start) or second (end) point being selected.
Definition at line 122 of file bgui_picker_tableau.h.
float bgui_picker_tableau::g [private] |
Definition at line 120 of file bgui_picker_tableau.h.
Definition at line 107 of file bgui_picker_tableau.h.
Definition at line 108 of file bgui_picker_tableau.h.
Definition at line 109 of file bgui_picker_tableau.h.
float bgui_picker_tableau::last_x [private] |
Definition at line 116 of file bgui_picker_tableau.h.
float bgui_picker_tableau::last_y [private] |
Definition at line 117 of file bgui_picker_tableau.h.
bgui_picker_tableau::object_type bgui_picker_tableau::obj_type = none_enum [static, private] |
Type of object we are picking.
Definition at line 94 of file bgui_picker_tableau.h.
bool bgui_picker_tableau::picking_completed [private] |
True if we have completed picking the object.
Definition at line 129 of file bgui_picker_tableau.h.
vcl_vector< vsol_point_2d_sptr > bgui_picker_tableau::point_list [private] |
Definition at line 111 of file bgui_picker_tableau.h.
bool bgui_picker_tableau::point_ret [private] |
True if picked by left mouse button, else false.
Definition at line 126 of file bgui_picker_tableau.h.
vcl_vector< vsol_point_2d_sptr > bgui_picker_tableau::point_set_list [private] |
Definition at line 114 of file bgui_picker_tableau.h.
float bgui_picker_tableau::pointx [private] |
Coordinates for point:.
Definition at line 124 of file bgui_picker_tableau.h.
float bgui_picker_tableau::pointx1 [private] |
Start and end points for line and box:.
Definition at line 100 of file bgui_picker_tableau.h.
float bgui_picker_tableau::pointx2 [private] |
Definition at line 100 of file bgui_picker_tableau.h.
float bgui_picker_tableau::pointy [private] |
Definition at line 124 of file bgui_picker_tableau.h.
float bgui_picker_tableau::pointy1 [private] |
Definition at line 100 of file bgui_picker_tableau.h.
float bgui_picker_tableau::pointy2 [private] |
Definition at line 100 of file bgui_picker_tableau.h.
float bgui_picker_tableau::r [private] |
Style values.
Definition at line 120 of file bgui_picker_tableau.h.
bool bgui_picker_tableau::use_event_ [private] |
Used in next() to indicate when the event has been used.
Definition at line 97 of file bgui_picker_tableau.h.
float bgui_picker_tableau::w [private] |
Definition at line 120 of file bgui_picker_tableau.h.