vgui_easy3D_tableau Class Reference

#include <vgui_easy3D_tableau.h>

Inheritance diagram for vgui_easy3D_tableau:

Inheritance graph
[legend]

List of all members.


Detailed Description

Tableau to display three-dimensional geometric objects.

Three-dimensional objects (see vgui_soview3D) can be added using add, or add_point, add_line.

Definition at line 32 of file vgui_easy3D_tableau.h.


Public Member Functions

 vgui_easy3D_tableau ()
 Constructor - don't use this, use vgui_easy3D_tableau_new.
vcl_string type_name () const
 Returns the tableau name.
void add (vgui_soview3D *)
 Add the given vgui_soview3D to the display.
vgui_point3Dadd_point (float x, float y, float z)
 Add a 3D-point at the given location.
vgui_lineseg3Dadd_line (float x0, float y0, float z0, float x1, float y1, float z1)
 Add a 3D-line with the given start and end points.
vgui_triangle3Dadd_triangle (float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2)
 Add a 3D-triangle with the given vertices.
void set_foreground (float red, float green, float blue)
 Set the colour of objects to the given RGB value.
void set_line_width (float new_width)
 Set the line width of all objects to the given width.
void set_point_radius (float new_radius)
 Set the radius of all points to the given radius.
void save_e3d (char const *filename)
void load_e3d (char const *filename)
bool handle (const vgui_event &e)
 Handle all events sent to this tableau.
bool mouse_down (int x, int y, vgui_button button, vgui_modifier modifier)
 Called by default handle when it receives a mouse down event.
void draw_soviews_render ()
void draw_soviews_select ()
bool is_selected (unsigned id)
vcl_vector< unsigned > const & get_selected () const
vcl_vector< vgui_soview * > get_selected_soviews () const
bool select (unsigned id)
bool deselect (unsigned id)
bool deselect_all ()
bool is_highlighted (unsigned id)
unsigned get_highlighted ()
vgui_soviewget_highlighted_soview ()
bool highlight (unsigned id)
virtual void add (vgui_soview *)
virtual void remove (vgui_soview *&)
virtual void clear ()
 clear all soviews from the display.
void set_current_grouping (vcl_string name)
vcl_string get_current_grouping ()
vgui_displaybase_tableau_groupingget_grouping_ptr (vcl_string name)
vcl_vector< vcl_string > get_grouping_names ()
void set_selection_callback (vgui_displaybase_tableau_selection_callback *cb)
 Attach your own selection callback.
vcl_vector< vgui_soview * > const & get_all () const
vcl_vector< unsigned > const get_all_ids () const
vgui_soviewcontains_hit (vcl_vector< unsigned > hit)
unsigned get_id () const
virtual vcl_string name () const
 Return the name of the tableau.
virtual vcl_string file_name () const
 Return the name of a file associated with some tableau below (if meaningful).
virtual vcl_string pretty_name () const
 Used to provide an informative name for printouts, debugging etc.
void get_parents (vcl_vector< vgui_tableau_sptr > *out) const
 Get the parent tableaux for this tableau.
void get_children (vcl_vector< vgui_tableau_sptr > *out) const
 Get the child tableaux for this tableau.
vgui_tableau_sptr get_child (unsigned i) const
 Get the ith child or return 0.
virtual bool add_child (vgui_tableau_sptr const &)
 Add the given tableau to the list of child tableaux.
virtual bool remove_child (vgui_tableau_sptr const &)
 Remove the given child from the list of child tableaux.
virtual bool notify_replaced_child (vgui_tableau_sptr const &old_child, vgui_tableau_sptr const &new_child)
 Called whenever a child of this tableau is about to be forcibly replaced.
virtual void add_popup (vgui_menu &)
 Add the given menu to the popup menu for the tableau.
virtual void get_popup (vgui_popup_params const &, vgui_menu &)
 Get the default popup menu for the tableau.
virtual void post_message (char const *, void const *)
 Post a message event.
virtual void post_redraw ()
 Post a draw event.
