cheshirekow  v0.1.0
mpblocks::gtk::PanZoomView Class Reference

A drawing area with built in mouse handlers for pan-zoom control. More...

#include <mpblocks/gtk/pan_zoom_view.h>

Inheritance diagram for mpblocks::gtk::PanZoomView:

Public Member Functions

double GetMaxDim ()
 return the maximum dimension of the More...
 
Eigen::Vector2d GetOffset ()
 
double GetScale ()
 
double GetScaleRate ()
 
virtual bool on_button_press_event (GdkEventButton *event)
 
virtual bool on_draw (const Cairo::RefPtr< Cairo::Context > &ctx)
 
virtual bool on_motion_notify_event (GdkEventMotion *event)
 
virtual bool on_scroll_event (GdkEventScroll *event)
 
 PanZoomView ()
 
Eigen::Vector2d RawPoint (double x, double y)
 Convert the point (x,y) in GTK coordinates, with the origin at the top left, to a point in traditional cartesian coordinates, where the origin is at the bottom left. More...
 
void SetOffset (const Eigen::Vector2d &offset)
 
void SetOffsetAdjustments (Glib::RefPtr< Gtk::Adjustment > offset_x, Glib::RefPtr< Gtk::Adjustment > offset_y)
 
void SetScale (double scale)
 
void SetScaleAdjustments (Glib::RefPtr< Gtk::Adjustment > scale, Glib::RefPtr< Gtk::Adjustment > scale_rate)
 
void SetScaleRate (double scale_rate)
 
template<typename Event >
void TransformEvent (Event *event)
 
Eigen::Vector2d TransformPoint (double x, double y)
 Return a point in the virtual cartesian plane by applying the offset and scaling of the viewport. More...
 

Public Attributes

sigc::signal< void,
GdkEventButton * > 
sig_button
 button event with transformed coordinates More...
 
sigc::signal< void, const
Cairo::RefPtr< Cairo::Context > & > 
sig_draw
 Signal is emitted by the on_draw handler, and sends out the context with appropriate scaling and. More...
 
sigc::signal< void,
GdkEventMotion * > 
sig_motion
 motion event with transformed coordinates More...
 

Private Attributes

bool active_
 If true, controls are enabled, if false, controls are disabled and events are passed through. More...
 
Eigen::Vector2d last_pos_
 The last mouse position (used during pan) More...
 
Glib::RefPtr< Gtk::Adjustment > offset_x_
 offset of viewport More...
 
Glib::RefPtr< Gtk::Adjustment > offset_y_
 offset of viewport More...
 
int pan_button_
 Which mouse button is used for pan. More...
 
guint pan_button_mask_
 
Glib::RefPtr< Gtk::Adjustment > scale_
 Size (in virtual units) of the largest dimension of the widget. More...
 
Glib::RefPtr< Gtk::Adjustment > scale_rate_
 When the mouse wheel is turned multiply or divide the scale by this much. More...
 

Detailed Description

A drawing area with built in mouse handlers for pan-zoom control.

Definition at line 36 of file pan_zoom_view.h.

Constructor & Destructor Documentation

mpblocks::gtk::PanZoomView::PanZoomView ( )
inline

Definition at line 70 of file pan_zoom_view.h.

Member Function Documentation

double mpblocks::gtk::PanZoomView::GetMaxDim ( )
inline

return the maximum dimension of the

Definition at line 135 of file pan_zoom_view.h.

Eigen::Vector2d mpblocks::gtk::PanZoomView::GetOffset ( )
inline

Definition at line 110 of file pan_zoom_view.h.

double mpblocks::gtk::PanZoomView::GetScale ( )
inline

Definition at line 122 of file pan_zoom_view.h.

double mpblocks::gtk::PanZoomView::GetScaleRate ( )
inline

Definition at line 130 of file pan_zoom_view.h.

virtual bool mpblocks::gtk::PanZoomView::on_button_press_event ( GdkEventButton *  event)
inlinevirtual

Definition at line 177 of file pan_zoom_view.h.

virtual bool mpblocks::gtk::PanZoomView::on_draw ( const Cairo::RefPtr< Cairo::Context > &  ctx)
inlinevirtual

Definition at line 216 of file pan_zoom_view.h.

virtual bool mpblocks::gtk::PanZoomView::on_motion_notify_event ( GdkEventMotion *  event)
inlinevirtual

Definition at line 159 of file pan_zoom_view.h.

virtual bool mpblocks::gtk::PanZoomView::on_scroll_event ( GdkEventScroll *  event)
inlinevirtual

Definition at line 189 of file pan_zoom_view.h.

Eigen::Vector2d mpblocks::gtk::PanZoomView::RawPoint ( double  x,
double  y 
)
inline

Convert the point (x,y) in GTK coordinates, with the origin at the top left, to a point in traditional cartesian coordinates, where the origin is at the bottom left.

Definition at line 142 of file pan_zoom_view.h.

void mpblocks::gtk::PanZoomView::SetOffset ( const Eigen::Vector2d &  offset)
inline

Definition at line 101 of file pan_zoom_view.h.

void mpblocks::gtk::PanZoomView::SetOffsetAdjustments ( Glib::RefPtr< Gtk::Adjustment >  offset_x,
Glib::RefPtr< Gtk::Adjustment >  offset_y 
)
inline

Definition at line 83 of file pan_zoom_view.h.

void mpblocks::gtk::PanZoomView::SetScale ( double  scale)
inline

Definition at line 116 of file pan_zoom_view.h.

void mpblocks::gtk::PanZoomView::SetScaleAdjustments ( Glib::RefPtr< Gtk::Adjustment >  scale,
Glib::RefPtr< Gtk::Adjustment >  scale_rate 
)
inline

Definition at line 93 of file pan_zoom_view.h.

void mpblocks::gtk::PanZoomView::SetScaleRate ( double  scale_rate)
inline

Definition at line 124 of file pan_zoom_view.h.

template<typename Event >
void mpblocks::gtk::PanZoomView::TransformEvent ( Event *  event)
inline

Definition at line 153 of file pan_zoom_view.h.

Eigen::Vector2d mpblocks::gtk::PanZoomView::TransformPoint ( double  x,
double  y 
)
inline

Return a point in the virtual cartesian plane by applying the offset and scaling of the viewport.

Definition at line 148 of file pan_zoom_view.h.

Member Data Documentation

bool mpblocks::gtk::PanZoomView::active_
private

If true, controls are enabled, if false, controls are disabled and events are passed through.

Definition at line 53 of file pan_zoom_view.h.

Eigen::Vector2d mpblocks::gtk::PanZoomView::last_pos_
private

The last mouse position (used during pan)

Definition at line 49 of file pan_zoom_view.h.

Glib::RefPtr<Gtk::Adjustment> mpblocks::gtk::PanZoomView::offset_x_
private

offset of viewport

Definition at line 38 of file pan_zoom_view.h.

Glib::RefPtr<Gtk::Adjustment> mpblocks::gtk::PanZoomView::offset_y_
private

offset of viewport

Definition at line 39 of file pan_zoom_view.h.

int mpblocks::gtk::PanZoomView::pan_button_
private

Which mouse button is used for pan.

Definition at line 56 of file pan_zoom_view.h.

guint mpblocks::gtk::PanZoomView::pan_button_mask_
private

Definition at line 57 of file pan_zoom_view.h.

Glib::RefPtr<Gtk::Adjustment> mpblocks::gtk::PanZoomView::scale_
private

Size (in virtual units) of the largest dimension of the widget.

Definition at line 42 of file pan_zoom_view.h.

Glib::RefPtr<Gtk::Adjustment> mpblocks::gtk::PanZoomView::scale_rate_
private

When the mouse wheel is turned multiply or divide the scale by this much.

Definition at line 46 of file pan_zoom_view.h.

sigc::signal<void, GdkEventButton*> mpblocks::gtk::PanZoomView::sig_button

button event with transformed coordinates

Definition at line 68 of file pan_zoom_view.h.

sigc::signal<void, const Cairo::RefPtr<Cairo::Context>&> mpblocks::gtk::PanZoomView::sig_draw

Signal is emitted by the on_draw handler, and sends out the context with appropriate scaling and.

Definition at line 62 of file pan_zoom_view.h.

sigc::signal<void, GdkEventMotion*> mpblocks::gtk::PanZoomView::sig_motion

motion event with transformed coordinates

Definition at line 65 of file pan_zoom_view.h.


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