Handles coordinaive transforation between grids (based on real-world metric coordinates).
More...
|
| Viewport () |
|
| Viewport (const QRectF worldrect, const QRect screenrect) |
|
const QPointF | toWorld (const QPoint pixel) |
| toWorld() converts the pixel-information (e.g. by an mouse event) to the corresponding real world coordinates (defined by viewport). More...
|
|
const QPoint | toScreen (const QPointF p) |
| toScreen() converts world coordinates in screen coordinates using the defined viewport. More...
|
|
const QRect | toScreen (const QRectF world) |
|
const QRectF | viewRect () const |
|
bool | isVisible (const QPointF &world_coord) const |
|
bool | isVisible (const QRectF &world_rect) const |
|
void | zoomToAll () |
| show the full extent of the world. More...
|
|
void | zoomTo (const QPoint &screen_point, const double factor) |
| zoom using a factor of factor . More...
|
|
void | moveTo (const QPoint &screen_from, const QPoint &screen_to) |
| move the viewport. screen_from and screen_to give mouse positions (in pixel) from dragging the mouse. More...
|
|
void | setViewPoint (const QPointF &world_center, const double px_per_meter) |
| set 'world_center' as the new center point of the viewport More...
|
|
double | pixelToMeter (const int pixel) |
|
int | meterToPixel (const double meter) |
|
void | setViewRect (const QRectF &viewrect) |
|
void | setWorldRect (const QRectF &worldrect) |
|
void | setScreenRect (const QRect &viewrect) |
| sets the screen rect; this also modifies the viewport. More...
|
|
Handles coordinaive transforation between grids (based on real-world metric coordinates).
The visible part of the grid is defined by the "viewport" (defaults to 100% of the grid). The result coordinates are mapped into a "ScreenRect", which is a pixel-based viewing window.