#include <vgui_soview.h>
Inheritance diagram for vgui_soview:

This class is the base class for vgui_soview2D and vgui_soview3D and contains the functionality they have in common.
Definition at line 32 of file vgui_soview.h.
Public Member Functions | |
| vgui_soview () | |
| Constructor - create a default soview. | |
| virtual | ~vgui_soview () |
| Destructor - delete this soview. | |
| virtual void | draw () const=0 |
| Render this soview on the display. | |
| virtual void | draw_select () const |
| Render this soview for selection purposes. | |
| virtual void | load_name () const |
| Calls OpenGL function glLoadName with this soview's id. | |
| virtual vcl_ostream & | print (vcl_ostream &s) const |
| Prints the ID of this soview. | |
| virtual vcl_string | type_name () const |
| This should never be called, derived classes should implement this. | |
| virtual void | set_style (const vgui_style_sptr &newstyle) |
| Set the style (colour, line width) of the soview. | |
| virtual vgui_style_sptr | get_style () const |
| Return the style (colour, line width) of the soview. | |
| void | set_colour (float r, float g, float b) |
| Set the colour of the soview. | |
| void | set_point_size (float s) |
| Set the point radius of the soview. | |
| void | set_line_width (float w) |
| Set the line width of the soview. | |
| void | attach (vgui_observer *) |
| Attach given observer to this soview. | |
| void | detach (vgui_observer *) |
| Detach the given observer from this soview. | |
| void | get_observers (vcl_vector< vgui_observer * > &) const |
| Get a list of all observers attached to this soview. | |
| virtual void | notify () const |
| Update all observers. | |
| virtual void | notify (vgui_message const &) const |
| Send message to all observers. | |
| virtual unsigned | get_id () const |
| Returns the ID of this soview. | |
| bool | get_selectable () const |
| Return true if it is possible to select this soview. | |
| void | set_selectable (bool s) |
| Make this soview selectable/non-selectable. | |
Static Public Member Functions | |
| static vgui_soview * | id_to_object (unsigned id) |
| Returns a pointer to the vgui_soview, given the ID. | |
| static unsigned | create_id () |
| Create a new ID. | |
Static Public Attributes | |
| static vgui_DLLDATA const void *const | msg_select |
| static vgui_DLLDATA const void *const | msg_deselect |
| static vgui_DLLDATA const void *const | msg_highlight |
| static vgui_DLLDATA const void *const | msg_unhighlight |
Protected Attributes | |
| unsigned | id |
| ID of this soview. | |
| bool | selectable |
| Whether this soview is selectable. | |
| vgui_style_sptr | style |
| Style (colour, line width, etc) of this soview. | |
Private Member Functions | |
| void | add_id () |
Static Private Attributes | |
| static vgui_DLLDATA unsigned | current_id |
| vgui_soview::vgui_soview | ( | ) | [inline] |
| vgui_soview::~vgui_soview | ( | ) | [virtual] |
Destructor - delete this soview.
Modified to erase the id from the map - otherwise we get a memory leak
Definition at line 45 of file vgui_soview.cxx.
| virtual void vgui_soview::draw | ( | ) | const [pure virtual] |
Render this soview on the display.
Implemented in vgui_soview2D_point, vgui_soview2D_lineseg, vgui_soview2D_group, vgui_soview2D_infinite_line, vgui_soview2D_circle, vgui_soview2D_ellipse, vgui_soview2D_linestrip, vgui_soview2D_polygon, vgui_soview2D_image, vgui_point3D, vgui_lineseg3D, and vgui_triangle3D.
| void vgui_soview::draw_select | ( | ) | const [virtual] |
Render this soview for selection purposes.
By default, this will call draw(). However, some objects take time to draw, especially in GL_SELECT mode. The routine allows such objects to render a simplified version for the selection process. Note that during selection, the object is not rendered on screen. The "rendering" is used by OpenGL internals to determine if the object is in the selection region (e.g. area around mouse pointer).
Reimplemented in vgui_soview2D_point, and vgui_soview2D_group.
Definition at line 93 of file vgui_soview.cxx.
| void vgui_soview::load_name | ( | ) | const [virtual] |
Calls OpenGL function glLoadName with this soview's id.
Definition at line 102 of file vgui_soview.cxx.
| vcl_ostream & vgui_soview::print | ( | vcl_ostream & | s | ) | const [virtual] |
Prints the ID of this soview.
Reimplemented in vgui_soview2D_point, vgui_soview2D_lineseg, vgui_soview2D_group, vgui_soview2D_infinite_line, vgui_soview2D_circle, vgui_soview2D_ellipse, vgui_soview2D_linestrip, vgui_soview2D_polygon, vgui_soview2D_image, vgui_point3D, vgui_lineseg3D, and vgui_triangle3D.
Definition at line 87 of file vgui_soview.cxx.
| virtual vcl_string vgui_soview::type_name | ( | ) | const [inline, virtual] |
This should never be called, derived classes should implement this.
Reimplemented in vgui_soview2D_point, vgui_soview2D_lineseg, vgui_soview2D_group, vgui_soview2D_infinite_line, vgui_soview2D_circle, vgui_soview2D_ellipse, vgui_soview2D_linestrip, vgui_soview2D_polygon, vgui_soview2D_image, vgui_point3D, vgui_lineseg3D, and vgui_triangle3D.
Definition at line 63 of file vgui_soview.h.
| virtual void vgui_soview::set_style | ( | const vgui_style_sptr & | newstyle | ) | [inline, virtual] |
Set the style (colour, line width) of the soview.
Reimplemented in vgui_soview2D_group.
Definition at line 66 of file vgui_soview.h.
| virtual vgui_style_sptr vgui_soview::get_style | ( | ) | const [inline, virtual] |
| void vgui_soview::set_colour | ( | float | r, | |
| float | g, | |||
| float | b | |||
| ) |
| void vgui_soview::set_point_size | ( | float | s | ) |
| void vgui_soview::set_line_width | ( | float | w | ) |
| void vgui_soview::attach | ( | vgui_observer * | ) |
| void vgui_soview::detach | ( | vgui_observer * | ) |
| void vgui_soview::get_observers | ( | vcl_vector< vgui_observer * > & | ) | const |
Get a list of all observers attached to this soview.
Definition at line 204 of file vgui_soview.cxx.
| void vgui_soview::notify | ( | ) | const [virtual] |
| void vgui_soview::notify | ( | vgui_message const & | ) | const [virtual] |
| virtual unsigned vgui_soview::get_id | ( | ) | const [inline, virtual] |
| vgui_soview * vgui_soview::id_to_object | ( | unsigned | id | ) | [static] |
| unsigned vgui_soview::create_id | ( | ) | [static] |
| bool vgui_soview::get_selectable | ( | ) | const [inline] |
| void vgui_soview::set_selectable | ( | bool | s | ) | [inline] |
| void vgui_soview::add_id | ( | ) | [private] |
Definition at line 59 of file vgui_soview.cxx.
const void *const vgui_soview::msg_select [static] |
Definition at line 96 of file vgui_soview.h.
const void *const vgui_soview::msg_deselect [static] |
Definition at line 97 of file vgui_soview.h.
const void *const vgui_soview::msg_highlight [static] |
Definition at line 98 of file vgui_soview.h.
const void *const vgui_soview::msg_unhighlight [static] |
Definition at line 99 of file vgui_soview.h.
unsigned vgui_soview::id [protected] |
bool vgui_soview::selectable [protected] |
vgui_style_sptr vgui_soview::style [protected] |
unsigned vgui_soview::current_id [static, private] |
Definition at line 128 of file vgui_soview.h.
1.5.1