Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
bgui3d_viewer_tableau Class Reference

Abstract base tableau for 3D viewers. More...

#include <bgui3d_viewer_tableau.h>

Inheritance diagram for bgui3d_viewer_tableau:
Inheritance graph
[legend]

List of all members.

Public Types

enum  camera_type_enum { PERSPECTIVE, ORTHOGONAL }
enum  interaction_type_enum { CAMERA, SCENEGRAPH }

Public Member Functions

virtual bool handle (const vgui_event &event)=0
 Handle vgui events.
virtual vcl_string type_name () const =0
 Return the type name of this tableau.
virtual void set_scene_root (SoNode *scene_root)
 Set the scene root.
SoNode * user_scene_root () const
 Return the root node in the users portion of the scene graph.
virtual bool set_camera (const vpgl_proj_camera< double > &camera)
 Set the scene camera.
virtual vcl_auto_ptr
< vpgl_proj_camera< double > > 
camera () const
 Get the scene camera.
virtual void set_camera (SoCamera *camera)
 Set the camera viewing the scene.
void select_camera (int camera_index)
 Select the active camera by index.
SoCamera * camera_node () const
 Return the camera viewing the scene.
virtual void set_camera_type (camera_type_enum type)
 Set the camera type (Perspective or Orthogonal).
camera_type_enum camera_type () const
 Return the camera type (Perspective or Orthogonal).
virtual void toggle_camera_type ()
 Toggle the camera type between Perspective and Orthogonal.
virtual void view_all ()
 Adjust the camera to view the entire scene.
virtual void save_home_position ()
 Save the current camera as the home position.
virtual void reset_to_home_position ()
 Restore the saved home position of the camera.
virtual void set_clipping_planes ()
virtual void set_headlight (bool enable)
 Activate a headlight.
bool is_headlight () const
 Is the headlight active.
SoDirectionalLight * headlight () const
 Return the headlight.
void setText (const vcl_string &string)
 set the text.
virtual vcl_string file_name () const
 file name isn't valid, so return the type_name.
virtual void setup_opengl () const
 Set up OpenGL for rendering.
virtual bool render ()
 Render the scene graph (called on draw events).
virtual bool render_overlay ()
 Render the overlay scene graph (called on draw overlay events).
virtual void request_render ()
 Called when the scene manager requests a render action.
virtual void request_render_overlay ()
 Called when the scene manager requests a render overlay action.
virtual bool idle ()
 Called when VGUI is idle.
void enable_idle ()
 Enable handling of idle events.
void disable_idle ()
 Disable handling of idle events.
bool is_idle_enabled ()
 Returns true if idle event handling is enabled.
SoNode * scene_root () const
 Return the root node in the scene graph.
virtual void set_overlay_scene_root (SoNode *scene_root)
 Set overlay scene root node.
SoNode * overlay_scene_root () const
 Return the root node in the overlay scene graph.
void set_viewport_region (const SbViewportRegion &region)
 Set the viewport.
const SbViewportRegion & get_viewport_region () const
 Get the viewport.
virtual void set_interaction_type (interaction_type_enum)
 Set the interaction type.
interaction_type_enum interaction_type () const
 Return the type of the interaction.
SoSceneManager * scene_manager () const
virtual vcl_string 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 ()
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 Member Functions

 bgui3d_viewer_tableau (SoNode *scene_root=NULL)
 Constructor.
virtual ~bgui3d_viewer_tableau ()
 Destructor.
vcl_vector< SoGroup * > get_parents_of_node (SoNode *node)
 Find the parent nodes in the scene graph.
void convertOrtho2Perspective (const SoOrthographicCamera *in, SoPerspectiveCamera *out)
 Convert to perspective.
void convertPerspective2Ortho (const SoPerspectiveCamera *in, SoOrthographicCamera *out)
 Convert to orthographic.
vcl_vector< SoCamera * > find_cameras (SoNode *root) const
 Find the camera nodes in the scenegraph.
