Viewport Class Reference

An interactive view of the track, with scrollbars and an OpenGL box. More...

#include <Viewport.h>

Inheritance diagram for Viewport:

Table List of all members.

Public Types

typedef View::ViewAngle ViewAngle

Public Member Functions

 Viewport ()
 Create without sharing OpenGL contexts.
 Viewport (Viewport &viewport)
 Create sharing OpenGL contexts with an exisitng Viewport.
virtual ~Viewport ()
void set_document (Document::Document &document)
void update ()
 Update the Viewport to reflect changes in the document.
void set_angle (const ViewAngle angle)
 Set which perspective the view displays.
void zoom_in ()
 magnify the view by a factor of 1.25.
void zoom_out ()
 magnify the view by a factor of 0.8, reversing a zoom_in().
void scale_to_fit ()
 Set the scale so that the entire track fits in the view.
void realize_view ()
 Realize the view so it's display lists can be shared.
sigc::signal< void, boost::shared_ptr<
Document::DocumentDelta > > 
signal_command ()
 Signal emmited when the user requests a change to the track by interacting with the viewport.
sigc::signal< void, boost::shared_ptr<
Document::DocumentDelta > > 
signal_preview_command ()
 Signal emmited when there is a command to show a preview of.
sigc::signal< void > signal_preview_cancel ()
 Signal emmited when the previewed command should be canceled.

Protected Member Functions

void create ()
 Set scrollbars and events identical in all constructors.
void resize_adjustments ()
 Set the adjustments for the scrollbars to allow display of the whole track.
bool on_h_scrollbar_change_value (Gtk::ScrollType scroll, double new_value)
 Event handler for horizontal scrollbar being moved.
bool on_v_scrollbar_change_value (Gtk::ScrollType scroll, double new_value)
 Event handler for vertical scrollbar being moved.
virtual bool on_scroll_event (GdkEventScroll *event)

Protected Attributes

Gtk::Adjustment m_h_scroll_adjustment
Gtk::HScrollbar m_h_scroll_bar
Gtk::Adjustment m_v_scroll_adjustment
Gtk::VScrollbar m_v_scroll_bar
View m_view
 3-d track view
Document::Documentdocument
 The document to display.

Detailed Description

An interactive view of the track, with scrollbars and an OpenGL box.

This class just handles scrolling the view. For the view itself, see View.

Definition at line 25 of file Viewport.h.


Member Typedef Documentation

typedef View::ViewAngle Viewport::ViewAngle

Definition at line 42 of file Viewport.h.


Constructor & Destructor Documentation

Viewport::Viewport (  ) 

Create without sharing OpenGL contexts.

Meshes and textures previously loaded into an exisiting Viewport will not be avaliable in the new one.

Definition at line 15 of file Viewport.cpp.

Viewport::Viewport ( Viewport viewport  ) 

Create sharing OpenGL contexts with an exisitng Viewport.

Meshes and textures already loaded will be usable, and any textures or meshes loaded into either the exisiting Viewport or this new one will be avaliable in both.

Definition at line 26 of file Viewport.cpp.

Viewport::~Viewport (  )  [virtual]

Definition at line 57 of file Viewport.cpp.


Member Function Documentation

void Viewport::create (  )  [protected]

Set scrollbars and events identical in all constructors.

Definition at line 38 of file Viewport.cpp.

bool Viewport::on_h_scrollbar_change_value ( Gtk::ScrollType  scroll,
double  new_value 
) [protected]

Event handler for horizontal scrollbar being moved.

Changes the view to show the new position.

Definition at line 193 of file Viewport.cpp.

bool Viewport::on_scroll_event ( GdkEventScroll *  event  )  [protected, virtual]

Definition at line 236 of file Viewport.cpp.

bool Viewport::on_v_scrollbar_change_value ( Gtk::ScrollType  scroll,
double  new_value 
) [protected]

Event handler for vertical scrollbar being moved.

Changes the view to show the new position.

Definition at line 216 of file Viewport.cpp.

void Viewport::realize_view (  ) 

Realize the view so it's display lists can be shared.

Definition at line 268 of file Viewport.cpp.

void Viewport::resize_adjustments (  )  [protected]

Set the adjustments for the scrollbars to allow display of the whole track.

This function should be called whenever the size of the window or the scale of the view changes.

Definition at line 129 of file Viewport.cpp.

void Viewport::scale_to_fit (  ) 

Set the scale so that the entire track fits in the view.

Definition at line 93 of file Viewport.cpp.

void Viewport::set_angle ( const ViewAngle  angle  ) 

Set which perspective the view displays.

Definition at line 75 of file Viewport.cpp.

void Viewport::set_document ( Document::Document document  ) 

Definition at line 61 of file Viewport.cpp.

sigc::signal< void, boost::shared_ptr< Document::DocumentDelta > > Viewport::signal_command (  ) 

Signal emmited when the user requests a change to the track by interacting with the viewport.

The singal should be wired to a function

 void on_view_command(boost::shared_ptr<Document::DocumentDelta> delta)
where the delta paramter is the DocumentDelta describing the user requested change.
Returns:
signal that is emmited when the user performs an action to the scene by interacting with the view.

Definition at line 273 of file Viewport.cpp.

sigc::signal< void > Viewport::signal_preview_cancel (  ) 

Signal emmited when the previewed command should be canceled.

Definition at line 283 of file Viewport.cpp.

sigc::signal< void, boost::shared_ptr< Document::DocumentDelta > > Viewport::signal_preview_command (  ) 

Signal emmited when there is a command to show a preview of.

Definition at line 278 of file Viewport.cpp.

void Viewport::update (  ) 

Update the Viewport to reflect changes in the document.

Definition at line 68 of file Viewport.cpp.

void Viewport::zoom_in (  ) 

magnify the view by a factor of 1.25.

Definition at line 81 of file Viewport.cpp.

void Viewport::zoom_out (  ) 

magnify the view by a factor of 0.8, reversing a zoom_in().

Definition at line 87 of file Viewport.cpp.


Member Data Documentation

Document::Document* Viewport::document [protected]

The document to display.

Definition at line 111 of file Viewport.h.

Gtk::Adjustment Viewport::m_h_scroll_adjustment [protected]

Definition at line 103 of file Viewport.h.

Gtk::HScrollbar Viewport::m_h_scroll_bar [protected]

Definition at line 104 of file Viewport.h.

Gtk::Adjustment Viewport::m_v_scroll_adjustment [protected]

Definition at line 105 of file Viewport.h.

Gtk::VScrollbar Viewport::m_v_scroll_bar [protected]

Definition at line 106 of file Viewport.h.

View Viewport::m_view [protected]

3-d track view

Definition at line 108 of file Viewport.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:16 2010 by Doxygen version 1.4.7 for Racer version svn335.