本文整理汇总了C++中TextSymbol::haloOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ TextSymbol::haloOffset方法的具体用法?C++ TextSymbol::haloOffset怎么用?C++ TextSymbol::haloOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextSymbol
的用法示例。
在下文中一共展示了TextSymbol::haloOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
TextSymbol::parseSLD(const Config& c, Style& style)
{
TextSymbol defaults;
if ( match(c.key(), "text-fill") || match(c.key(), "text-color") ) {
style.getOrCreate<TextSymbol>()->fill()->color() = Color(c.value());
}
else if ( match(c.key(), "text-fill-opacity") ) {
style.getOrCreate<TextSymbol>()->fill()->color().a() = as<float>( c.value(), 1.0f );
}
else if ( match(c.key(), "text-size") ) {
style.getOrCreate<TextSymbol>()->size() = NumericExpression( c.value() );
}
else if ( match(c.key(), "text-font") ) {
style.getOrCreate<TextSymbol>()->font() = c.value();
}
else if ( match(c.key(), "text-halo") || match(c.key(), "text-halo-color") ) {
style.getOrCreate<TextSymbol>()->halo()->color() = htmlColorToVec4f( c.value() );
}
else if ( match(c.key(), "text-halo-offset") ) {
style.getOrCreate<TextSymbol>()->haloOffset() = as<float>(c.value(), defaults.haloOffset().get() );
}
else if ( match(c.key(), "text-halo-backdrop-type") ) {
if ( match(c.value(), "right-bottom") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_BOTTOM_RIGHT;
else if ( match(c.value(), "right-center") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_CENTER_RIGHT;
else if ( match(c.value(), "right-top") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_TOP_RIGHT;
else if ( match(c.value(), "center-bottom") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_BOTTOM_CENTER;
else if ( match(c.value(), "center-top") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_TOP_CENTER;
else if ( match(c.value(), "left-bottom") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_BOTTOM_LEFT;
else if ( match(c.value(), "left-center") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_CENTER_LEFT;
else if ( match(c.value(), "left-top") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::DROP_SHADOW_TOP_LEFT;
else if ( match(c.value(), "outline") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::OUTLINE;
else if ( match(c.value(), "none") )
style.getOrCreate<TextSymbol>()->haloBackdropType() = osgText::Text::NONE;
}
else if ( match(c.key(), "text-halo-implementation") ) {
if ( match(c.value(), "polygon-offset") )
style.getOrCreate<TextSymbol>()->haloImplementation() = osgText::Text::POLYGON_OFFSET;
else if ( match(c.value(), "no-depth-buffer") )
style.getOrCreate<TextSymbol>()->haloImplementation() = osgText::Text::NO_DEPTH_BUFFER;
else if ( match(c.value(), "depth-range") )
style.getOrCreate<TextSymbol>()->haloImplementation() = osgText::Text::DEPTH_RANGE;
else if ( match(c.value(), "stencil-buffer") )
style.getOrCreate<TextSymbol>()->haloImplementation() = osgText::Text::STENCIL_BUFFER;
else if ( match(c.value(), "delayed-depth-writes") )
style.getOrCreate<TextSymbol>()->haloImplementation() = osgText::Text::DELAYED_DEPTH_WRITES;
}
else if ( match(c.key(), "text-remove-duplicate-labels") ) {
if ( c.value() == "true" )
style.getOrCreate<TextSymbol>()->removeDuplicateLabels() = true;
else if (c.value() == "false")
style.getOrCreate<TextSymbol>()->removeDuplicateLabels() = false;
}
else if ( match(c.key(), "text-align") ) {
if ( match(c.value(), "left-top") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_LEFT_TOP;
else if ( match(c.value(), "left-center") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_LEFT_CENTER;
else if ( match(c.value(), "left-bottom") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_LEFT_BOTTOM;
else if ( match(c.value(), "center-top") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_TOP;
else if ( match(c.value(), "center-center") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_CENTER;
else if ( match(c.value(), "center-bottom") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_BOTTOM;
else if ( match(c.value(), "right-top") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_RIGHT_TOP;
else if ( match(c.value(), "right-center") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_RIGHT_CENTER;
else if ( match(c.value(), "right-bottom") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_RIGHT_BOTTOM;
else if ( match(c.value(), "left-base-line") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_LEFT_BASE_LINE;
else if ( match(c.value(), "center-base-line") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_BASE_LINE;
else if ( match(c.value(), "right-base-line") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_RIGHT_BASE_LINE;
else if ( match(c.value(), "left-bottom-base-line") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_LEFT_BOTTOM_BASE_LINE;
else if ( match(c.value(), "center-bottom-base-line") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_CENTER_BOTTOM_BASE_LINE;
else if ( match(c.value(), "right-bottom-base-line") )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_RIGHT_BOTTOM_BASE_LINE;
else if ( match(c.value(), "base-line" ) )
style.getOrCreate<TextSymbol>()->alignment() = TextSymbol::ALIGN_BASE_LINE;
}
else if ( match(c.key(), "text-layout") ) {
if ( match(c.value(), "ltr") )
style.getOrCreate<TextSymbol>()->layout() = TextSymbol::LAYOUT_LEFT_TO_RIGHT;
//.........这里部分代码省略.........