void collect_vrml_cameras (SoNode *root) const
 Find the VRML viewpoint nodes in the scenegraph and make camera.

Protected Attributes

SoNode * user_scene_root_
 The subgraph provided by the user.
SoSwitch * camera_group_
SoCamera * scene_camera_
SoNode * stored_camera_
camera_type_enum camera_type_
SoDirectionalLight * headlight_
SoText2 * text_
SoNode * scene_root_
 The root node of the scene graph.
SoNode * overlay_scene_root_
SoSceneManager * scene_manager_
 The scene manager.
SoSceneManager * overlay_scene_manager_
bool idle_enabled_
interaction_type_enum interaction_type_

Detailed Description

Abstract base tableau for 3D viewers.

Definition at line 28 of file bgui3d_viewer_tableau.h.


Member Enumeration Documentation

Enumerator:
PERSPECTIVE 
ORTHOGONAL 

Definition at line 51 of file bgui3d_viewer_tableau.h.

Enumerator:
CAMERA 
SCENEGRAPH 

Definition at line 104 of file bgui3d_tableau.h.


Constructor & Destructor Documentation

bgui3d_viewer_tableau::bgui3d_viewer_tableau ( SoNode *  scene_root = NULL) [protected]

Constructor.

Definition at line 44 of file bgui3d_viewer_tableau.cxx.

bgui3d_viewer_tableau::~bgui3d_viewer_tableau ( ) [protected, virtual]

Destructor.

Definition at line 57 of file bgui3d_viewer_tableau.cxx.


Member Function Documentation

vcl_auto_ptr< vpgl_proj_camera< double > > bgui3d_viewer_tableau::camera ( ) const [virtual]

Get the scene camera.

Creates a vpgl camera (either perspective or affine) from the active SoCamera

Reimplemented from bgui3d_tableau.

Definition at line 227 of file bgui3d_viewer_tableau.cxx.

SoCamera * bgui3d_viewer_tableau::camera_node ( ) const

Return the camera viewing the scene.

Definition at line 301 of file bgui3d_viewer_tableau.cxx.

bgui3d_viewer_tableau::camera_type_enum bgui3d_viewer_tableau::camera_type ( ) const

Return the camera type (Perspective or Orthogonal).

Definition at line 347 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::collect_vrml_cameras ( SoNode *  root) const [protected]

Find the VRML viewpoint nodes in the scenegraph and make camera.

The cameras are added to the camera group (outside the user scene)

Definition at line 709 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::convertOrtho2Perspective ( const SoOrthographicCamera *  in,
SoPerspectiveCamera *  out 
) [protected]

Convert to perspective.

convert camera to perspective.

Definition at line 477 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::convertPerspective2Ortho ( const SoPerspectiveCamera *  in,
SoOrthographicCamera *  out 
) [protected]

Convert to orthographic.

convert camera to orthographic.

Definition at line 502 of file bgui3d_viewer_tableau.cxx.

void bgui3d_tableau::disable_idle ( ) [inherited]

Disable handling of idle events.

Definition at line 201 of file bgui3d_tableau.cxx.

void bgui3d_tableau::enable_idle ( ) [inherited]

Enable handling of idle events.

Definition at line 192 of file bgui3d_tableau.cxx.

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

file name isn't valid, so return the type_name.

Reimplemented from vgui_tableau.

Definition at line 41 of file bgui3d_tableau.h.

vcl_vector< SoCamera * > bgui3d_viewer_tableau::find_cameras ( SoNode *  root) const [protected]

Find the camera nodes in the scenegraph.

Definition at line 681 of file bgui3d_viewer_tableau.cxx.

vcl_vector< SoGroup * > bgui3d_viewer_tableau::get_parents_of_node ( SoNode *  node) [protected]

Find the parent nodes in the scene graph.

Definition at line 655 of file bgui3d_viewer_tableau.cxx.

const SbViewportRegion & bgui3d_tableau::get_viewport_region ( ) const [inherited]

