Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes
bgui3d_examiner_tableau Class Reference

Examiner viewer tableau for 3D scenes. More...

#include <bgui3d_examiner_tableau.h>

Inheritance diagram for bgui3d_examiner_tableau:
Inheritance graph
[legend]

List of all members.

Public Types

enum  SeekDistance { SEEK_FAR, SEEK_HALF, SEEK_NEAR, SEEK_ZERO }
enum  camera_type_enum { PERSPECTIVE, ORTHOGONAL }
enum  interaction_type_enum { CAMERA, SCENEGRAPH }

Public Member Functions

 bgui3d_examiner_tableau (SoNode *scene_root=NULL)
 Constructor.
virtual ~bgui3d_examiner_tableau ()
 Destructor.
virtual bool handle (const vgui_event &event)
 Handle vgui events.
vcl_string type_name () const
 Return the type name of this tableau.
virtual void get_popup (const vgui_popup_params &, vgui_menu &m)
 Builds a popup menu.
virtual bool render ()
 Render the scene graph (called on draw events).
void pan (const SbVec2f &currpos, const SbVec2f &prevpos, const float aspect_ratio)
 Pans the camera.
void zoom (float aspectratio)
 Zooms the camera.
void spin (const SbVec2f &currpos, const SbVec2f &prevpos)
 Spins the camera around the scene.
void reorient_camera (const SbRotation &rot)
 Reorients the camera to the specified rotation.
void update_log (SbVec2f pos)
 Updates position log.
void reset_log ()
 Resets position log.
void seek_to_point (SbVec2s pos)
 Seeks for the object under a mouse click and zooms to it.
bool idle ()
 What to do if events are idle, if enabled.
void set_axis_visible (bool state)
 Set the visibility of the axis cross.
bool axis_visible () const
 Return true if the axis cross is visible.
void set_seek_distance (SeekDistance seek)
 Changes the distance the viewer goes when seeking.
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 void set_camera (SoCamera *camera)
 Set the camera viewing the scene.
virtual vcl_auto_ptr
< vpgl_proj_camera< double > > 
camera () const
 Get the scene camera.
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_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.
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 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 &)

Public Attributes

SbRotation fromRot_
SbRotation toRot_
SbVec3f fromPos_
SbVec3f toPos_

Protected Member Functions

void draw_axis_cross ()
 draw the axis.
void draw_arrow ()
 Draw an arrow for the axis representation.
void find_scale ()
 Determine the scale of the scene.
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

vgui_button last_down_button_
SbVec2f last_pos_
Process last_process_
int last_timestamp_
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_

Private Attributes

SbSphereSheetProjector * spin_projector_
int spin_sample_counter_
SbRotation spin_increment_
Log log_
SeekDistance seek_distance_
SoTimerSensor * seekSensor_
float scale_
bool axis_visible_

Detailed Description

Examiner viewer tableau for 3D scenes.

Definition at line 45 of file bgui3d_examiner_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.

Enumerator:
SEEK_FAR 
SEEK_HALF 
SEEK_NEAR 
SEEK_ZERO 

Definition at line 48 of file bgui3d_examiner_tableau.h.


Constructor & Destructor Documentation

bgui3d_examiner_tableau::bgui3d_examiner_tableau ( SoNode *  scene_root = NULL)

Constructor.

Definition at line 36 of file bgui3d_examiner_tableau.cxx.

bgui3d_examiner_tableau::~bgui3d_examiner_tableau ( ) [virtual]

Destructor.

Definition at line 53 of file bgui3d_examiner_tableau.cxx.


Member Function Documentation

bool bgui3d_examiner_tableau::axis_visible ( ) const

Return true if the axis cross is visible.

Definition at line 568 of file bgui3d_examiner_tableau.cxx.

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

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 [inherited]

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 [inherited]

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, inherited]

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, inherited]

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, inherited]

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_examiner_tableau::draw_arrow ( ) [protected]

Draw an arrow for the axis representation.

Draw an arrow for the axis representation directly through OpenGL.

Definition at line 740 of file bgui3d_examiner_tableau.cxx.

void bgui3d_examiner_tableau::draw_axis_cross ( ) [protected]

draw the axis.

Definition at line 599 of file bgui3d_examiner_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, inherited]

Find the camera nodes in the scenegraph.

Definition at line 681 of file bgui3d_viewer_tableau.cxx.

void bgui3d_examiner_tableau::find_scale ( ) [protected]

Determine the scale of the scene.

Definition at line 303 of file bgui3d_examiner_tableau.cxx.

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

Find the parent nodes in the scene graph.

Definition at line 655 of file bgui3d_viewer_tableau.cxx.

void bgui3d_examiner_tableau::get_popup ( const vgui_popup_params params,
vgui_menu m 
) [virtual]

Builds a popup menu.

Reimplemented from bgui3d_fullviewer_tableau.

Definition at line 365 of file bgui3d_examiner_tableau.cxx.

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

Get the viewport.

Definition at line 310 of file bgui3d_tableau.cxx.

bool bgui3d_examiner_tableau::handle ( const vgui_event e) [virtual]

Handle vgui events.

Handle the events coming in.

  • Left mouse = spin
  • Middle mouse = pan
  • Middle mouse with control = zoom (dolly)
  • 's' and then click = seeks 2/3 of the distance to the object
  • 'i' toggles idle events
  • 'h' puts camera to the current view
  • 'h' with control sets the home view to the current view
  • 'v' views the entire scene
  • 'n' go to the next camera
  • 'p' go to the previous camera
  • The cursors pan
  • The cursors with 'control' spin
  • The up and down cursors with shift zoom (dolly)

Reimplemented from bgui3d_fullviewer_tableau.

Reimplemented in bgui3d_examiner_slider_tableau.

