|
libosmscout 0.1
|
The Projection class is an abstract base class for multiple projection implementations. More...
#include <Projection.h>
Classes | |
| class | BatchTransformer |
| This class is used to hide internal complexity concerned with batching GeoToPixel calls. More... | |
Public Member Functions | |
| bool | BoundingBoxToPixel (const GeoBox &boundingBox, ScreenBox &screenBox) const |
| Converts a valid GeoBox to its on screen pixel coordinates. | |
| virtual bool | CanBatch () const =0 |
| double | ConvertPixelToWidth (double pixel) const |
| Convert a width in pixel into the equivalent mm size based on the given DPI. | |
| double | ConvertWidthToPixel (double width) const |
| Convert a width in mm into the equivalent pixel size based on the given DPI. | |
| virtual bool | GeoToPixel (const GeoCoord &coord, Vertex2D &pixel) const =0 |
| Converts a geo coordinate to a pixel coordinate. | |
| double | GetAngle () const |
| Returns the angle in radians ([0..2*PI[) of the display in relation to the north. | |
| GeoCoord | GetCenter () const |
| GeoBox | GetDimensions () const |
| double | GetDPI () const |
| Return the DPI as part of the projection. | |
| size_t | GetHeight () const |
| Returns the height of the screen. | |
| Magnification | GetMagnification () const |
| Return the magnification as part of the projection. | |
| double | GetMeterInMM () const |
| Returns the number of on screen millimeters for one meter on the ground. | |
| double | GetMeterInPixel () const |
| Returns the number of on screen pixel for one meter on the ground. | |
| double | GetPixelSize () const |
| Returns the size of a pixel in meter. | |
| ScreenBox | GetScreenBox () const |
| Return a ScreenBox instance for the screen. | |
| size_t | GetWidth () const |
| Returns the width of the screen. | |
| virtual bool | IsValid () const =0 |
| virtual bool | IsValidFor (const GeoCoord &coord) const =0 |
| Return true if given coordinate is valid for this projection. | |
| Projection & | operator= (const Projection &)=default |
| Projection & | operator= (Projection &&)=default |
| virtual bool | PixelToGeo (double x, double y, GeoCoord &coord) const =0 |
| Converts a pixel coordinate to a geo coordinate. | |
| Projection ()=default | |
| Projection (const Projection &)=default | |
| Projection (Projection &&)=default | |
| virtual | ~Projection ()=default |
Protected Member Functions | |
| virtual void | GeoToPixel (const BatchTransformer &transformData) const =0 |
Protected Attributes | |
| double | angle =0.0 |
| Display rotation angle in radians, canvas clockwise. | |
| GeoBox | boundingBox |
| Bounding box of the current projection on the ground. | |
| GeoCoord | center |
| Coordinate of the center of the displayed area. | |
| double | dpi =0.0 |
| Screen DPI. | |
| size_t | height =0 |
| Height of image. | |
| Magnification | magnification |
| Current magnification. | |
| double | meterInMM =0.0 |
| Number of on screen millimeters for one meter on the ground. | |
| double | meterInPixel =0.0 |
| Number of on screen pixel for one meter on the ground. | |
| double | pixelSize =0.0 |
| Size of a pixel in meter. | |
| size_t | width =0 |
| Width of image. | |
Friends | |
| class | BatchTransformer |
The Projection class is an abstract base class for multiple projection implementations.
The Projection class allows transformation of geo coordinates to screen/image coordinates and screen/image coordinates back to geo coordinates.
|
default |
Referenced by osmscout::Projection::BatchTransformer::BatchTransformer(), operator=(), operator=(), Projection(), and Projection().
|
default |
References Projection().
|
default |
References Projection().
|
virtualdefault |
| bool osmscout::Projection::BoundingBoxToPixel | ( | const GeoBox & | boundingBox, |
| ScreenBox & | screenBox ) const |
Converts a valid GeoBox to its on screen pixel coordinates.
Return true on success, false if given coordinate is not valid for this projection.
References boundingBox, GeoToPixel(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
Referenced by GeoToPixel(), osmscout::IsAreaRingVisible(), osmscout::MapPainter::IsVisibleArea(), and osmscout::MapPainter::IsVisibleWay().
|
pure virtual |
Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.
|
inlinenodiscard |
Convert a width in pixel into the equivalent mm size based on the given DPI.
| width | Width in screen pixel |
References dpi.
|
inlinenodiscard |
Convert a width in mm into the equivalent pixel size based on the given DPI.
| width | Width in mm |
Referenced by osmscout::MapPainterSVG::AfterPreprocessingCallback(), osmscout::MapPainterAgg::BeforeDrawingCallback(), osmscout::MapPainterCairo::BeforeDrawingCallback(), osmscout::MapPainterQt::BeforeDrawingCallback(), osmscout::MapPainterSVG::BeforeDrawingCallback(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainterAgg::DrawSymbol(), osmscout::GetAreaRingTolerancePixel(), osmscout::Symbol::GetBoundingBox(), osmscout::MapPainterSVG::GetFontHeight(), osmscout::Symbol::GetHeight(), osmscout::GetLabelLayoutMarginPixel(), osmscout::Symbol::GetMaxBorderWidth(), osmscout::GetMaxLabelPaddingPixel(), osmscout::Symbol::GetWidth(), osmscout::MapPainterCairo::HasIcon(), osmscout::MapPainterQt::HasIcon(), osmscout::MapPainterSVG::HasIcon(), osmscout::MapPainterQt::HasPattern(), osmscout::IsAreaRingVisible(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, MapPainterAgg >::LabelReach(), osmscout::MapWidget::paint(), osmscout::SymbolRenderer::Render(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::LayoutJob::Reset(), and osmscout::MapPainter::UpdateVisibilityBounds().
|
protectedpure virtual |
Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.
|
pure virtual |
Converts a geo coordinate to a pixel coordinate.
Return true on success, false if given coordinate is not valid for this projection.
Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.
References boundingBox, and BoundingBoxToPixel().
Referenced by BoundingBoxToPixel(), and osmscout::MapPainter::DrawHillShading().
|
inlinenodiscard |
Returns the angle in radians ([0..2*PI[) of the display in relation to the north.
A degree of 0 means north is to the top, a degree of PI, renders with the south to the top of the display).
References angle.
Referenced by osmscout::MapWidget::paint(), and osmscout::PlaneMapRenderer::RenderMap().
|
inlinenodiscard |
References center.
Referenced by osmscout::MoveHandler::moveNow().
|
inlinenodiscard |
References boundingBox.
Referenced by osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::MapService::GetGroundTiles(), osmscout::MapService::GetSRTMData(), osmscout::MapService::LookupTiles(), osmscout::TiledMapRenderer::onLoadJobFinished(), and osmscout::TiledRenderingHelper::RenderTiles().
|
inlinenodiscard |
Return the DPI as part of the projection.
References dpi.
Referenced by osmscout::MapPainterAgg::DrawMap(), osmscout::MapPainterCairo::DrawMap(), osmscout::MapPainterQt::DrawMap(), osmscout::MapPainterSVG::DrawMap(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), and osmscout::TileProjection::Set().
|
inlinenodiscard |
Returns the height of the screen.
References height.
Referenced by osmscout::MapPainterAgg::BeforeDrawingCallback(), osmscout::MapPainterSVG::BeforeDrawingCallback(), osmscout::LockHandler::currentPosition(), osmscout::MapPainterAgg::DrawGround(), osmscout::MapPainterCairo::DrawGround(), osmscout::MapPainterQt::DrawGround(), osmscout::MapPainterSVG::DrawGround(), osmscout::MapPainterSVG::DrawMap(), GetScreenBox(), osmscout::MapPainter::IsPointVisible(), osmscout::PlaneMapRenderer::RenderMap(), and osmscout::TiledRenderingHelper::RenderTiles().
|
inlinenodiscard |
Return the magnification as part of the projection.
References magnification.
Referenced by osmscout::MapPainterAgg::DrawMap(), osmscout::MapPainterQt::DrawMap(), osmscout::MapPainterSVG::DrawMap(), osmscout::PlaneMapRenderer::DrawMap(), osmscout::GetFeatureStyle(), osmscout::MapService::GetGroundTiles(), osmscout::StyleConfig::HasWayPathShieldStyle(), osmscout::StyleConfig::HasWayPathTextStyle(), osmscout::MapService::LookupTiles(), osmscout::TiledRenderingHelper::RenderTiles(), and osmscout::MapPainter::UpdateVisibilityBounds().
|
inlinenodiscard |
Returns the number of on screen millimeters for one meter on the ground.
References meterInMM.
Referenced by osmscout::GetFeatureStyle().
|
inlinenodiscard |
Returns the number of on screen pixel for one meter on the ground.
References meterInPixel.
Referenced by osmscout::Symbol::GetBoundingBox(), osmscout::GetFeatureStyle(), osmscout::Symbol::GetHeight(), osmscout::Symbol::GetWidth(), osmscout::MapWidget::paint(), and osmscout::SymbolRenderer::Render().
|
inlinenodiscard |
Returns the size of a pixel in meter.
References pixelSize.
Referenced by osmscout::GetAreaRingTolerancePixel(), osmscout::MapPainter::GetProjectedWidth(), and osmscout::MapPainter::GetProjectedWidth().
|
inlinenodiscard |
Return a ScreenBox instance for the screen.
The ScreenBox has the value [(0.0,0.0)(width,height)]
References GetHeight(), and GetWidth().
Referenced by osmscout::IsAreaRingVisible(), osmscout::MapPainter::IsVisibleArea(), and osmscout::MapPainter::IsVisibleWay().
|
inlinenodiscard |
Returns the width of the screen.
References width.
Referenced by osmscout::MapPainterAgg::BeforeDrawingCallback(), osmscout::MapPainterSVG::BeforeDrawingCallback(), osmscout::LockHandler::currentPosition(), osmscout::MapPainterAgg::DrawGround(), osmscout::MapPainterCairo::DrawGround(), osmscout::MapPainterQt::DrawGround(), osmscout::MapPainterSVG::DrawGround(), osmscout::MapPainterSVG::DrawMap(), GetScreenBox(), osmscout::MapPainter::IsPointVisible(), osmscout::PlaneMapRenderer::RenderMap(), and osmscout::TiledRenderingHelper::RenderTiles().
|
pure virtual |
Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.
|
pure virtual |
Return true if given coordinate is valid for this projection.
Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.
|
default |
References Projection().
|
default |
References Projection().
|
pure virtual |
Converts a pixel coordinate to a geo coordinate.
Return true on success, false if returned coordinate is not valid for this projection.
Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.
|
friend |
|
protected |
Display rotation angle in radians, canvas clockwise.
Referenced by osmscout::MercatorProjection::GeoToPixel(), GetAngle(), osmscout::MercatorProjection::Move(), osmscout::MercatorProjection::PixelToGeo(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), and osmscout::OpenGLProjection::SetShaderUniforms().
|
protected |
Bounding box of the current projection on the ground.
Referenced by BoundingBoxToPixel(), GeoToPixel(), GetDimensions(), osmscout::MercatorProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), and osmscout::TileProjection::SetInternal().
|
protected |
Coordinate of the center of the displayed area.
Referenced by osmscout::MercatorProjection::GeoToPixel(), GetCenter(), osmscout::MercatorProjection::Move(), osmscout::MercatorProjection::PixelToGeo(), osmscout::MercatorProjection::Set(), osmscout::TileProjection::SetInternal(), and osmscout::OpenGLProjection::SetShaderUniforms().
|
protected |
Screen DPI.
Referenced by ConvertPixelToWidth(), ConvertWidthToPixel(), GetDPI(), osmscout::MercatorProjection::Move(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), and osmscout::TileProjection::SetInternal().
|
protected |
Height of image.
Referenced by osmscout::MercatorProjection::GeoToPixel(), osmscout::TileProjection::GeoToPixel(), GetHeight(), osmscout::MercatorProjection::Move(), osmscout::MercatorProjection::PixelToGeo(), osmscout::TileProjection::PixelToGeo(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::SetInternal(), and osmscout::OpenGLProjection::SetShaderUniforms().
|
protected |
Current magnification.
Referenced by GetMagnification(), osmscout::MercatorProjection::Move(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), and osmscout::TileProjection::SetInternal().
|
protected |
Number of on screen millimeters for one meter on the ground.
Referenced by GetMeterInMM(), osmscout::MercatorProjection::Set(), and osmscout::TileProjection::SetInternal().
|
protected |
Number of on screen pixel for one meter on the ground.
Referenced by GetMeterInPixel(), osmscout::MercatorProjection::Set(), and osmscout::TileProjection::SetInternal().
|
protected |
Size of a pixel in meter.
Referenced by GetPixelSize(), osmscout::MercatorProjection::Set(), and osmscout::TileProjection::SetInternal().
|
protected |
Width of image.
Referenced by ConvertWidthToPixel(), osmscout::MercatorProjection::GeoToPixel(), GetWidth(), osmscout::MercatorProjection::Move(), osmscout::MercatorProjection::PixelToGeo(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::MercatorProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::Set(), osmscout::TileProjection::SetInternal(), and osmscout::OpenGLProjection::SetShaderUniforms().