85 void setViewport(
double zoom,
double xPos,
double yPos);
A class that stores a 2D geometrical boundary.
void setRotation(double rotation)
Sets the rotation.
double getYPos() const
Returns the y-offset of the field to show stored in this changer.
void updateViewport()
update the min/max coordinates of the view on the ground plane after changing the camera pos / direct...
void setViewportFrom(double xPos, double yPos, double zPos)
Alternative method for setting the viewport.
double getRotation() const
Returns the rotation of the canvas stored in this changer.
osg::Vec3d getPositionOnGround(double x, double y)
calculate the position on the ground (in world coordinates) given a normalised view coordinate (x,...
double getZPos() const
Returns the camera height corresponding to the current zoom factor.
double getXPos() const
Returns the x-offset of the field to show stored in this changer.
~GUIOSGPerspectiveChanger()
Destructor.
bool onMiddleBtnRelease(void *data)
called when user releases middle button
double zPos2Zoom(double zPos) const
Returns the zoom level that is achieved at a given camera height.
double myOrigWidth
the original viewport dimensions in m which serve as the reference point for 100% zoom
bool onRightBtnRelease(void *data)
called when user releases right button
double zoom2ZPos(double zoom) const
Returns the camera height at which the given zoom level is reached.
osg::ref_ptr< osgGA::TerrainManipulator > myCameraManipulator
the OSG camera structure to gather the view coordinates
double myRotation
the current rotation
GUIOSGPerspectiveChanger(const GUIOSGPerspectiveChanger &)
Invalidated copy constructor.
void centerTo(const Position &pos, double radius, bool applyZoom=true)
Centers the view to the given position, setting it to a size that covers the radius....
void changeCanvasSizeLeft(int change)
bool onLeftBtnRelease(void *data)
mouse functions
GUIOSGPerspectiveChanger & operator=(const GUIOSGPerspectiveChanger &)
Invalidated assignment operator.
void setViewport(double zoom, double xPos, double yPos)
Sets the viewport Used for: Adapting a new viewport.
double getZoom() const
Returns the zoom factor computed stored in this changer.
void onMouseMove(void *data)
called when user moves mouse
A point in 2D or 3D with translation and scaling methods.