libosmscout  1.1.1
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
osmscout::MapPainterDirectX Class Reference

#include <libosmscout-map-directx/include/osmscout/MapPainterDirectX.h>

Inheritance diagram for osmscout::MapPainterDirectX:
Inheritance graph
[legend]
Collaboration diagram for osmscout::MapPainterDirectX:
Collaboration graph
[legend]

Classes

struct  DirectXNativeGlyph
 
class  DirectXTextLayout
 

Public Types

using DirectXGlyph = Glyph< DirectXNativeGlyph >
 
using DirectXLabel = Label< DirectXNativeGlyph, DirectXTextLayout >
 
- Public Types inherited from osmscout::MapPainter
using WayPathDataIt = std::list< WayPathData >::iterator
 

Public Member Functions

 MapPainterDirectX (const StyleConfigRef &styleConfig, ID2D1Factory *pDirect2dFactory, IDWriteFactory *pWriteFactory)
 
virtual ~MapPainterDirectX ()
 
void DiscardDeviceResources ()
 
bool DrawMap (const Projection &projection, const MapParameter &parameter, const MapData &data, ID2D1RenderTarget *renderTarget)
 
- Public Member Functions inherited from osmscout::MapPainter
 MapPainter (const StyleConfigRef &styleConfig)
 
virtual ~MapPainter ()
 
bool Draw (const Projection &projection, const MapParameter &parameter, const MapData &data, RenderSteps startStep, RenderSteps endStep)
 
bool Draw (const Projection &projection, const MapParameter &parameter, const MapData &data)
 

Protected Member Functions

virtual void AfterPreprocessing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void BeforeDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void AfterDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual bool HasIcon (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, IconStyle &style)
 
virtual double GetFontHeight (const Projection &projection, const MapParameter &parameter, double fontSize)
 
DoubleRectangle GetTextDimension (const Projection &projection, const MapParameter &parameter, double objectWidth, double fontSize, const std::string &text)
 
virtual void DrawGround (const Projection &projection, const MapParameter &parameter, const FillStyle &style)
 
void DrawLabel (const Projection &projection, const MapParameter &parameter, const DoubleRectangle &labelRectangle, const LabelData &label, const DirectXTextLayout &textLayout)
 
void DrawGlyphs (const Projection &projection, const MapParameter &parameter, const osmscout::PathTextStyleRef style, const std::vector< osmscout::Glyph< DirectXNativeGlyph >> &glyphs)
 
virtual void RegisterRegularLabel (const Projection &projection, const MapParameter &parameter, const std::vector< LabelData > &labels, const Vertex2D &position, double objectWidth)
 
virtual void RegisterContourLabel (const Projection &projection, const MapParameter &parameter, const PathLabelData &label, const LabelPath &labelPath)
 