Definition at line 77 of file bgui3d_examiner_tableau.cxx.

SoDirectionalLight * bgui3d_viewer_tableau::headlight ( ) const [inherited]

Return the headlight.

Definition at line 450 of file bgui3d_viewer_tableau.cxx.

bool bgui3d_examiner_tableau::idle ( ) [virtual]

What to do if events are idle, if enabled.

When idle, spin the scene based on the log.

Reimplemented from bgui3d_tableau.

Definition at line 319 of file bgui3d_examiner_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 [inherited]

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.

void bgui3d_examiner_tableau::pan ( const SbVec2f &  currpos,
const SbVec2f &  prevpos,
const float  aspect_ratio 
)

Pans the camera.

Pan the camera.

Definition at line 397 of file bgui3d_examiner_tableau.cxx.

bool bgui3d_examiner_tableau::render ( ) [virtual]

Render the scene graph (called on draw events).

Reimplemented from bgui3d_tableau.

Reimplemented in bgui3d_examiner_slider_tableau.

Definition at line 584 of file bgui3d_examiner_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_examiner_tableau::reorient_camera ( const SbRotation &  rot)

Reorients the camera to the specified rotation.

Reorient the camera based on specified rotation.

Definition at line 441 of file bgui3d_examiner_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_examiner_tableau::reset_log ( )

Resets position log.

Reset the log.

Definition at line 476 of file bgui3d_examiner_tableau.cxx.

void bgui3d_viewer_tableau::reset_to_home_position ( ) [virtual, inherited]

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, inherited]

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_examiner_tableau::seek_to_point ( SbVec2s  pos)

Seeks for the object under a mouse click and zooms to it.

Definition at line 503 of file bgui3d_examiner_tableau.cxx.

void bgui3d_viewer_tableau::select_camera ( int  camera_index) [inherited]

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.

void bgui3d_examiner_tableau::set_axis_visible ( bool  state)

Set the visibility of the axis cross.

Definition at line 560 of file bgui3d_examiner_tableau.cxx.

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

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, inherited]

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, inherited]

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, inherited]

Definition at line 518 of file bgui3d_viewer_tableau.cxx.

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

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, inherited]

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_examiner_tableau::set_seek_distance ( SeekDistance  seek)

Changes the distance the viewer goes when seeking.

Definition at line 576 of file bgui3d_examiner_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) [inherited]

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_examiner_tableau::spin ( const SbVec2f &  currpos,
const SbVec2f &  prevpos 
)

Spins the camera around the scene.

Spin the scene based on the current mouse position and the last mouse position.

Definition at line 431 of file bgui3d_examiner_tableau.cxx.

void bgui3d_viewer_tableau::toggle_camera_type ( ) [virtual, inherited]

Toggle the camera type between Perspective and Orthogonal.

Definition at line 355 of file bgui3d_viewer_tableau.cxx.

vcl_string bgui3d_examiner_tableau::type_name ( ) const [virtual]

Return the type name of this tableau.

Implements bgui3d_fullviewer_tableau.

Definition at line 60 of file bgui3d_examiner_tableau.cxx.

void bgui3d_examiner_tableau::update_log ( SbVec2f  pos)

Updates position log.

Update the log so that it can keep track of where the mouse has been.

Definition at line 467 of file bgui3d_examiner_tableau.cxx.

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

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, inherited]

Adjust the camera to view the entire scene.

Definition at line 366 of file bgui3d_viewer_tableau.cxx.

void bgui3d_examiner_tableau::zoom ( float  aspectratio)

Zooms the camera.

Zoom (actually dolly) the camera.

Definition at line 420 of file bgui3d_examiner_tableau.cxx.


Member Data Documentation

Definition at line 136 of file bgui3d_examiner_tableau.h.

SoSwitch* bgui3d_viewer_tableau::camera_group_ [protected, inherited]

Definition at line 130 of file bgui3d_viewer_tableau.h.

Definition at line 135 of file bgui3d_viewer_tableau.h.

Definition at line 141 of file bgui3d_examiner_tableau.h.

Definition at line 139 of file bgui3d_examiner_tableau.h.

SoDirectionalLight* bgui3d_viewer_tableau::headlight_ [protected, inherited]

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.

Definition at line 111 of file bgui3d_examiner_tableau.h.

Definition at line 112 of file bgui3d_examiner_tableau.h.

Definition at line 113 of file bgui3d_examiner_tableau.h.

Definition at line 114 of file bgui3d_examiner_tableau.h.

Definition at line 129 of file bgui3d_examiner_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.

Definition at line 134 of file bgui3d_examiner_tableau.h.

SoCamera* bgui3d_viewer_tableau::scene_camera_ [protected, inherited]

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 130 of file bgui3d_examiner_tableau.h.

SoTimerSensor* bgui3d_examiner_tableau::seekSensor_ [private]

Definition at line 131 of file bgui3d_examiner_tableau.h.

Definition at line 128 of file bgui3d_examiner_tableau.h.

SbSphereSheetProjector* bgui3d_examiner_tableau::spin_projector_ [private]

Definition at line 126 of file bgui3d_examiner_tableau.h.

Definition at line 127 of file bgui3d_examiner_tableau.h.

SoNode* bgui3d_viewer_tableau::stored_camera_ [protected, inherited]

Definition at line 133 of file bgui3d_viewer_tableau.h.

SoText2* bgui3d_viewer_tableau::text_ [protected, inherited]

Definition at line 139 of file bgui3d_viewer_tableau.h.

Definition at line 142 of file bgui3d_examiner_tableau.h.

Definition at line 140 of file bgui3d_examiner_tableau.h.

SoNode* bgui3d_viewer_tableau::user_scene_root_ [protected, inherited]

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: