SUMO - Simulation of Urban MObility
|
#include <GUIPerspectiveChanger.h>
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 | |
GUISUMOAbstractView & | myCallback |
The parent window (canvas to scale) | |
FXint | myMouseXPosition |
the current mouse position | |
FXint | myMouseYPosition |
Boundary | myViewPort |
the intended viewport |
Private Member Functions | |
GUIPerspectiveChanger (const GUIPerspectiveChanger &) | |
Invalidated copy constructor. | |
GUIPerspectiveChanger & | operator= (const GUIPerspectiveChanger &) |
Invalidated assignment operator. | |
Boundary | patchedViewPort () |
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.
Definition at line 62 of file GUIPerspectiveChanger.h.
GUIPerspectiveChanger::GUIPerspectiveChanger | ( | GUISUMOAbstractView & | callBack, |
const Boundary & | viewPort | ||
) |
Constructor.
Definition at line 44 of file GUIPerspectiveChanger.cpp.
|
virtual |
Destructor.
Definition at line 51 of file GUIPerspectiveChanger.cpp.
|
private |
Invalidated copy constructor.
|
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().
|
pure virtual |
Implemented in GUIDanielPerspectiveChanger.
FXint GUIPerspectiveChanger::getMouseXPosition | ( | ) | const |
Returns the last mouse x-position an event occured at.
Definition at line 83 of file GUIPerspectiveChanger.cpp.
References myMouseXPosition.
FXint GUIPerspectiveChanger::getMouseYPosition | ( | ) | const |
Returns the last mouse y-position an event occured at.
Definition at line 89 of file GUIPerspectiveChanger.cpp.
References myMouseYPosition.
|
pure virtual |
Returns the rotation of the canvas stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Definition at line 118 of file GUIPerspectiveChanger.h.
References myViewPort, and patchedViewPort().
Referenced by GUISUMOAbstractView::applyGLTransform(), GUISUMOAbstractView::getObjectsInBoundary(), GUISUMOAbstractView::getPositionInformation(), GUISUMOAbstractView::getVisibleBoundary(), GUISUMOAbstractView::m2p(), GUISUMOAbstractView::makeSnapshot(), GUISUMOAbstractView::p2m(), and GUISUMOAbstractView::paintGL().
|
pure virtual |
Returns the x-offset of the field to show stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::onMouseMove(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_GUI::processSet(), GUISUMOAbstractView::showViewportEditor(), and GUISUMOAbstractView::~GUISUMOAbstractView().
|
pure virtual |
Returns the y-offset of the field to show stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::onMouseMove(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_GUI::processSet(), GUISUMOAbstractView::showViewportEditor(), and GUISUMOAbstractView::~GUISUMOAbstractView().
|
pure virtual |
Returns the zoom factor computed stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::onMouseMove(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_GUI::processSet(), GUISUMOAbstractView::showViewportEditor(), and GUISUMOAbstractView::~GUISUMOAbstractView().
|
virtual |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 55 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onLeftBtnPress().
|
virtual |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 59 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onLeftBtnRelease().
|
virtual |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 79 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onMouseMove().
|
virtual |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 75 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onMouseWheel().
|
virtual |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 65 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onRightBtnPress().
|
virtual |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 69 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onRightBtnRelease(), and GUISUMOAbstractView::openObjectDialog().
|
private |
Invalidated assignment operator.
|
private |
Definition at line 95 of file GUIPerspectiveChanger.cpp.
References Boundary::getHeight(), Boundary::getWidth(), Boundary::growHeight(), Boundary::growWidth(), myCallback, myViewPort, and SUMOReal.
Referenced by getViewport().
|
pure virtual |
Sets the viewport Used for: Adapting a new viewport.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::centerTo(), GUISUMOAbstractView::getObjectsInBoundary(), GUISUMOAbstractView::recenterView(), and GUISUMOAbstractView::setViewport().
|
inline |
Definition at line 127 of file GUIPerspectiveChanger.h.
References myViewPort.
|
protected |
The parent window (canvas to scale)
Definition at line 134 of file GUIPerspectiveChanger.h.
Referenced by GUIDanielPerspectiveChanger::changeCanvassLeft(), GUIDanielPerspectiveChanger::move(), GUIDanielPerspectiveChanger::onMouseMove(), GUIDanielPerspectiveChanger::onMouseWheel(), GUIDanielPerspectiveChanger::onRightBtnPress(), patchedViewPort(), GUIDanielPerspectiveChanger::setViewport(), and GUIDanielPerspectiveChanger::zoom().
|
protected |
the current mouse position
Definition at line 137 of file GUIPerspectiveChanger.h.
Referenced by getMouseXPosition(), GUIDanielPerspectiveChanger::onLeftBtnPress(), GUIDanielPerspectiveChanger::onLeftBtnRelease(), GUIDanielPerspectiveChanger::onMouseMove(), GUIDanielPerspectiveChanger::onRightBtnPress(), and GUIDanielPerspectiveChanger::onRightBtnRelease().
|
protected |
Definition at line 137 of file GUIPerspectiveChanger.h.
Referenced by getMouseYPosition(), GUIDanielPerspectiveChanger::onLeftBtnPress(), GUIDanielPerspectiveChanger::onLeftBtnRelease(), GUIDanielPerspectiveChanger::onMouseMove(), GUIDanielPerspectiveChanger::onRightBtnPress(), and GUIDanielPerspectiveChanger::onRightBtnRelease().
|
protected |
the intended viewport
Definition at line 140 of file GUIPerspectiveChanger.h.
Referenced by GUIDanielPerspectiveChanger::centerTo(), GUIDanielPerspectiveChanger::changeCanvassLeft(), getViewport(), GUIDanielPerspectiveChanger::getXPos(), GUIDanielPerspectiveChanger::getYPos(), GUIDanielPerspectiveChanger::getZoom(), GUIDanielPerspectiveChanger::move(), patchedViewPort(), GUIDanielPerspectiveChanger::setViewport(), setViewport(), and GUIDanielPerspectiveChanger::zoom().