virtual void post_overlay_redraw ()
 Post a overlay-redraw event.
virtual void post_idle_request ()
 Post an idle request event.
virtual bool get_bounding_box (float low[3], float high[3]) const
 Get the bounding box of this tableau.
virtual bool draw ()
 Called by default handle when it receives a draw event.
virtual bool mouse_up (int x, int y, vgui_button, vgui_modifier)
 Called by default handle when it receives a mouse up event.
virtual bool motion (int x, int y)
 Called by handle when it receives a mouse motion event.
virtual bool key_press (int x, int y, vgui_key, vgui_modifier)
 Called by default handle when it receives a key-press event.
virtual bool help ()
 Called by default handle when it receives a '?' pressed event.
virtual bool idle ()
 Called when the application is otherwise idle.
void ref () const
 Increase the reference count by one (for smart pointers).
void unref () const
 Decrease the reference count by one (for smart pointers).
virtual bool mouse_drag (int, int, vgui_button, vgui_modifier)
 Called when the user is dragging the mouse.

Static Public Member Functions

static void get_all (vcl_vector< vgui_tableau_sptr > *out)
 Push all tableaux onto the given vector.
static bool exists (vgui_tableau_sptr const &)
 Returns true if the given address points to a valid tableau.

Public Attributes

GLenum gl_mode

Protected Member Functions

 ~vgui_easy3D_tableau ()
 Destructor - called by vgui_easy3D_tableau_sptr.

Protected Attributes

vgui_style_sptr style_
vcl_vector< vgui_soview * > objects
vcl_map< vcl_string,
vgui_displaybase_tableau_grouping
groupings
vcl_string current_grouping
vcl_vector< unsigned > selections
unsigned highlighted
int gl_display_list
vgui_displaybase_tableau_selection_callbackcb_

Constructor & Destructor Documentation

vgui_easy3D_tableau::vgui_easy3D_tableau (  ) 

Constructor - don't use this, use vgui_easy3D_tableau_new.

Definition at line 18 of file vgui_easy3D_tableau.cxx.

vgui_easy3D_tableau::~vgui_easy3D_tableau (  )  [inline, protected]

Destructor - called by vgui_easy3D_tableau_sptr.

Definition at line 71 of file vgui_easy3D_tableau.h.


Member Function Documentation

vcl_string vgui_easy3D_tableau::type_name (  )  const [inline, virtual]

Returns the tableau name.

Reimplemented from vgui_displaylist3D_tableau.

Definition at line 39 of file vgui_easy3D_tableau.h.

void vgui_easy3D_tableau::add ( vgui_soview3D object  ) 

Add the given vgui_soview3D to the display.

Definition at line 31 of file vgui_easy3D_tableau.cxx.

vgui_point3D * vgui_easy3D_tableau::add_point ( float  x,
float  y,
float  z 
)

Add a 3D-point at the given location.

Definition at line 40 of file vgui_easy3D_tableau.cxx.

vgui_lineseg3D * vgui_easy3D_tableau::add_line ( float  x0,
float  y0,
float  z0,
float  x1,
float  y1,
float  z1 
)

Add a 3D-line with the given start and end points.

Definition at line 52 of file vgui_easy3D_tableau.cxx.

vgui_triangle3D * vgui_easy3D_tableau::add_triangle ( float  x0,
float  y0,
float  z0,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
)

Add a 3D-triangle with the given vertices.

Definition at line 64 of file vgui_easy3D_tableau.cxx.

void vgui_easy3D_tableau::set_foreground ( float  red,
float  green,
float  blue 
)

Set the colour of objects to the given RGB value.

Definition at line 78 of file vgui_easy3D_tableau.cxx.

void vgui_easy3D_tableau::set_line_width ( float  new_width  ) 

Set the line width of all objects to the given width.

Definition at line 90 of file vgui_easy3D_tableau.cxx.

void vgui_easy3D_tableau::set_point_radius ( float  new_radius  ) 

Set the radius of all points to the given radius.

Definition at line 100 of file vgui_easy3D_tableau.cxx.

void vgui_easy3D_tableau::save_e3d ( char const *  filename  ) 

void vgui_easy3D_tableau::load_e3d ( char const *  filename  ) 

bool vgui_displaylist3D_tableau::handle ( const vgui_event event  )  [virtual, inherited]

Handle all events sent to this tableau.

Override in subclass to give the tableau some appearance and behaviour.

Override in subclasses to give the tableau some appearance and behaviour.

Reimplemented from vgui_displaybase_tableau.

Definition at line 22 of file vgui_displaylist3D_tableau.cxx.

bool vgui_displaylist3D_tableau::mouse_down ( int  x,
int  y,
vgui_button  ,
vgui_modifier   
) [virtual, inherited]

Called by default handle when it receives a mouse down event.

Reimplemented from vgui_tableau.

Definition at line 66 of file vgui_displaylist3D_tableau.cxx.

void vgui_displaybase_tableau::draw_soviews_render (  )  [inherited]

Definition at line 157 of file vgui_displaybase_tableau.cxx.

void vgui_displaybase_tableau::draw_soviews_select (  )  [inherited]

Definition at line 207 of file vgui_displaybase_tableau.cxx.

bool vgui_displaybase_tableau::is_selected ( unsigned  id  )  [inherited]

Definition at line 257 of file vgui_displaybase_tableau.cxx.

vcl_vector<unsigned> const& vgui_displaybase_tableau::get_selected (  )  const [inline, inherited]

Definition at line 88 of file vgui_displaybase_tableau.h.

vcl_vector< vgui_soview * > vgui_displaybase_tableau::get_selected_soviews (  )  const [inherited]

Definition at line 263 of file vgui_displaybase_tableau.cxx.

bool vgui_displaybase_tableau::select ( unsigned  id  )  [inherited]

Definition at line 282 of file vgui_displaybase_tableau.cxx.

bool vgui_displaybase_tableau::deselect ( unsigned  id  )  [inherited]

Definition at line 307 of file vgui_displaybase_tableau.cxx.

bool vgui_displaybase_tableau::deselect_all (  )  [inherited]

Definition at line 328 of file vgui_displaybase_tableau.cxx.

bool vgui_displaybase_tableau::is_highlighted ( unsigned  id  )  [inline, inherited]

Definition at line 95 of file vgui_displaybase_tableau.h.

unsigned vgui_displaybase_tableau::get_highlighted (  )  [inline, inherited]

Definition at line 96 of file vgui_displaybase_tableau.h.

vgui_soview * vgui_displaybase_tableau::get_highlighted_soview (  )  [inherited]

Definition at line 357 of file vgui_displaybase_tableau.cxx.

bool vgui_displaybase_tableau::highlight ( unsigned  id  )  [inline, inherited]

Definition at line 98 of file vgui_displaybase_tableau.h.

void vgui_displaybase_tableau::add ( vgui_soview object  )  [virtual, inherited]

Definition at line 64 of file vgui_displaybase_tableau.cxx.

void vgui_displaybase_tableau::remove ( vgui_soview *&  object  )  [virtual, inherited]

Definition at line 92 of file vgui_displaybase_tableau.cxx.

void vgui_displaybase_tableau::clear (  )  [virtual, inherited]

clear all soviews from the display.

The soviews must be deleted otherwise we have a big memory leak. It is not clear that the design intended that the creator of the soview is responsible for deleting it. In any case, such management would be impossible without reference counting. If users are going to keep soviews for personal use, then the whole soview scheme should be changed to smart pointers. JLM

Reimplemented in vgui_easy2D_tableau.

Definition at line 133 of file vgui_displaybase_tableau.cxx.

void vgui_displaybase_tableau::set_current_grouping ( vcl_string  name  )  [inline, inherited]

Definition at line 112 of file vgui_displaybase_tableau.h.

vcl_string vgui_displaybase_tableau::get_current_grouping (  )  [inline, inherited]

