40 #ifdef CHECK_MEMORY_LEAKS 42 #endif // CHECK_MEMORY_LEAKS 51 myOrigWidth(viewPort.getWidth()),
52 myOrigHeight(viewPort.getHeight()),
54 myMouseButtonState(MOUSEBTN_NONE),
56 myZoomBase(viewPort.getCenter()),
73 if (
myCallback.getApp()->reg().readIntEntry(
"gui",
"zoomAtCenter", 1)) {
156 FXEvent* e = (FXEvent*) data;
167 FXEvent* e = (FXEvent*) data;
177 FXEvent* e = (FXEvent*) data;
190 FXEvent* e = (FXEvent*) data;
200 FXEvent* e = (FXEvent*) data;
202 if ((e->state & CONTROLMASK) != 0) {
204 }
else if ((e->state & SHIFTMASK) != 0) {
218 FXEvent* e = (FXEvent*) data;
222 const bool moved = xdiff != 0 || ydiff != 0;
256 const SUMOReal zoomFactor = zoom / 50;
283 FXEvent* e = (FXEvent*) data;
288 bool pageVertical =
true;
290 if (e->state & CONTROLMASK) {
294 }
else if (e->state & SHIFTMASK) {
295 pageVertical =
false;
315 case FX::KEY_Page_Up:
322 case FX::KEY_Page_Down:
332 zoom(1.0 + zoomDiff);
336 case FX::KEY_KP_Subtract:
337 zoomDiff = -zoomDiff;
339 zoom(1.0 + zoomDiff);
343 case FX::KEY_KP_Home:
SUMOReal getHeight() const
Returns the height of the boundary.
GUICompleteSchemeStorage gSchemeStorage
void growWidth(SUMOReal by)
SUMOReal getWidth() const
Returns the width of the boudary.
bool myMoveOnClick
Information whether the user has moved the cursor while pressing a mouse button.
Position getCenter() const
Returns the center of the boundary.
~GUIDanielPerspectiveChanger()
Destructor.
virtual void recenterView()
recenters the view
void move(int xdiff, int ydiff)
void onRightBtnPress(void *data)
called when user press right button
bool onLeftBtnRelease(void *data)
called when user releases left button
long onKeyPress(void *data)
called when user press a key
bool gaming
whether the application is in gaming mode or not
SUMOReal ymin() const
Returns minimum y-coordinate.
Position myZoomBase
the network location on which to zoom using right click+drag
SUMOReal xmin() const
Returns minimum x-coordinate.
SUMOReal p2m(SUMOReal pixel) const
pixels-to-meters conversion method
virtual SUMOReal getRotation() const
Returns the rotation of the canvas stored in this changer.
void rotate(int diff)
Performs the rotation of the view.
SUMOReal x() const
Returns the x-position.
SUMOReal myOrigWidth
the original viewport dimensions in m which serve as the reference point for 100% zoom ...
void onLeftBtnPress(void *data)
mouse functions
virtual SUMOReal getXPos() const
Returns the x-offset of the field to show stored in this changer.
SUMOReal xmax() const
Returns maximum x-coordinate.
A class that stores a 2D geometrical boundary.
void onMouseWheel(void *data)
called when user changes mouse wheel
bool onRightBtnRelease(void *data)
called when user releases right button
GUIDanielPerspectiveChanger(GUISUMOAbstractView &callBack, const Boundary &viewPort)
FXTime myDragDelay
avoid flicker
A point in 2D or 3D with translation and scaling methods.
void centerTo(const Position &pos, SUMOReal radius, bool applyZoom=true)
Centers the view to the given position, setting it to a size that covers the radius.
int myMouseButtonState
the current mouse state
void onMouseMove(void *data)
called when user moves mouse
virtual SUMOReal getZPos() const
Returns the camera height corresponding to the current zoom factor.
virtual SUMOReal zoom2ZPos(SUMOReal zoom) const
Returns the camera height at which the given zoom level is reached.
virtual SUMOReal zPos2Zoom(SUMOReal zPos) const
Returns the zoom level that is achieved at a given camera height.
GUISUMOAbstractView & myCallback
The parent window (canvas to scale)
void zoom(SUMOReal factor)
Performs the zooming of the view.
SUMOReal myRotation
the current rotation
void setViewport(SUMOReal zoom, SUMOReal xPos, SUMOReal yPos)
Sets the viewport.
void setViewportFrom(SUMOReal xPos, SUMOReal yPos, SUMOReal zPos)
Alternative method for setting the viewport.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
Boundary myViewPort
the intended viewport
SUMOReal y() const
Returns the y-position.
void setWindowCursorPosition(FXint x, FXint y)
Returns the information whether rotation is allowd.
virtual SUMOReal getYPos() const
Returns the y-offset of the field to show stored in this changer.
void updateToolTip()
A method that updates the tooltip.
SUMOReal ymax() const
Returns maximum y-coordinate.
void growHeight(SUMOReal by)
FXint myMouseXPosition
the current mouse position
void moveby(SUMOReal x, SUMOReal y)
Moves the boundary by the given amount.
void showViewschemeEditor()
show viewsscheme editor
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual SUMOReal getZoom() const
Returns the zoom factor computed stored in this changer.
void changeCanvassLeft(int change)