本文整理汇总了C++中AnnotationData::setDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ AnnotationData::setDescription方法的具体用法?C++ AnnotationData::setDescription怎么用?C++ AnnotationData::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnnotationData
的用法示例。
在下文中一共展示了AnnotationData::setDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vp
void
KML_Feature::build( const Config& conf, KMLContext& cx, osg::Node* working )
{
KML_Object::build(conf, cx, working);
// subclass feature is built; now add feature level data if available
if ( working )
{
// parse the visibility to show/hide the item by default:
if ( conf.hasValue("visibility") )
working->setNodeMask( conf.value<bool>("visibility",true) == true ? ~0 : 0 );
// parse a "LookAt" element (stores a viewpoint)
AnnotationData* anno = getOrCreateAnnotationData(working);
anno->setName( conf.value("name") );
anno->setDescription( conf.value("description") );
const Config& lookat = conf.child("lookat");
if ( !lookat.empty() )
{
Viewpoint vp(
lookat.value<double>("longitude", 0.0),
lookat.value<double>("latitude", 0.0),
lookat.value<double>("altitude", 0.0),
lookat.value<double>("heading", 0.0),
-lookat.value<double>("tilt", 45.0),
lookat.value<double>("range", 10000.0) );
anno->setViewpoint( vp );
}
}
}
示例2: getValue
void
KML_Feature::build( xml_node<>* node, KMLContext& cx, osg::Node* working )
{
KML_Object::build(node, cx, working);
// subclass feature is built; now add feature level data if available
if ( working )
{
// parse the visibility to show/hide the item by default:
std::string visibility = getValue(node, "visibility");
if ( !visibility.empty() )
working->setNodeMask( as<int>(visibility, 1) == 1 ? ~0 : 0 );
// parse a "LookAt" element (stores a viewpoint)
AnnotationData* anno = getOrCreateAnnotationData(working);
anno->setName( getValue(node, "name") );
anno->setDescription( getValue(node, "description") );
xml_node<>* lookat = node->first_node("lookat", 0, false);
if ( lookat )
{
Viewpoint vp;
vp.focalPoint() = GeoPoint(
cx._srs.get(),
as<double>(getValue(lookat, "longitude"), 0.0),
as<double>(getValue(lookat, "latitude"), 0.0),
as<double>(getValue(lookat, "altitude"), 0.0),
ALTMODE_ABSOLUTE );
vp.heading() = as<double>(getValue(lookat, "heading"), 0.0);
vp.pitch() = -as<double>(getValue(lookat, "tilt"), 45.0),
vp.range() = as<double>(getValue(lookat, "range"), 10000.0);
anno->setViewpoint( vp );
}
xml_node<>* extdata = node->first_node("extendeddata", 0, false);
if ( extdata )
{
xml_node<>* data = extdata->first_node("data", 0, false);
if ( data )
{
for (xml_node<>* n = data->first_node(); n; n = n->next_sibling())
{
working->setUserValue(getValue(n, "name"), getValue(n, "value"));
}
}
}
}
}