Get the viewport.

Definition at line 310 of file bgui3d_tableau.cxx.

virtual bool bgui3d_viewer_tableau::handle ( const vgui_event event) [pure virtual]

Handle vgui events.

Reimplemented from bgui3d_tableau.

Implemented in bgui3d_examiner_tableau, bgui3d_examiner_slider_tableau, and bgui3d_fullviewer_tableau.

SoDirectionalLight * bgui3d_viewer_tableau::headlight ( ) const

Return the headlight.

Definition at line 450 of file bgui3d_viewer_tableau.cxx.

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

Called when VGUI is idle.

Reimplemented from vgui_tableau.

Reimplemented in bgui3d_examiner_tableau.

Definition at line 182 of file bgui3d_tableau.cxx.

bgui3d_tableau::interaction_type_enum bgui3d_tableau::interaction_type ( ) const [inherited]

Return the type of the interaction.

Get the interaction type.

Definition at line 324 of file bgui3d_tableau.cxx.

bool bgui3d_viewer_tableau::is_headlight ( ) const

Is the headlight active.

Definition at line 442 of file bgui3d_viewer_tableau.cxx.

bool bgui3d_tableau::is_idle_enabled ( ) [inherited]

Returns true if idle event handling is enabled.

Definition at line 209 of file bgui3d_tableau.cxx.

SoNode* bgui3d_tableau::overlay_scene_root ( ) const [inline, inherited]

Return the root node in the overlay scene graph.

Definition at line 84 of file bgui3d_tableau.h.

bool bgui3d_tableau::render ( ) [virtual, inherited]

Render the scene graph (called on draw events).

Reimplemented in bgui3d_examiner_tableau, and bgui3d_examiner_slider_tableau.

Definition at line 82 of file bgui3d_tableau.cxx.

bool bgui3d_tableau::render_overlay ( ) [virtual, inherited]

Render the overlay scene graph (called on draw overlay events).

Definition at line 116 of file bgui3d_tableau.cxx.

void bgui3d_tableau::request_render ( ) [virtual, inherited]

Called when the scene manager requests a render action.

Definition at line 217 of file bgui3d_tableau.cxx.

void bgui3d_tableau::request_render_overlay ( ) [virtual, inherited]

Called when the scene manager requests a render overlay action.

Called when the overlay scene manager requests a render action.

Definition at line 225 of file bgui3d_tableau.cxx.

void bgui3d_viewer_tableau::reset_to_home_position ( ) [virtual]

Restore the saved home position of the camera.

Definition at line 397 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::save_home_position ( ) [virtual]

Save the current camera as the home position.

Definition at line 374 of file bgui3d_viewer_tableau.cxx.

SoSceneManager * bgui3d_tableau::scene_manager ( ) const [inherited]

Definition at line 331 of file bgui3d_tableau.cxx.

SoNode* bgui3d_tableau::scene_root ( ) const [inline, inherited]

Return the root node in the scene graph.

Definition at line 78 of file bgui3d_tableau.h.

void bgui3d_viewer_tableau::select_camera ( int  camera_index)

Select the active camera by index.

A negative index selects the first user scene camera

Definition at line 278 of file bgui3d_viewer_tableau.cxx.

bool bgui3d_viewer_tableau::set_camera ( const vpgl_proj_camera< double > &  camera) [virtual]

Set the scene camera.

Generate an SoCamera from a camera matrix and use it

Generate an SoCamera from a camera matrix and use it

Note:
Only handles perspective cameras for now

Reimplemented from bgui3d_tableau.

Definition at line 172 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::set_camera ( SoCamera *  camera) [virtual]

Set the camera viewing the scene.

Note:
this does not add the camera to a scene graph

Definition at line 149 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::set_camera_type ( camera_type_enum  type) [virtual]

Set the camera type (Perspective or Orthogonal).

Definition at line 310 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::set_clipping_planes ( ) [virtual]

Definition at line 518 of file bgui3d_viewer_tableau.cxx.

void bgui3d_viewer_tableau::set_headlight ( bool  enable) [virtual]

Activate a headlight.

Definition at line 434 of file bgui3d_viewer_tableau.cxx.

void bgui3d_tableau::set_interaction_type ( interaction_type_enum  type) [virtual, inherited]

Set the interaction type.

Definition at line 317 of file bgui3d_tableau.cxx.

void bgui3d_tableau::set_overlay_scene_root ( SoNode *  scene_root) [virtual, inherited]

Set overlay scene root node.

Definition at line 260 of file bgui3d_tableau.cxx.

void bgui3d_viewer_tableau::set_scene_root ( SoNode *  scene_root) [virtual]

Set the scene root.

Make a group of all the cameras in the scene.

Reimplemented from bgui3d_tableau.

Definition at line 67 of file bgui3d_viewer_tableau.cxx.

void bgui3d_tableau::set_viewport_region ( const SbViewportRegion &  region) [inherited]

Set the viewport.

Definition at line 301 of file bgui3d_tableau.cxx.

void bgui3d_viewer_tableau::setText ( const vcl_string &  string)

set the text.

Definition at line 464 of file bgui3d_viewer_tableau.cxx.

void bgui3d_tableau::setup_opengl ( ) const [virtual, inherited]

Set up OpenGL for rendering.

Definition at line 70 of file bgui3d_tableau.cxx.

void bgui3d_viewer_tableau::toggle_camera_type ( ) [virtual]

Toggle the camera type between Perspective and Orthogonal.

Definition at line 355 of file bgui3d_viewer_tableau.cxx.

virtual vcl_string bgui3d_viewer_tableau::type_name ( ) const [pure virtual]

Return the type name of this tableau.

Reimplemented from bgui3d_tableau.

Implemented in bgui3d_examiner_tableau, and bgui3d_fullviewer_tableau.

SoNode* bgui3d_viewer_tableau::user_scene_root ( ) const [inline]

Return the root node in the users portion of the scene graph.

Definition at line 48 of file bgui3d_viewer_tableau.h.

void bgui3d_viewer_tableau::view_all ( ) [virtual]

Adjust the camera to view the entire scene.

Definition at line 366 of file bgui3d_viewer_tableau.cxx.


Member Data Documentation

SoSwitch* bgui3d_viewer_tableau::camera_group_ [protected]

Definition at line 130 of file bgui3d_viewer_tableau.h.

Definition at line 135 of file bgui3d_viewer_tableau.h.

SoDirectionalLight* bgui3d_viewer_tableau::headlight_ [protected]

Definition at line 137 of file bgui3d_viewer_tableau.h.

bool bgui3d_tableau::idle_enabled_ [protected, inherited]

Definition at line 123 of file bgui3d_tableau.h.

Definition at line 124 of file bgui3d_tableau.h.

SoSceneManager* bgui3d_tableau::overlay_scene_manager_ [protected, inherited]

Definition at line 122 of file bgui3d_tableau.h.

SoNode* bgui3d_tableau::overlay_scene_root_ [protected, inherited]

Definition at line 118 of file bgui3d_tableau.h.

SoCamera* bgui3d_viewer_tableau::scene_camera_ [protected]

Definition at line 132 of file bgui3d_viewer_tableau.h.

SoSceneManager* bgui3d_tableau::scene_manager_ [protected, inherited]

The scene manager.

Definition at line 121 of file bgui3d_tableau.h.

SoNode* bgui3d_tableau::scene_root_ [protected, inherited]

The root node of the scene graph.

Definition at line 117 of file bgui3d_tableau.h.

Definition at line 133 of file bgui3d_viewer_tableau.h.

SoText2* bgui3d_viewer_tableau::text_ [protected]

Definition at line 139 of file bgui3d_viewer_tableau.h.

The subgraph provided by the user.

Definition at line 128 of file bgui3d_viewer_tableau.h.


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