libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::StyleConfig Class Reference

Index selectors by type and level. More...

#include <StyleConfig.h>

Public Member Functions

void AddAreaBorderStyle (const StyleFilter &filter, BorderPartialStyle &style)
 
void AddAreaBorderSymbolStyle (const StyleFilter &filter, PathSymbolPartialStyle &style)
 
void AddAreaBorderTextStyle (const StyleFilter &filter, PathTextPartialStyle &style)
 
void AddAreaFillStyle (const StyleFilter &filter, FillPartialStyle &style)
 
void AddAreaIconStyle (const StyleFilter &filter, IconPartialStyle &style)
 
void AddAreaTextStyle (const StyleFilter &filter, TextPartialStyle &style)
 
void AddConstant (const std::string &name, const StyleConstantRef &variable)
 
void AddFlag (const std::string &name, bool value)
 Add the flag with the given value. More...
 
void AddNodeIconStyle (const StyleFilter &filter, IconPartialStyle &style)
 
void AddNodeTextStyle (const StyleFilter &filter, TextPartialStyle &stype)
 
void AddRouteLineStyle (const StyleFilter &filter, LinePartialStyle &style)
 
void AddRoutePathTextStyle (const StyleFilter &filter, PathTextPartialStyle &style)
 
void AddWayLineStyle (const StyleFilter &filter, LinePartialStyle &style)
 
void AddWayPathShieldStyle (const StyleFilter &filter, PathShieldPartialStyle &style)
 
void AddWayPathSymbolStyle (const StyleFilter &filter, PathSymbolPartialStyle &style)
 
void AddWayPathTextStyle (const StyleFilter &filter, PathTextPartialStyle &style)
 
void GetAreaBorderStyles (const TypeInfoRef &type, const FeatureValueBuffer &buffer, const Projection &projection, std::vector< BorderStyleRef > &borderStyles) const
 
PathSymbolStyleRef GetAreaBorderSymbolStyle (const TypeInfoRef &type, const FeatureValueBuffer &buffer, const Projection &projection) const
 
PathTextStyleRef GetAreaBorderTextStyle (const TypeInfoRef &type, const FeatureValueBuffer &buffer, const Projection &projection) const
 
FillStyleRef GetAreaFillStyle (const TypeInfoRef &type, const FeatureValueBuffer &buffer, const Projection &projection) const
 
void GetAreaFillStyleSelectors (size_t level, const TypeInfoRef &type, std::list< FillStyleSelector > &selectors) const
 
IconStyleRef GetAreaIconStyle (const TypeInfoRef &type, const FeatureValueBuffer &buffer, const Projection &projection) const
 
size_t GetAreaTextStyleCount (const TypeInfoRef &type, const FeatureValueBuffer &buffer, const Projection &projection) const
 
void GetAreaTextStyles (const TypeInfoRef &type, const FeatureValueBuffer &buffer, const Projection &projection, std::vector< TextStyleRef > &textStyles) const
 
void GetAreaTextStyleSelectors (size_t level, const TypeInfoRef &type, std::list< TextStyleSelector > &selectors) const
 
void GetAreaTypesWithMaxMag (const Magnification &maxMag, TypeInfoSet &types) const
 
FillStyleRef GetCoastFillStyle (const Projection &projection) const
 
LineStyleRef GetCoastlineLineStyle (const Projection &projection) const
 
StyleConstantRef GetConstantByName (const std::string &name) const
 
const std::list< StyleError > & GetErrors () const
 
size_t GetFeatureFilterIndex (const Feature &feature) const
 
bool GetFlagByName (const std::string &name) const
 Returns the value of the given flag identified by the name of the flag. More...
 
std::unordered_map< std::string, bool > GetFlags () const
 
LabelProviderRef GetLabelProvider (const std::string &name) const
 
FillStyleRef GetLandFillStyle (const Projection &projection) const
 
IconStyleRef GetNodeIconStyle (const FeatureValueBuffer &buffer, const Projection &projection) const
 
size_t GetNodeTextStyleCount (const FeatureValueBuffer &buffer, const Projection &projection) const
 
void GetNodeTextStyles (const FeatureValueBuffer &buffer, const Projection &projection, std::vector< TextStyleRef > &textStyles) const
 
void GetNodeTextStyleSelectors (size_t level, const TypeInfoRef &type, std::list< TextStyleSelector > &selectors) const
 Methods for low level debugging access to the style sheet internals. More...
 
void GetNodeTypesWithMaxMag (const Magnification &maxMag, TypeInfoSet &types) const
 
LineStyleRef GetOSMSubTileBorderLineStyle (const Projection &projection) const
 
LineStyleRef GetOSMTileBorderLineStyle (const Projection &projection) const
 
void GetRouteLineStyles (const FeatureValueBuffer &buffer, const Projection &projection, std::vector< LineStyleRef > &lineStyles) const
 
PathTextStyleRef GetRoutePathTextStyle (const FeatureValueBuffer &buffer, const Projection &projection) const
 
void GetRouteTypesWithMaxMag (const Magnification &maxMag, TypeInfoSet &types) const
 
FillStyleRef GetSeaFillStyle (const Projection &projection) const
 
const SymbolRefGetSymbol (const std::string &name) const
 
TypeConfigRef GetTypeConfig () const
 
FillStyleRef GetUnknownFillStyle (const Projection &projection) const
 
const std::list< StyleError > & GetWarnings () const
 
void GetWayLineStyles (const FeatureValueBuffer &buffer, const Projection &projection, std::vector< LineStyleRef > &lineStyles) const
 
PathShieldStyleRef GetWayPathShieldStyle (const FeatureValueBuffer &buffer, const Projection &projection) const
 
void GetWayPathSymbolStyle (const FeatureValueBuffer &buffer, const Projection &projection, std::vector< PathSymbolStyleRef > &symbolStyles) const
 
PathTextStyleRef GetWayPathTextStyle (const FeatureValueBuffer &buffer, const Projection &projection) const
 
size_t GetWayPrio (const TypeInfoRef &type) const
 
void GetWayTypesWithMaxMag (const Magnification &mag, TypeInfoSet &types) const
 
bool HasAreaTextStyles (const TypeInfoRef &type, const Magnification &magnification) const
 
bool HasFlag (const std::string &name) const
 Returns 'true', if the given flag exists, else 'false'. More...
 
bool HasNodeTextStyles (const TypeInfoRef &type, const Magnification &magnification) const
 Methods for retrieval of styles for a given object. More...
 
bool HasWayPathShieldStyle (const Projection &projection) const
 
bool HasWayPathTextStyle (const Projection &projection) const
 
bool Load (const std::string &styleFile, ColorPostprocessor colorPostprocessor=nullptr, bool submodule=false, Log &log=osmscout::log)
 Load the given *.oss file into the current style config object. More...
 
bool LoadContent (const std::string &filename, const std::string &content, ColorPostprocessor colorPostprocessor=nullptr, bool submodule=false, Log &log=osmscout::log)
 Methods for loading a concrete OSS style sheet. More...
 
void Postprocess ()
 
bool RegisterLabelProviderFactory (const std::string &name, const LabelProviderFactoryRef &factory)
 Methods for registering LabelProvider-factories and and retrieving label providers. More...
 
bool RegisterSymbol (const SymbolRef &symbol)
 
StyleConfigSetWayPrio (const TypeInfoRef &type, size_t prio)
 
 StyleConfig (const TypeConfigRef &typeConfig)
 
virtual ~StyleConfig ()
 

Public Attributes

std::vector< TypeInfoSetareaTypeSets
 
std::vector< TypeInfoSetnodeTypeSets
 
std::vector< TypeInfoSetrouteTypeSets
 
TypeConfigRef typeConfig
 Reference to the type configuration. More...
 
std::vector< TypeInfoSetwayTypeSets
 way types with defined style by magnification level More...
 

Detailed Description

Index selectors by type and level.

A complete style definition

Internals:

  • Fastpath: Fastpath means, that we can directly return the style definition from the style sheet. This is normally the case, if there is exactly one match in the style sheet. If there are multiple matches a new style has to be allocated and composed from all matches.

Constructor & Destructor Documentation

◆ StyleConfig()

osmscout::StyleConfig::StyleConfig ( const TypeConfigRef typeConfig)
explicit

◆ ~StyleConfig()

osmscout::StyleConfig::~StyleConfig ( )
virtual

Member Function Documentation

◆ AddAreaBorderStyle()

void osmscout::StyleConfig::AddAreaBorderStyle ( const StyleFilter filter,
BorderPartialStyle style 
)

