SUMO - Simulation of Urban MObility
GUIPerspectiveChanger Class Reference

#include <GUIPerspectiveChanger.h>

Inheritance diagram for GUIPerspectiveChanger:
GUIDanielPerspectiveChanger

Public Types

enum  MouseState { MOUSEBTN_NONE = 0, MOUSEBTN_LEFT = 1, MOUSEBTN_RIGHT = 2, MOUSEBTN_MIDDLE = 4 }

Public Member Functions

virtual void centerTo (const Position &pos, SUMOReal radius, bool applyZoom=true)=0
 Centers the view to the given position, setting it to a size that covers the radius. Used for: Centering of vehicles and junctions.
virtual void changeCanvassLeft (int change)=0
FXint getMouseXPosition () const
 Returns the last mouse x-position an event occured at.
FXint getMouseYPosition () const
 Returns the last mouse y-position an event occured at.
virtual SUMOReal getRotation () const =0
 Returns the rotation of the canvas stored in this changer.
Boundary getViewport (bool fixRatio=true)
virtual SUMOReal getXPos () const =0
 Returns the x-offset of the field to show stored in this changer.
virtual SUMOReal getYPos () const =0
 Returns the y-offset of the field to show stored in this changer.
virtual SUMOReal getZoom () const =0
 Returns the zoom factor computed stored in this changer.
 GUIPerspectiveChanger (GUISUMOAbstractView &callBack, const Boundary &viewPort)
 Constructor.
virtual void onLeftBtnPress (void *data)
virtual bool onLeftBtnRelease (void *data)
virtual void onMouseMove (void *data)
virtual void onMouseWheel (void *data)
virtual void onRightBtnPress (void *data)
virtual bool onRightBtnRelease (void *data)
virtual void setViewport (SUMOReal zoom, SUMOReal xPos, SUMOReal yPos)=0
 Sets the viewport Used for: Adapting a new viewport.
void setViewport (const Boundary &viewPort)
virtual ~GUIPerspectiveChanger ()
 Destructor.

Protected Attributes

GUISUMOAbstractViewmyCallback
 The parent window (canvas to scale)
FXint myMouseXPosition
 the current mouse position
FXint myMouseYPosition
Boundary myViewPort
 the intended viewport

Private Member Functions

Boundary patchedViewPort ()

Detailed Description

This is the interface for implementation of own classes that handle the interaction between the user and a display field. While most of our (IVF) interfaces allow zooming by choosing the rectangle to show, other types of interaction are possible and have been implemented. To differ between the behaviours, all types of interaction between the user and the canvas are send to this class: mouse moving, mouse button pressing and releasing.

Definition at line 60 of file GUIPerspectiveChanger.h.


Member Enumeration Documentation

Enumerator:
MOUSEBTN_NONE 
MOUSEBTN_LEFT 
MOUSEBTN_RIGHT 
MOUSEBTN_MIDDLE 

Definition at line 62 of file GUIPerspectiveChanger.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 44 of file GUIPerspectiveChanger.cpp.

Destructor.

Definition at line 51 of file GUIPerspectiveChanger.cpp.


Member Function Documentation

virtual void GUIPerspectiveChanger::centerTo ( const Position pos,
SUMOReal  radius,
bool  applyZoom = true 
) [pure virtual]

Centers the view to the given position, setting it to a size that covers the radius. Used for: Centering of vehicles and junctions.

Implemented in GUIDanielPerspectiveChanger.

Referenced by GUISUMOAbstractView::centerTo().

virtual void GUIPerspectiveChanger::changeCanvassLeft ( int  change) [pure virtual]

Implemented in GUIDanielPerspectiveChanger.

Returns the last mouse x-position an event occured at.

Definition at line 83 of file GUIPerspectiveChanger.cpp.

References myMouseXPosition.

Returns the last mouse y-position an event occured at.

Definition at line 89 of file GUIPerspectiveChanger.cpp.

References myMouseYPosition.

virtual SUMOReal GUIPerspectiveChanger::getRotation ( ) const [pure virtual]

Returns the rotation of the canvas stored in this changer.

Implemented in GUIDanielPerspectiveChanger.

void GUIPerspectiveChanger::onLeftBtnPress ( void *  data) [virtual]

Reimplemented in GUIDanielPerspectiveChanger.

Definition at line 55 of file GUIPerspectiveChanger.cpp.

Referenced by GUISUMOAbstractView::onLeftBtnPress().

bool GUIPerspectiveChanger::onLeftBtnRelease ( void *  data) [virtual]

Reimplemented in GUIDanielPerspectiveChanger.

Definition at line 59 of file GUIPerspectiveChanger.cpp.

Referenced by GUISUMOAbstractView::onLeftBtnRelease().

void GUIPerspectiveChanger::onMouseMove ( void *  data) [virtual]

Reimplemented in GUIDanielPerspectiveChanger.

Definition at line 79 of file GUIPerspectiveChanger.cpp.

Referenced by GUISUMOAbstractView::onMouseMove().

void GUIPerspectiveChanger::onMouseWheel ( void *  data) [virtual]

Reimplemented in GUIDanielPerspectiveChanger.

Definition at line 75 of file GUIPerspectiveChanger.cpp.

Referenced by GUISUMOAbstractView::onMouseWheel().

void GUIPerspectiveChanger::onRightBtnPress ( void *  data) [virtual]

Reimplemented in GUIDanielPerspectiveChanger.

Definition at line 65 of file GUIPerspectiveChanger.cpp.

Referenced by GUISUMOAbstractView::onRightBtnPress().

virtual void GUIPerspectiveChanger::setViewport ( SUMOReal  zoom,
SUMOReal  xPos,
SUMOReal  yPos 
) [pure virtual]
void GUIPerspectiveChanger::setViewport ( const Boundary viewPort) [inline]

Definition at line 127 of file GUIPerspectiveChanger.h.

References myViewPort.


Field Documentation


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines