本文整理汇总了C++中TextSymbol::encoding方法的典型用法代码示例。如果您正苦于以下问题:C++ TextSymbol::encoding方法的具体用法?C++ TextSymbol::encoding怎么用?C++ TextSymbol::encoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextSymbol
的用法示例。
在下文中一共展示了TextSymbol::encoding方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
PlaceNode::setText( const std::string& text )
{
if ( !_dynamic )
{
OE_WARN << LC << "Illegal state: cannot change a LabelNode that is not dynamic" << std::endl;
return;
}
_text = text;
const osg::Geode::DrawableList& list = _geode->getDrawableList();
for( osg::Geode::DrawableList::const_iterator i = list.begin(); i != list.end(); ++i )
{
osgText::Text* d = dynamic_cast<osgText::Text*>( i->get() );
if ( d )
{
TextSymbol* symbol = _style.getOrCreate<TextSymbol>();
osgText::String::Encoding text_encoding = osgText::String::ENCODING_UNDEFINED;
if ( symbol && symbol->encoding().isSet() )
{
text_encoding = AnnotationUtils::convertTextSymbolEncoding(symbol->encoding().value());
}
d->setText( text, text_encoding );
break;
}
}
}
示例2:
void
PlaceNode::setText( const std::string& text )
{
if ( !_dynamic )
{
OE_WARN << LC << "Illegal state: cannot change a LabelNode that is not dynamic" << std::endl;
return;
}
_text = text;
for(unsigned i=0; i<_geode->getNumDrawables(); ++i)
{
osgText::Text* d = dynamic_cast<osgText::Text*>( _geode->getDrawable(i) );
if ( d )
{
TextSymbol* symbol = _style.getOrCreate<TextSymbol>();
osgText::String::Encoding text_encoding = osgText::String::ENCODING_UNDEFINED;
if ( symbol && symbol->encoding().isSet() )
{
text_encoding = AnnotationUtils::convertTextSymbolEncoding(symbol->encoding().value());
}
d->setText( text, text_encoding );
break;
}
}
}
示例3: giter
//.........这里部分代码省略.........
if ( model )
{
ModelNode* node = new ModelNode( cx._mapNode, style, cx._dbOptions );
node->setPosition( position );
// model scale:
if ( cx._options->modelScale() != 1.0f )
{
float s = *cx._options->modelScale();
node->setScale( osg::Vec3f(s,s,s) );
}
// model local tangent plane rotation:
if ( !cx._options->modelRotation()->zeroRotation() )
{
node->setLocalRotation( *cx._options->modelRotation() );
}
modelNode = node;
}
// is there a label?
else if ( !name.empty() )
{
if ( !text && cx._options->defaultTextSymbol().valid() )
{
text = cx._options->defaultTextSymbol().get();
style.addSymbol( text );
}
else
{
text = style.getOrCreate<TextSymbol>();
text->encoding() = TextSymbol::ENCODING_UTF8;
}
text->content()->setLiteral( name );
}
// is there an icon?
if ( icon )
{
iconNode = new PlaceNode( cx._mapNode, position, style, cx._dbOptions );
}
else if ( !model && text && !name.empty() )
{
// note: models do not get labels.
iconNode = new LabelNode( cx._mapNode, position, style );
}
}
// multiple coords? feature:
if ( geom->getTotalPointCount() > 1 )
{
ExtrusionSymbol* extruded = style.get<ExtrusionSymbol>();
// Remove symbols that we have already processed so the geometry
// compiler doesn't get confused.
if ( model )
style.removeSymbol( model );
if ( icon )
style.removeSymbol( icon );
if ( text )
style.removeSymbol( text );
Feature* feature = new Feature(geom, cx._srs.get(), style);
示例4: giter
//.........这里部分代码省略.........
AnnotationNode* modelNode = 0L;
// one coordinate? It's a place marker or a label.
if ( (model || icon || text) && geom->getTotalPointCount() == 1 )
{
// if there's a model, render that - models do NOT get labels.
if ( model )
{
ModelNode* node = new ModelNode( cx._mapNode, style, cx._dbOptions.get() );
node->setPosition( position );
// model scale:
if ( cx._options->modelScale() != 1.0f )
{
float s = *cx._options->modelScale();
node->getPositionAttitudeTransform()->setScale(osg::Vec3d(s,s,s));
}
// model local tangent plane rotation:
if ( !cx._options->modelRotation()->zeroRotation() )
{
node->getPositionAttitudeTransform()->setAttitude( *cx._options->modelRotation() );
}
modelNode = node;
}
// is there a label?
else if ( !name.empty() )
{
if ( !text )
{
text = style.getOrCreate<TextSymbol>();
text->encoding() = TextSymbol::ENCODING_UTF8;
}
text->content()->setLiteral( name );
}
// is there an icon?
if ( icon )
{
PlaceNode* placeNode = new PlaceNode( position );
placeNode->setStyle(style, cx._dbOptions.get());
iconNode = placeNode;
}
else if ( !model && text && !name.empty() )
{
// note: models do not get labels.
iconNode = new LabelNode();
iconNode->setStyle(style);
}
}
// multiple coords? feature:
if ( geom->getTotalPointCount() > 1 )
{
// Remove symbols that we have already processed so the geometry
// compiler doesn't get confused.
if ( model )
style.removeSymbol( model );
if ( icon )
style.removeSymbol( icon );
if ( text )
style.removeSymbol( text );