◆ AddAreaBorderSymbolStyle()

void osmscout::StyleConfig::AddAreaBorderSymbolStyle ( const StyleFilter filter,
PathSymbolPartialStyle style 
)

◆ AddAreaBorderTextStyle()

void osmscout::StyleConfig::AddAreaBorderTextStyle ( const StyleFilter filter,
PathTextPartialStyle style 
)

◆ AddAreaFillStyle()

void osmscout::StyleConfig::AddAreaFillStyle ( const StyleFilter filter,
FillPartialStyle style 
)

◆ AddAreaIconStyle()

void osmscout::StyleConfig::AddAreaIconStyle ( const StyleFilter filter,
IconPartialStyle style 
)

◆ AddAreaTextStyle()

void osmscout::StyleConfig::AddAreaTextStyle ( const StyleFilter filter,
TextPartialStyle style 
)

◆ AddConstant()

void osmscout::StyleConfig::AddConstant ( const std::string &  name,
const StyleConstantRef variable 
)

◆ AddFlag()

void osmscout::StyleConfig::AddFlag ( const std::string &  name,
bool  value 
)

Add the flag with the given value.

If the flag already exists, its value gets overwritten.

Referenced by osmscout::oss::Parser::FLAGDEF().

◆ AddNodeIconStyle()

void osmscout::StyleConfig::AddNodeIconStyle ( const StyleFilter filter,
IconPartialStyle style 
)

◆ AddNodeTextStyle()

void osmscout::StyleConfig::AddNodeTextStyle ( const StyleFilter filter,
TextPartialStyle stype 
)

◆ AddRouteLineStyle()

void osmscout::StyleConfig::AddRouteLineStyle ( const StyleFilter filter,
LinePartialStyle style 
)

◆ AddRoutePathTextStyle()

void osmscout::StyleConfig::AddRoutePathTextStyle ( const StyleFilter filter,
PathTextPartialStyle style 
)

◆ AddWayLineStyle()

void osmscout::StyleConfig::AddWayLineStyle ( const StyleFilter filter,
LinePartialStyle style 
)

◆ AddWayPathShieldStyle()

void osmscout::StyleConfig::AddWayPathShieldStyle ( const StyleFilter filter,
PathShieldPartialStyle style 
)

◆ AddWayPathSymbolStyle()

void osmscout::StyleConfig::AddWayPathSymbolStyle ( const StyleFilter filter,
PathSymbolPartialStyle style 
)

◆ AddWayPathTextStyle()

void osmscout::StyleConfig::AddWayPathTextStyle ( const StyleFilter filter,
PathTextPartialStyle style 
)

◆ GetAreaBorderStyles()

void osmscout::StyleConfig::GetAreaBorderStyles ( const TypeInfoRef type,
const FeatureValueBuffer buffer,
const Projection projection,
std::vector< BorderStyleRef > &  borderStyles 
) const

◆ GetAreaBorderSymbolStyle()

PathSymbolStyleRef osmscout::StyleConfig::GetAreaBorderSymbolStyle ( const TypeInfoRef type,
const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetAreaBorderTextStyle()

PathTextStyleRef osmscout::StyleConfig::GetAreaBorderTextStyle ( const TypeInfoRef type,
const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetAreaFillStyle()

FillStyleRef osmscout::StyleConfig::GetAreaFillStyle ( const TypeInfoRef type,
const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetAreaFillStyleSelectors()

void osmscout::StyleConfig::GetAreaFillStyleSelectors ( size_t  level,
const TypeInfoRef type,
std::list< FillStyleSelector > &  selectors 
) const

◆ GetAreaIconStyle()

IconStyleRef osmscout::StyleConfig::GetAreaIconStyle ( const TypeInfoRef type,
const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetAreaTextStyleCount()

size_t osmscout::StyleConfig::GetAreaTextStyleCount ( const TypeInfoRef type,
const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetAreaTextStyles()

void osmscout::StyleConfig::GetAreaTextStyles ( const TypeInfoRef type,
const FeatureValueBuffer buffer,
const Projection projection,
std::vector< TextStyleRef > &  textStyles 
) const

◆ GetAreaTextStyleSelectors()

void osmscout::StyleConfig::GetAreaTextStyleSelectors ( size_t  level,
const TypeInfoRef type,
std::list< TextStyleSelector > &  selectors 
) const

◆ GetAreaTypesWithMaxMag()

void osmscout::StyleConfig::GetAreaTypesWithMaxMag ( const Magnification maxMag,
TypeInfoSet types 
) const

◆ GetCoastFillStyle()

FillStyleRef osmscout::StyleConfig::GetCoastFillStyle ( const Projection projection) const

◆ GetCoastlineLineStyle()

LineStyleRef osmscout::StyleConfig::GetCoastlineLineStyle ( const Projection projection) const

◆ GetConstantByName()

◆ GetErrors()

const std::list< StyleError > & osmscout::StyleConfig::GetErrors ( ) const

◆ GetFeatureFilterIndex()

size_t osmscout::StyleConfig::GetFeatureFilterIndex ( const Feature feature) const

◆ GetFlagByName()

bool osmscout::StyleConfig::GetFlagByName ( const std::string &  name) const

Returns the value of the given flag identified by the name of the flag.

Asserts, if the flag name is unknown.

Referenced by osmscout::oss::Parser::IFCOND().

◆ GetFlags()

std::unordered_map<std::string,bool> osmscout::StyleConfig::GetFlags ( ) const
inline

◆ GetLabelProvider()

LabelProviderRef osmscout::StyleConfig::GetLabelProvider ( const std::string &  name) const

◆ GetLandFillStyle()

FillStyleRef osmscout::StyleConfig::GetLandFillStyle ( const Projection projection) const

◆ GetNodeIconStyle()

IconStyleRef osmscout::StyleConfig::GetNodeIconStyle ( const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetNodeTextStyleCount()

size_t osmscout::StyleConfig::GetNodeTextStyleCount ( const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetNodeTextStyles()

void osmscout::StyleConfig::GetNodeTextStyles ( const FeatureValueBuffer buffer,
const Projection projection,
std::vector< TextStyleRef > &  textStyles 
) const

◆ GetNodeTextStyleSelectors()

void osmscout::StyleConfig::GetNodeTextStyleSelectors ( size_t  level,
const TypeInfoRef type,
std::list< TextStyleSelector > &  selectors 
) const

Methods for low level debugging access to the style sheet internals.

◆ GetNodeTypesWithMaxMag()

void osmscout::StyleConfig::GetNodeTypesWithMaxMag ( const Magnification maxMag,
TypeInfoSet types 
) const

◆ GetOSMSubTileBorderLineStyle()

LineStyleRef osmscout::StyleConfig::GetOSMSubTileBorderLineStyle ( const Projection projection) const

◆ GetOSMTileBorderLineStyle()

LineStyleRef osmscout::StyleConfig::GetOSMTileBorderLineStyle ( const Projection projection) const

◆ GetRouteLineStyles()

void osmscout::StyleConfig::GetRouteLineStyles ( const FeatureValueBuffer buffer,
const Projection projection,
std::vector< LineStyleRef > &  lineStyles 
) const

◆ GetRoutePathTextStyle()

PathTextStyleRef osmscout::StyleConfig::GetRoutePathTextStyle ( const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetRouteTypesWithMaxMag()

void osmscout::StyleConfig::GetRouteTypesWithMaxMag ( const Magnification maxMag,
TypeInfoSet types 
) const

◆ GetSeaFillStyle()

FillStyleRef osmscout::StyleConfig::GetSeaFillStyle ( const Projection projection) const

◆ GetSymbol()

const SymbolRef & osmscout::StyleConfig::GetSymbol ( const std::string &  name) const

◆ GetTypeConfig()

◆ GetUnknownFillStyle()

FillStyleRef osmscout::StyleConfig::GetUnknownFillStyle ( const Projection projection) const

◆ GetWarnings()

const std::list< StyleError > & osmscout::StyleConfig::GetWarnings ( ) const

◆ GetWayLineStyles()

void osmscout::StyleConfig::GetWayLineStyles ( const FeatureValueBuffer buffer,
const Projection projection,
std::vector< LineStyleRef > &  lineStyles 
) const

◆ GetWayPathShieldStyle()

PathShieldStyleRef osmscout::StyleConfig::GetWayPathShieldStyle ( const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetWayPathSymbolStyle()

void osmscout::StyleConfig::GetWayPathSymbolStyle ( const FeatureValueBuffer buffer,
const Projection projection,
std::vector< PathSymbolStyleRef > &  symbolStyles 
) const

◆ GetWayPathTextStyle()

PathTextStyleRef osmscout::StyleConfig::GetWayPathTextStyle ( const FeatureValueBuffer buffer,
const Projection projection 
) const

◆ GetWayPrio()

size_t osmscout::StyleConfig::GetWayPrio ( const TypeInfoRef type) const
inline

◆ GetWayTypesWithMaxMag()

void osmscout::StyleConfig::GetWayTypesWithMaxMag ( const Magnification mag,
TypeInfoSet types 
) const

◆ HasAreaTextStyles()

bool osmscout::StyleConfig::HasAreaTextStyles ( const TypeInfoRef type,
const Magnification magnification 
) const

◆ HasFlag()

bool osmscout::StyleConfig::HasFlag ( const std::string &  name) const

Returns 'true', if the given flag exists, else 'false'.

Referenced by osmscout::oss::Parser::FLAGDEF(), and osmscout::oss::Parser::IFCOND().

◆ HasNodeTextStyles()

bool osmscout::StyleConfig::HasNodeTextStyles ( const TypeInfoRef type,
const Magnification magnification 
) const

Methods for retrieval of styles for a given object.

References osmscout::Magnification::GetLevel().

◆ HasWayPathShieldStyle()

bool osmscout::StyleConfig::HasWayPathShieldStyle ( const Projection projection) const
Parameters
projection
Returns
true when some way shield style is defined on provided projection

References osmscout::Magnification::GetLevel(), and osmscout::Projection::GetMagnification().

◆ HasWayPathTextStyle()

bool osmscout::StyleConfig::HasWayPathTextStyle ( const Projection projection) const
Parameters
projection
Returns
true when some way text style is defined on provided projection

References osmscout::Magnification::GetLevel(), and osmscout::Projection::GetMagnification().

◆ Load()

bool osmscout::StyleConfig::Load ( const std::string &  styleFile,
ColorPostprocessor  colorPostprocessor = nullptr,
bool  submodule = false,
Log log = osmscout::log 
)

Load the given *.oss file into the current style config object.

Parameters
styleFileThe file to load
colorPostprocessorOptional function to post process color values
submoduleBefore loading submodule, style config is not reset and post-process after.
Returns
true, if loading was successful, else false

References osmscout::Log::Debug(), osmscout::Log::Error(), osmscout::IOException::GetDescription(), osmscout::GetFileSize(), LoadContent(), osmscout::log, osmscout::StopClock::ResultString(), and osmscout::StopClock::Stop().

Referenced by osmscout::oss::Parser::IMPORT().

◆ LoadContent()

◆ Postprocess()

void osmscout::StyleConfig::Postprocess ( )

Referenced by LoadContent().

◆ RegisterLabelProviderFactory()

bool osmscout::StyleConfig::RegisterLabelProviderFactory ( const std::string &  name,
const LabelProviderFactoryRef factory 
)

Methods for registering LabelProvider-factories and and retrieving label providers.

Referenced by StyleConfig().

◆ RegisterSymbol()

bool osmscout::StyleConfig::RegisterSymbol ( const SymbolRef symbol)

◆ SetWayPrio()

StyleConfig & osmscout::StyleConfig::SetWayPrio ( const TypeInfoRef type,
size_t  prio 
)

Member Data Documentation

◆ areaTypeSets

std::vector<TypeInfoSet> osmscout::StyleConfig::areaTypeSets

Referenced by GetAreaTypesWithMaxMag().

◆ nodeTypeSets

std::vector<TypeInfoSet> osmscout::StyleConfig::nodeTypeSets

Referenced by GetNodeTypesWithMaxMag().

◆ routeTypeSets

std::vector<TypeInfoSet> osmscout::StyleConfig::routeTypeSets

Referenced by GetRouteTypesWithMaxMag().

◆ typeConfig

TypeConfigRef osmscout::StyleConfig::typeConfig

Reference to the type configuration.

Referenced by GetLabelProvider(), GetTypeConfig(), and StyleConfig().

◆ wayTypeSets

std::vector<TypeInfoSet> osmscout::StyleConfig::wayTypeSets

way types with defined style by magnification level

Referenced by GetWayTypesWithMaxMag().


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