#include <GUIPerspectiveChanger.h>

Definition at line 57 of file GUIPerspectiveChanger.h.
Public Types | |
| enum | MouseState { MOUSEBTN_NONE = 0, MOUSEBTN_LEFT = 1, MOUSEBTN_RIGHT = 2, MOUSEBTN_MIDDLE = 4 } |
Public Member Functions | |
| void | applyCanvasSize (size_t width, size_t height) |
| Informs the changer aboud the size of the canvas. | |
| virtual void | centerTo (const Boundary &netBoundary, Boundary bound, bool applyZoom=true)=0 |
| Centers the view to show the given boundary Used for: Centering of lanes. | |
| virtual void | centerTo (const Boundary &netBoundary, const Position2D &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. | |
| 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. | |
| 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) | |
| 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 | recenterView ()=0 |
| recenters the view to display the whole network | |
| void | setNetSizes (size_t width, size_t height) |
| Sets the sizes of the network. | |
| virtual void | setViewport (SUMOReal zoom, SUMOReal xPos, SUMOReal yPos)=0 |
| Sets the viewport Used for: Adapting a new viewport. | |
| virtual | ~GUIPerspectiveChanger () |
| Destructor. | |
Protected Attributes | |
| GUISUMOAbstractView & | myCallback |
| The parent window (canvas to scale). | |
| size_t | myCanvasHeight |
| size_t | myCanvasWidth |
| The sizes of the canvas. | |
| FXint | myMouseXPosition |
| the current mouse position | |
| FXint | myMouseYPosition |
| size_t | myNetHeight |
| size_t | myNetWidth |
| The sizes of the network. | |
Definition at line 59 of file GUIPerspectiveChanger.h.
00059 { 00060 MOUSEBTN_NONE = 0, 00061 MOUSEBTN_LEFT = 1, 00062 MOUSEBTN_RIGHT = 2, 00063 MOUSEBTN_MIDDLE = 4 00064 };
| GUIPerspectiveChanger::GUIPerspectiveChanger | ( | GUISUMOAbstractView & | callBack | ) |
Constructor.
Definition at line 41 of file GUIPerspectiveChanger.cpp.
00042 : myCallback(callBack) {}
| GUIPerspectiveChanger::~GUIPerspectiveChanger | ( | ) | [virtual] |
Informs the changer aboud the size of the canvas.
Definition at line 56 of file GUIPerspectiveChanger.cpp.
References myCanvasHeight, and myCanvasWidth.
Referenced by GUISUMOAbstractView::onConfigure().
00056 { 00057 myCanvasWidth = width; 00058 myCanvasHeight = height; 00059 }
| virtual void GUIPerspectiveChanger::centerTo | ( | const Boundary & | netBoundary, | |
| Boundary | bound, | |||
| bool | applyZoom = true | |||
| ) | [pure virtual] |
Centers the view to show the given boundary Used for: Centering of lanes.
Implemented in GUIDanielPerspectiveChanger.
| virtual void GUIPerspectiveChanger::centerTo | ( | const Boundary & | netBoundary, | |
| const Position2D & | 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(), and GUISUMOAbstractView::paintGL().
| FXint GUIPerspectiveChanger::getMouseXPosition | ( | ) | const |
Returns the last mouse x-position an event occured at.
Definition at line 91 of file GUIPerspectiveChanger.cpp.
References myMouseXPosition.
00091 { 00092 return myMouseXPosition; 00093 }
| FXint GUIPerspectiveChanger::getMouseYPosition | ( | ) | const |
Returns the last mouse y-position an event occured at.
Definition at line 97 of file GUIPerspectiveChanger.cpp.
References myMouseYPosition.
00097 { 00098 return myMouseYPosition; 00099 }
| virtual SUMOReal GUIPerspectiveChanger::getRotation | ( | ) | const [pure virtual] |
Returns the rotation of the canvas stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::applyChanges().
| virtual SUMOReal GUIPerspectiveChanger::getXPos | ( | ) | const [pure virtual] |
Returns the x-offset of the field to show stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::applyChanges(), GUISUMOAbstractView::getPositionInformation(), GUISUMOAbstractView::onMouseMove(), GUISUMOAbstractView::showViewportEditor(), and GUISUMOAbstractView::~GUISUMOAbstractView().
| virtual SUMOReal GUIPerspectiveChanger::getYPos | ( | ) | const [pure virtual] |
Returns the y-offset of the field to show stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::applyChanges(), GUISUMOAbstractView::getPositionInformation(), GUISUMOAbstractView::onMouseMove(), GUISUMOAbstractView::showViewportEditor(), and GUISUMOAbstractView::~GUISUMOAbstractView().
| virtual SUMOReal GUIPerspectiveChanger::getZoom | ( | ) | const [pure virtual] |
Returns the zoom factor computed stored in this changer.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::applyChanges(), GUISUMOAbstractView::getPositionInformation(), GUISUMOAbstractView::m2p(), GUISUMOAbstractView::onMouseMove(), GUISUMOAbstractView::p2m(), GUISUMOAbstractView::showViewportEditor(), and GUISUMOAbstractView::~GUISUMOAbstractView().
| void GUIPerspectiveChanger::onLeftBtnPress | ( | void * | data | ) | [virtual] |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 63 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onLeftBtnPress().
| bool GUIPerspectiveChanger::onLeftBtnRelease | ( | void * | data | ) | [virtual] |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 67 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onLeftBtnRelease().
| void GUIPerspectiveChanger::onMouseMove | ( | void * | data | ) | [virtual] |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 87 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onMouseMove().
| void GUIPerspectiveChanger::onMouseWheel | ( | void * | data | ) | [virtual] |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 83 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onMouseWheel().
| void GUIPerspectiveChanger::onRightBtnPress | ( | void * | data | ) | [virtual] |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 73 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onRightBtnPress().
| bool GUIPerspectiveChanger::onRightBtnRelease | ( | void * | data | ) | [virtual] |
Reimplemented in GUIDanielPerspectiveChanger.
Definition at line 77 of file GUIPerspectiveChanger.cpp.
Referenced by GUISUMOAbstractView::onRightBtnRelease(), and GUISUMOAbstractView::openObjectDialog().
| virtual void GUIPerspectiveChanger::recenterView | ( | ) | [pure virtual] |
recenters the view to display the whole network
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::recenterView().
Sets the sizes of the network.
Definition at line 49 of file GUIPerspectiveChanger.cpp.
References myNetHeight, and myNetWidth.
00049 { 00050 myNetWidth = width; 00051 myNetHeight = height; 00052 }
| virtual void GUIPerspectiveChanger::setViewport | ( | SUMOReal | zoom, | |
| SUMOReal | xPos, | |||
| SUMOReal | yPos | |||
| ) | [pure virtual] |
Sets the viewport Used for: Adapting a new viewport.
Implemented in GUIDanielPerspectiveChanger.
Referenced by GUISUMOAbstractView::setViewport().
GUISUMOAbstractView& GUIPerspectiveChanger::myCallback [protected] |
The parent window (canvas to scale).
Definition at line 123 of file GUIPerspectiveChanger.h.
Referenced by GUIDanielPerspectiveChanger::move(), GUIDanielPerspectiveChanger::onMouseMove(), GUIDanielPerspectiveChanger::onMouseWheel(), GUIDanielPerspectiveChanger::rotate(), and GUIDanielPerspectiveChanger::zoom().
size_t GUIPerspectiveChanger::myCanvasHeight [protected] |
size_t GUIPerspectiveChanger::myCanvasWidth [protected] |
The sizes of the canvas.
Definition at line 129 of file GUIPerspectiveChanger.h.
Referenced by applyCanvasSize().
FXint GUIPerspectiveChanger::myMouseXPosition [protected] |
the current mouse position
Definition at line 132 of file GUIPerspectiveChanger.h.
Referenced by getMouseXPosition(), GUIDanielPerspectiveChanger::onLeftBtnPress(), GUIDanielPerspectiveChanger::onLeftBtnRelease(), GUIDanielPerspectiveChanger::onMouseMove(), GUIDanielPerspectiveChanger::onRightBtnPress(), and GUIDanielPerspectiveChanger::onRightBtnRelease().
FXint GUIPerspectiveChanger::myMouseYPosition [protected] |
Definition at line 132 of file GUIPerspectiveChanger.h.
Referenced by getMouseYPosition(), GUIDanielPerspectiveChanger::onLeftBtnPress(), GUIDanielPerspectiveChanger::onLeftBtnRelease(), GUIDanielPerspectiveChanger::onMouseMove(), GUIDanielPerspectiveChanger::onRightBtnPress(), and GUIDanielPerspectiveChanger::onRightBtnRelease().
size_t GUIPerspectiveChanger::myNetHeight [protected] |
size_t GUIPerspectiveChanger::myNetWidth [protected] |
The sizes of the network.
Definition at line 126 of file GUIPerspectiveChanger.h.
Referenced by setNetSizes().
1.5.6