Definition at line 113 of file vgui_displaybase_tableau.h.

vgui_displaybase_tableau_grouping * vgui_displaybase_tableau::get_grouping_ptr ( vcl_string  name  )  [inherited]

Definition at line 380 of file vgui_displaybase_tableau.cxx.

vcl_vector< vcl_string > vgui_displaybase_tableau::get_grouping_names (  )  [inherited]

Definition at line 389 of file vgui_displaybase_tableau.cxx.

void vgui_displaybase_tableau::set_selection_callback ( vgui_displaybase_tableau_selection_callback cb  )  [inherited]

Attach your own selection callback.

You are in charge of deleting it later.

Definition at line 59 of file vgui_displaybase_tableau.cxx.

vcl_vector<vgui_soview*> const& vgui_displaybase_tableau::get_all (  )  const [inline, inherited]

Reimplemented in vgui_easy2D_tableau.

Definition at line 121 of file vgui_displaybase_tableau.h.

void vgui_tableau::get_all ( vcl_vector< vgui_tableau_sptr > *  out  )  [static, inherited]

Push all tableaux onto the given vector.

Definition at line 376 of file vgui_tableau.cxx.

vcl_vector< unsigned > const vgui_displaybase_tableau::get_all_ids (  )  const [inherited]

Definition at line 273 of file vgui_displaybase_tableau.cxx.

vgui_soview * vgui_displaybase_tableau::contains_hit ( vcl_vector< unsigned >  hit  )  [inherited]

Definition at line 362 of file vgui_displaybase_tableau.cxx.

unsigned vgui_displaybase_tableau::get_id (  )  const [inline, inherited]

Definition at line 126 of file vgui_displaybase_tableau.h.

virtual vcl_string vgui_tableau::name ( void   )  const [inline, virtual, inherited]

Return the name of the tableau.

Reimplemented in vgui_easy2D_tableau.

Definition at line 90 of file vgui_tableau.h.

virtual vcl_string vgui_tableau::file_name (  )  const [inline, virtual, inherited]

Return the name of a file associated with some tableau below (if meaningful).

Reimplemented in vgui_blender_tableau, vgui_composite_tableau, vgui_deck_tableau, vgui_easy2D_tableau, vgui_enhance_tableau, vgui_image_tableau, vgui_roi_tableau, vgui_wrapper_tableau, and vgui_vrml_tableau.

Definition at line 93 of file vgui_tableau.h.

virtual vcl_string vgui_tableau::pretty_name (  )  const [inline, virtual, inherited]

Used to provide an informative name for printouts, debugging etc.

Often it's type_name() + some representation of the essential state.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, vgui_easy2D_tableau, vgui_image_tableau, vgui_roi_tableau, vgui_wrapper_tableau, and vgui_vrml_tableau.

Definition at line 97 of file vgui_tableau.h.

void vgui_tableau::get_parents ( vcl_vector< vgui_tableau_sptr > *  out  )  const [inherited]

Get the parent tableaux for this tableau.

Push parents onto the given vcl_vector.

Definition at line 260 of file vgui_tableau.cxx.

void vgui_tableau::get_children ( vcl_vector< vgui_tableau_sptr > *  out  )  const [inherited]

Get the child tableaux for this tableau.

Push children onto the given vcl_vector.

Definition at line 267 of file vgui_tableau.cxx.

vgui_tableau_sptr vgui_tableau::get_child ( unsigned  i  )  const [inherited]

Get the ith child or return 0.

Get the ith child, or return 0.

Definition at line 274 of file vgui_tableau.cxx.

bool vgui_tableau::add_child ( vgui_tableau_sptr const &   )  [virtual, inherited]

Add the given tableau to the list of child tableaux.

Virtual overridden by consenting parents.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, and vgui_wrapper_tableau.

Definition at line 284 of file vgui_tableau.cxx.

bool vgui_tableau::remove_child ( vgui_tableau_sptr const &   )  [virtual, inherited]

Remove the given child from the list of child tableaux.

Remove the given tableau from the list of child tableaux.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, and vgui_wrapper_tableau.

Definition at line 291 of file vgui_tableau.cxx.

bool vgui_tableau::exists ( vgui_tableau_sptr const &  ptr  )  [static, inherited]

Returns true if the given address points to a valid tableau.

Definition at line 385 of file vgui_tableau.cxx.

bool vgui_tableau::notify_replaced_child ( vgui_tableau_sptr const &  old_child,
vgui_tableau_sptr const &  new_child 
) [virtual, inherited]

Called whenever a child of this tableau is about to be forcibly replaced.

Called when a child of this tableau is forcibly replaced.

This method is called when some part of the program (typically the parent_child_link mechanism) is about to forcibly replace a child of this tableau. The canonical reason to override this is in order to invalidate caches.

Definition at line 302 of file vgui_tableau.cxx.

void vgui_tableau::add_popup ( vgui_menu  )  [virtual, inherited]

Add the given menu to the popup menu for the tableau.

Add given menu to the tableau popup menu.

This method is for tableaux to implement if they want to _add_ some items to the popup menu. They can assign to or clear 'menu', but that is not recommended as it would remove what other tableaux put there. The recommended usage is to .add() items or to .include() another menu.

** This is an interface method. it abstracts a behaviour. **

Reimplemented in vgui_active_tableau, vgui_clear_tableau, and vgui_satellite_tableau_t< object, data >.

Definition at line 316 of file vgui_tableau.cxx.

void vgui_tableau::get_popup ( vgui_popup_params const &  params,
vgui_menu menu 
) [virtual, inherited]

Get the default popup menu for the tableau.

Gets popup menu for this tableau.

If recurse is, true, recursively add the popup menus for children and children's children etc.

** this is a mixin method. it does some work for you. **

Reimplemented in vgui_deck_tableau, vgui_image_tableau, vgui_poly_tableau, vgui_shell_tableau, vgui_tview_launcher_tableau, and vgui_tview_tableau.

Definition at line 327 of file vgui_tableau.cxx.

void vgui_tableau::post_message ( char const *  msg,
void const *  data 
) [virtual, inherited]

Post a message event.

The fact that this is virtual does not imply that you should go and override it.

Reimplemented in vgui_adaptor_tableau.

Definition at line 205 of file vgui_tableau.cxx.

void vgui_tableau::post_redraw ( void   )  [virtual, inherited]

Post a draw event.

The fact that this is virtual does not imply that you should go and override it.

Reimplemented in vgui_adaptor_tableau.

Definition at line 215 of file vgui_tableau.cxx.

void vgui_tableau::post_overlay_redraw ( void   )  [virtual, inherited]

Post a overlay-redraw event.

Post a overlay redraw event.

The fact that this is virtual does not imply that you should go and override it.

Reimplemented in vgui_adaptor_tableau.

Definition at line 225 of file vgui_tableau.cxx.

void vgui_tableau::post_idle_request ( void   )  [virtual, inherited]

Post an idle request event.

The fact that this is virtual does not imply that you should go and override it.

Posting an idle event request means that your tableau has some idle processing that it'd like to do. This means that your tableau will continue to receive vgui_IDLE events until the event handler returns false (i.e. all idle processing is complete). The idle event handler should return false when it has no idle processing, or has completed its idle processing. It may return true if has only partially completed its idle processing; in this case, it will receive more idle event to allow it to complete processing.

Reimplemented in vgui_adaptor_tableau.

Definition at line 235 of file vgui_tableau.cxx.

bool vgui_tableau::get_bounding_box ( float  low[3],
float  high[3] 
) const [virtual, inherited]

Get the bounding box of this tableau.

Return the bounding box of this tableau.

If infinite in extent, or nothing is drawn, or you can't be bothered to implement it, return false. const. if you need to cache, cast away const.

If infinite in extent, or nothing is drawn, or you can't be bothered to implement it, return false.

Reimplemented in vgui_composite_tableau, vgui_image_tableau, vgui_roi_tableau, and vgui_wrapper_tableau.

Definition at line 198 of file vgui_tableau.cxx.

bool vgui_tableau::draw (  )  [virtual, inherited]

Called by default handle when it receives a draw event.

Reimplemented in vgui_function_tableau.

Definition at line 176 of file vgui_tableau.cxx.

bool vgui_tableau::mouse_up ( int  x,
int  y,
vgui_button  ,
vgui_modifier   
) [virtual, inherited]

Called by default handle when it receives a mouse up event.

Reimplemented in vgui_function_tableau, vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 136 of file vgui_tableau.cxx.

bool vgui_tableau::motion ( int  x,
int  y 
) [virtual, inherited]

Called by handle when it receives a mouse motion event.

Called by default handle when it receives a mouse motion event.

Reimplemented in vgui_displaylist2D_tableau, vgui_function_tableau, and vgui_listmanager2D_tableau.

Definition at line 146 of file vgui_tableau.cxx.

bool vgui_tableau::key_press ( int  x,
int  y,
vgui_key  ,
vgui_modifier   
) [virtual, inherited]

Called by default handle when it receives a key-press event.

Caled by default handle when it receives a key press event.

Reimplemented in vgui_deck_tableau, vgui_function_tableau, vgui_listmanager2D_tableau, vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 156 of file vgui_tableau.cxx.

bool vgui_tableau::help (  )  [virtual, inherited]

Called by default handle when it receives a '?' pressed event.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, vgui_function_tableau, vgui_listmanager2D_tableau, vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 166 of file vgui_tableau.cxx.

bool vgui_tableau::idle (  )  [virtual, inherited]

Called when the application is otherwise idle.

Override if you want to do idle processing. Return false once your idle processing is complete, or if you have no need for more idle processing. Return true if you need more idle processing time.

Definition at line 185 of file vgui_tableau.cxx.

void vgui_tableau::ref (  )  const [inherited]

Increase the reference count by one (for smart pointers).

Increase the reference count by one (for smart-pointers).

"const" is for convenience, it is cast away internally.

Definition at line 79 of file vgui_tableau.cxx.

void vgui_tableau::unref (  )  const [inherited]

Decrease the reference count by one (for smart pointers).

Decrease the reference count by one (for smart-pointers).

"const" is for convenience, it is cast away internally. If the reference count reaches zero then delete the object.

If the reference count reaches zero then delete the object.

Definition at line 87 of file vgui_tableau.cxx.

bool vgui_drag_mixin::mouse_drag ( int  ,
int  ,
vgui_button  ,
vgui_modifier   
) [virtual, inherited]

Called when the user is dragging the mouse.

Reimplemented in vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 44 of file vgui_drag_mixin.cxx.


Member Data Documentation

Definition at line 73 of file vgui_easy3D_tableau.h.

Definition at line 81 of file vgui_displaybase_tableau.h.

vcl_vector<vgui_soview*> vgui_displaybase_tableau::objects [protected, inherited]

Definition at line 129 of file vgui_displaybase_tableau.h.

vcl_map< vcl_string , vgui_displaybase_tableau_grouping > vgui_displaybase_tableau::groupings [protected, inherited]

Definition at line 131 of file vgui_displaybase_tableau.h.

vcl_string vgui_displaybase_tableau::current_grouping [protected, inherited]

Definition at line 133 of file vgui_displaybase_tableau.h.

vcl_vector<unsigned> vgui_displaybase_tableau::selections [protected, inherited]

Definition at line 141 of file vgui_displaybase_tableau.h.

unsigned vgui_displaybase_tableau::highlighted [protected, inherited]

Definition at line 142 of file vgui_displaybase_tableau.h.

int vgui_displaybase_tableau::gl_display_list [protected, inherited]

Definition at line 144 of file vgui_displaybase_tableau.h.

Definition at line 146 of file vgui_displaybase_tableau.h.


The documentation for this class was generated from the following files:

Generated on Sun Nov 22 06:21:59 2009 for core/vgui by  doxygen 1.5.5