#include <View.h>
Inheritance diagram for View:
Public Types | |
VIEW_TOP | |
Draw the map in the xy plane. | |
VIEW_SIDE | |
Draw the map in the yz plane. | |
VIEW_FRONT | |
Draw the map in the xz plane. | |
enum | ViewAngle { VIEW_TOP, VIEW_SIDE, VIEW_FRONT } |
The set of perspectives to draw from. More... | |
Public Member Functions | |
View () | |
Create using a new OpenGL context. | |
View (View &view) | |
Create sharing OpenGL the context of an existing View. | |
virtual | ~View () |
void | set_document (Document::Document &document) |
Set the document that the area is to represent. | |
void | set_angle (const ViewAngle angle) |
Set the perspective the view has on the stage. | |
ViewAngle | get_angle () const |
Get the perspective of the view. | |
void | set_scale (const float scale) |
Set the scale to display the track at. | |
float | get_scale () const |
get the scale. | |
void | set_centre (btVector3 centre) |
Set the centre of the view. | |
btVector3 | get_centre () const |
Get the centre of the view. | |
void | realize () |
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 view. | |
sigc::signal< void, boost::shared_ptr< Document::DocumentDelta > > | signal_preview_command () |
Signal emmited when during user interaction with the view. | |
sigc::signal< void > | signal_preview_cancel () |
Get signal emmited when the previewed command should be canceled. | |
Protected Member Functions | |
virtual void | on_realize () |
virtual bool | on_configure_event (GdkEventConfigure *event) |
virtual bool | on_expose_event (GdkEventExpose *event) |
virtual bool | on_scroll_event (GdkEventScroll *event) |
virtual bool | on_button_press_event (GdkEventButton *event) |
virtual bool | on_button_release_event (GdkEventButton *event) |
virtual bool | on_motion_notify_event (GdkEventMotion *event) |
void | on_delete_vertex () |
void | on_delete_edge () |
void | on_delete_attachment () |
void | on_flip_edge () |
void | on_insert_vertex () |
void | on_set_start_edge () |
void | on_add_booster () |
void | setup_ui () |
User interface preperation common to any constructor. | |
void | recentre_view () |
Set the OpenGL modelview matrix so we can draw the scene with the correct orientation, scale, and centre. | |
void | draw_path (const Track::Path &path) |
Draw the path of the track. | |
const Track::EditAssist::Selectable * | get_selectable_under_mouse () |
Find something under the mouse pointer. | |
btVector3 | mouse_to_scene (btScalar x, btScalar y) const |
Convert window position to scene position. | |
void | set_relative_depth (btVector3 &position, btScalar depth) |
move a position vector so its distance into the screen is the view's centre + a given value. | |
void | pick_segment (std::size_t index) |
Protected Attributes | |
Document::Document * | document |
The document to show and edit. | |
float | scale |
The scale of the drawing. Scale is in pixels per distance unit. | |
btScalar | handle_length |
The length of the handles used to edit rotations. | |
btVector3 | centre |
The coordinates at the bottom left corner of the display. | |
ViewAngle | view_angle |
Which perspective of the scene to use. | |
bool | needs_recentre |
true if recentre_view() needs to be called during the next draw. | |
btVector3 | new_position |
New position of object being dragged, or where the line under the mouse hits the back plane if none. | |
const Track::EditAssist::Dragable * | drag_object |
const Track::EditAssist::Selectable * | popup_object |
sigc::signal< void, boost::shared_ptr< Document::DocumentDelta > > | m_signal_command |
Signal emmited when a command is created through the user's interaction. | |
sigc::signal< void, boost::shared_ptr< Document::DocumentDelta > > | m_signal_preview_command |
Signal emmited when a command should be previewed. | |
sigc::signal< void > | m_signal_preview_cancel |
Signal emmited when a previewed command should be canceled. | |
Glib::RefPtr< Gtk::ActionGroup > | m_action_group |
Glib::RefPtr< Gtk::UIManager > | m_ui_manager |
Gtk::UIManager::ui_merge_id | m_menu_id |
Gtk::Menu * | m_popup_menu |
popup menu that contains the segments list. | |
Gtk::Menu * | m_empty_menu |
popup menu shown when an empty space is right clicked. | |
Gtk::Menu * | m_attachment_menu |
popup menu shown when an Track::TrackAttachment is right clicked. |
Definition at line 27 of file View.h.
enum View::ViewAngle |
View::View | ( | ) |
View::View | ( | View & | view | ) |
void View::draw_path | ( | const Track::Path & | path | ) | [protected] |
View::ViewAngle View::get_angle | ( | ) | const |
btVector3 View::get_centre | ( | ) | const |
float View::get_scale | ( | ) | const |
const Track::EditAssist::Selectable * View::get_selectable_under_mouse | ( | ) | [protected] |
btVector3 View::mouse_to_scene | ( | btScalar | x, | |
btScalar | y | |||
) | const [protected] |
bool View::on_button_press_event | ( | GdkEventButton * | event | ) | [protected, virtual] |
bool View::on_button_release_event | ( | GdkEventButton * | event | ) | [protected, virtual] |
bool View::on_configure_event | ( | GdkEventConfigure * | event | ) | [protected, virtual] |
bool View::on_expose_event | ( | GdkEventExpose * | event | ) | [protected, virtual] |
bool View::on_motion_notify_event | ( | GdkEventMotion * | event | ) | [protected, virtual] |
bool View::on_scroll_event | ( | GdkEventScroll * | event | ) | [protected, virtual] |
void View::recentre_view | ( | ) | [protected] |
void View::set_angle | ( | const ViewAngle | angle | ) |
void View::set_centre | ( | btVector3 | centre | ) |
void View::set_document | ( | Document::Document & | document | ) |
Set the document that the area is to represent.
The document must valid as long as the widget can be drawn. It may be switched to another one at any time, however.
This should be called before any draw events occur.
document | The document the view should draw and try to change if manipulated. |
void View::set_relative_depth | ( | btVector3 & | position, | |
btScalar | depth | |||
) | [protected] |
void View::set_scale | ( | const float | scale | ) |
void View::setup_ui | ( | ) | [protected] |
sigc::signal< void, boost::shared_ptr< Document::DocumentDelta > > View::signal_command | ( | ) |
Signal emmited when the user requests a change to the track by interacting with the view.
The singal should be wired to a function
void on_view_command(boost::shared_ptr<Document::DocumentDelta> delta)
sigc::signal< void > View::signal_preview_cancel | ( | ) |
Get signal emmited when the previewed command should be canceled.
This allows the document to be reset to how it was if the user did not want the command that was previewed. The signal should be connected to a function of the form:
void on_view_preview_cancel()
sigc::signal< void, boost::shared_ptr< Document::DocumentDelta > > View::signal_preview_command | ( | ) |
Signal emmited when during user interaction with the view.
The singal should be wired to a function
void on_view_preview_command(boost::shared_ptr<Document::DocumentDelta> delta)
btVector3 View::centre [protected] |
Document::Document* View::document [protected] |
const Track::EditAssist::Dragable* View::drag_object [protected] |
btScalar View::handle_length [protected] |
Glib::RefPtr<Gtk::ActionGroup> View::m_action_group [protected] |
Gtk::Menu* View::m_attachment_menu [protected] |
popup menu shown when an Track::TrackAttachment is right clicked.
Gtk::Menu* View::m_empty_menu [protected] |
Gtk::UIManager::ui_merge_id View::m_menu_id [protected] |
Gtk::Menu* View::m_popup_menu [protected] |
sigc::signal<void, boost::shared_ptr<Document::DocumentDelta> > View::m_signal_command [protected] |
sigc::signal<void> View::m_signal_preview_cancel [protected] |
sigc::signal<void, boost::shared_ptr<Document::DocumentDelta> > View::m_signal_preview_command [protected] |
Glib::RefPtr<Gtk::UIManager> View::m_ui_manager [protected] |
bool View::needs_recentre [protected] |
true if recentre_view() needs to be called during the next draw.
btVector3 View::new_position [protected] |
const Track::EditAssist::Selectable* View::popup_object [protected] |
float View::scale [protected] |
ViewAngle View::view_angle [protected] |
Generated at Mon Sep 6 00:41:16 2010 by Doxygen version 1.4.7 for Racer version svn335.