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:
GUICompleteSchemeStorage gSchemeStorage
void growWidth(SUMOReal by)
Increases the width of the boundary (x-axis)
bool myMoveOnClick
Information whether the user has moved the cursor while pressing a mouse button.
~GUIDanielPerspectiveChanger()
Destructor.
virtual void recenterView()
recenters the view
virtual SUMOReal zPos2Zoom(SUMOReal zPos) const
Returns the zoom level that is achieved at a given camera height.
void move(int xdiff, int ydiff)
void onRightBtnPress(void *data)
called when user press right button
SUMOReal getHeight() const
Returns the height of the boundary (y-axis)
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
virtual SUMOReal getXPos() const
Returns the x-offset of the field to show stored in this changer.
Position myZoomBase
the network location on which to zoom using right click+drag
SUMOReal ymin() const
Returns minimum y-coordinate.
virtual SUMOReal getRotation() const
Returns the rotation of the canvas stored in this changer.
void rotate(int diff)
Performs the rotation of the view.
virtual SUMOReal getYPos() const
Returns the y-offset of the field to show stored in this changer.
SUMOReal ymax() const
Returns maximum y-coordinate.
SUMOReal getWidth() const
Returns the width of the boudary (x-axis)
SUMOReal myOrigWidth
the original viewport dimensions in m which serve as the reference point for 100% zoom ...
void onLeftBtnPress(void *data)
mouse functions
A class that stores a 2D geometrical boundary.
SUMOReal xmin() const
Returns minimum x-coordinate.
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
SUMOReal p2m(SUMOReal pixel) const
pixels-to-meters conversion method
SUMOReal x() const
Returns the x-position.
void onMouseMove(void *data)
called when user moves mouse
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.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
Boundary myViewPort
the intended viewport
SUMOReal xmax() const
Returns maximum x-coordinate.
void add(SUMOReal x, SUMOReal y, SUMOReal z=0)
Makes the boundary include the given coordinate.
void setWindowCursorPosition(FXint x, FXint y)
Returns the information whether rotation is allowd.
virtual SUMOReal getZoom() const
Returns the zoom factor computed stored in this changer.
Position getCenter() const
Returns the center of the boundary.
virtual SUMOReal zoom2ZPos(SUMOReal zoom) const
Returns the camera height at which the given zoom level is reached.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
void updateToolTip()
A method that updates the tooltip.
void growHeight(SUMOReal by)
Increases the height of the boundary (y-axis)
FXint myMouseXPosition
the current mouse position
void showViewschemeEditor()
show viewsscheme editor
virtual SUMOReal getZPos() const
Returns the camera height corresponding to the current zoom factor.
SUMOReal y() const
Returns the y-position.
void moveby(SUMOReal x, SUMOReal y, SUMOReal z=0)
Moves the boundary by the given amount.
void changeCanvassLeft(int change)