33 myViewPort(viewPort) {
151 if (ratio < canvasRatio) {
A class that stores a 2D geometrical boundary.
void growHeight(double by)
Increases the height of the boundary (y-axis)
double getHeight() const
Returns the height of the boundary (y-axis)
double getWidth() const
Returns the width of the boudary (x-axis)
void growWidth(double by)
Increases the width of the boundary (x-axis)
GUISUMOAbstractView & myCallback
The parent window (canvas to scale)
virtual long onKeyPress(void *data)
called when user press a key
virtual void onRightBtnPress(void *data)
called when user press right button
virtual ~GUIPerspectiveChanger()
Destructor.
virtual bool onLeftBtnRelease(void *data)
called when user releases left button
Boundary myViewPort
the intended viewport
GUIPerspectiveChanger(GUISUMOAbstractView &callBack, const Boundary &viewPort)
Constructor.
virtual void onLeftBtnPress(void *data)
mouse functions
FXint getMouseXPosition() const
Returns the last mouse x-position an event occurred at.
virtual bool onMiddleBtnRelease(void *data)
called when user releases middle button
virtual void onDoubleClicked(void *data)
called when user click two times
virtual void onMiddleBtnPress(void *data)
called when user press middle button
FXint getMouseYPosition() const
Returns the last mouse y-position an event occurred at.
virtual long onKeyRelease(void *data)
called when user releases a key
Boundary patchedViewPort()
patched viewPort with the same aspect ratio as the canvas
FXint myMouseXPosition
the current mouse position
virtual void onMouseMove(void *data)
called when user moves mouse
virtual void onMouseWheel(void *data)
called when user changes mouse wheel
virtual bool onRightBtnRelease(void *data)
called when user releases right button
Boundary getViewport(bool fixRatio=true)
get viewport
virtual void setViewport(double zoom, double xPos, double yPos)=0
Sets the viewport Used for: Adapting a new viewport.