virtual void DrawLabels (const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void DrawIcon (const IconStyle *style, double centerX, double centerY, double width, double height)
 
virtual void DrawSymbol (const Projection &projection, const MapParameter &parameter, const Symbol &symbol, double x, double y)
 
virtual void DrawPath (const Projection &projection, const MapParameter &parameter, const Color &color, double width, const std::vector< double > &dash, LineStyle::CapStyle startCap, LineStyle::CapStyle endCap, size_t transStart, size_t transEnd)
 
std::shared_ptr< DirectXLabelLayout (const Projection &projection, const MapParameter &parameter, const std::string &text, double fontSize, double objectWidth, bool enableWrapping=false, bool contourLabel=false)
 
osmscout::DoubleRectangle GlyphBoundingBox (const DirectXNativeGlyph &glyph) const
 
virtual void DrawContourSymbol (const Projection &projection, const MapParameter &parameter, const Symbol &symbol, double space, size_t transStart, size_t transEnd)
 
virtual void DrawArea (const Projection &projection, const MapParameter &parameter, const AreaData &area)
 
- Protected Member Functions inherited from osmscout::MapPainter
const std::list< WayData > & GetWayData () const
 
const std::list< AreaData > & GetAreaData () const
 
virtual void DrawContourLines (const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void DrawHillShading (const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual double GetProposedLabelWidth (const MapParameter &parameter, double averageCharWidth, double objectWidth, size_t stringLength)
 
virtual void DrawWay (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const WayData &data)
 
std::vector< OffsetRelParseLaneTurns (const LanesFeatureValue &)
 
bool IsVisibleArea (const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const
 
bool IsVisibleWay (const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const
 
void Transform (const Projection &projection, const MapParameter &parameter, const GeoCoord &coord, double &x, double &y)
 
double GetProjectedWidth (const Projection &projection, double minPixel, double width) const
 
double GetProjectedWidth (const Projection &projection, double width) const
 

Additional Inherited Members

- Protected Attributes inherited from osmscout::MapPainter
TextStyleRef debugLabel
 
StyleConfigRef styleConfig
 Reference to the style configuration to be used. More...
 
TransBuffer transBuffer
 Internal buffer for coordinate transformation from geo coordinates to display coordinates. More...
 
CoordBuffer coordBuffer
 Coordinate buffer. More...
 
FillStyleRef landFill
 
FillStyleRef seaFill
 
FeatureValueBuffer coastlineSegmentAttributes
 
NameFeatureValueReader nameReader
 Value reader for the 'name' feature. More...
 
NameAltFeatureValueReader nameAltReader
 Value reader for the 'alternative name' feature. More...
 
RefFeatureValueReader refReader
 Value reader for the 'ref' feature. More...
 
LayerFeatureValueReader layerReader
 Value reader for the 'layer' feature. More...
 
WidthFeatureValueReader widthReader
 Value reader for the 'width' feature. More...
 
AddressFeatureValueReader addressReader
 Value reader for the 'address' feature. More...
 
LanesFeatureValueReader lanesReader
 Value reader for the 'lanes' feature. More...
 
AccessFeatureValueReader accessReader
 Value reader for the 'lanes' feature. More...
 
ColorFeatureValueReader colorReader
 Value reader for the 'color' feature. More...
 
std::vector< double > emptyDash
 Empty dash array. More...
 
std::vector< double > tunnelDash
 Dash array for drawing tunnel border. More...
 
FillStyle areaMarkStyle
 Marker fill style for internal debugging. More...
 
double contourLabelOffset
 Same value as in MapParameter but converted to pixel. More...
 
double contourLabelSpace
 Same value as in MapParameter but converted to pixel. More...
 
double shieldGridSizeHoriz
 Width of a cell for shield label placement. More...
 
double shieldGridSizeVert
 Height of a cell for shield label placement. More...
 

Member Typedef Documentation

◆ DirectXGlyph

◆ DirectXLabel

Constructor & Destructor Documentation

◆ MapPainterDirectX()

osmscout::MapPainterDirectX::MapPainterDirectX ( const StyleConfigRef styleConfig,
ID2D1Factory *  pDirect2dFactory,
IDWriteFactory *  pWriteFactory 
)

◆ ~MapPainterDirectX()

virtual osmscout::MapPainterDirectX::~MapPainterDirectX ( )
virtual

Member Function Documentation

◆ AfterDrawing()

virtual void osmscout::MapPainterDirectX::AfterDrawing ( const StyleConfig styleConfig,
const Projection projection,
const MapParameter &  parameter,
const MapData &  data 
)
protectedvirtual

Reimplemented from osmscout::MapPainter.

◆ AfterPreprocessing()

virtual void osmscout::MapPainterDirectX::AfterPreprocessing ( const StyleConfig styleConfig,
const Projection projection,
const MapParameter &  parameter,
const MapData &  data 
)
protectedvirtual

Low level drawing routines that have to be implemented by the concrete drawing engine. Some optional callbacks between individual processing steps.

Reimplemented from osmscout::MapPainter.

◆ BeforeDrawing()

virtual void osmscout::MapPainterDirectX::BeforeDrawing ( const StyleConfig styleConfig,
const Projection projection,
const MapParameter &  parameter,
const MapData &  data 
)
protectedvirtual

Reimplemented from osmscout::MapPainter.

◆ DiscardDeviceResources()

void osmscout::MapPainterDirectX::DiscardDeviceResources ( )

◆ DrawArea()

virtual void osmscout::MapPainterDirectX::DrawArea ( const Projection projection,
const MapParameter &  parameter,
const AreaData area 
)
protectedvirtual

Draw the given area using the given FillStyle for the area outline.

Implements osmscout::MapPainter.

◆ DrawContourSymbol()

virtual void osmscout::MapPainterDirectX::DrawContourSymbol ( const Projection projection,
const MapParameter &  parameter,
const Symbol symbol,
double  space,
size_t  transStart,
size_t  transEnd 
)
protectedvirtual

Draw the given text as a contour of the given path in a style defined by the given LabelStyle.

Implements osmscout::MapPainter.

◆ DrawGlyphs()

void osmscout::MapPainterDirectX::DrawGlyphs ( const Projection projection,
const MapParameter &  parameter,
const osmscout::PathTextStyleRef  style,
const std::vector< osmscout::Glyph< DirectXNativeGlyph >> &  glyphs 
)
protected

◆ DrawGround()

virtual void osmscout::MapPainterDirectX::DrawGround ( const Projection projection,
const MapParameter &  parameter,
const FillStyle style 
)
protectedvirtual

(Optionally) fills the area with the given default color for ground. In 2D backends this just fills the given area, 3D backends might draw a sphere or an infinite plane.

Implements osmscout::MapPainter.

◆ DrawIcon()

virtual void osmscout::MapPainterDirectX::DrawIcon ( const IconStyle style,
double  centerX,
double  centerY,
double  width,
double  height 
)
protectedvirtual

Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center).

Implements osmscout::MapPainter.

◆ DrawLabel()

void osmscout::MapPainterDirectX::DrawLabel ( const Projection projection,
const MapParameter &  parameter,
const DoubleRectangle labelRectangle,
const LabelData label,
const DirectXTextLayout textLayout 
)
protected

◆ DrawLabels()

virtual void osmscout::MapPainterDirectX::DrawLabels ( const Projection projection,
const MapParameter &  parameter,
const MapData &  data 
)
protectedvirtual

Implements osmscout::MapPainter.

◆ DrawMap()

bool osmscout::MapPainterDirectX::DrawMap ( const Projection projection,
const MapParameter &  parameter,
const MapData &  data,
ID2D1RenderTarget *  renderTarget 
)

◆ DrawPath()

virtual void osmscout::MapPainterDirectX::DrawPath ( const Projection projection,
const MapParameter &  parameter,
const Color &  color,
double  width,
const std::vector< double > &  dash,
LineStyle::CapStyle  startCap,
LineStyle::CapStyle  endCap,
size_t  transStart,
size_t  transEnd 
)
protectedvirtual

Draw simple line with the given style,the given color, the given width and the given untransformed nodes.

Implements osmscout::MapPainter.

◆ DrawSymbol()

virtual void osmscout::MapPainterDirectX::DrawSymbol ( const Projection projection,
const MapParameter &  parameter,
const Symbol symbol,
double  x,
double  y 
)
protectedvirtual

Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate (symbol center).

Implements osmscout::MapPainter.

◆ GetFontHeight()

virtual double osmscout::MapPainterDirectX::GetFontHeight ( const Projection projection,
const MapParameter &  parameter,
double  fontSize 
)
protectedvirtual

Returns the height of the font.

Implements osmscout::MapPainter.

◆ GetTextDimension()

DoubleRectangle osmscout::MapPainterDirectX::GetTextDimension ( const Projection projection,
const MapParameter &  parameter,
double  objectWidth,
double  fontSize,
const std::string &  text 
)
protected

◆ GlyphBoundingBox()

osmscout::DoubleRectangle osmscout::MapPainterDirectX::GlyphBoundingBox ( const DirectXNativeGlyph glyph) const
protected

◆ HasIcon()

virtual bool osmscout::MapPainterDirectX::HasIcon ( const StyleConfig styleConfig,
const Projection projection,
const MapParameter &  parameter,
IconStyle style 
)
protectedvirtual

Return true, if the icon in the IconStyle is available and can be drawn. If this method returns false, possibly a fallback (using a Symbol) will be chosen.

Icon style dimensions and iconId may be setup for later usage.

Implements osmscout::MapPainter.

◆ Layout()

std::shared_ptr<DirectXLabel> osmscout::MapPainterDirectX::Layout ( const Projection projection,
const MapParameter &  parameter,
const std::string &  text,
double  fontSize,
double  objectWidth,
bool  enableWrapping = false,
bool  contourLabel = false 
)
protected

◆ RegisterContourLabel()

virtual void osmscout::MapPainterDirectX::RegisterContourLabel ( const Projection projection,
const MapParameter &  parameter,
const PathLabelData label,
const LabelPath labelPath 
)
protectedvirtual

Register contour label

Implements osmscout::MapPainter.

◆ RegisterRegularLabel()

virtual void osmscout::MapPainterDirectX::RegisterRegularLabel ( const Projection projection,
const MapParameter &  parameter,
const std::vector< LabelData > &  labels,
const Vertex2D &  position,
double  objectWidth 
)
protectedvirtual

Register regular label with given text at the given pixel coordinate in a style defined by the given LabelStyle.

Implements osmscout::MapPainter.


The documentation for this class was generated from the following file: