本文整理汇总了C++中AnnotationData::setPriority方法的典型用法代码示例。如果您正苦于以下问题:C++ AnnotationData::setPriority方法的具体用法?C++ AnnotationData::setPriority怎么用?C++ AnnotationData::setPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnnotationData
的用法示例。
在下文中一共展示了AnnotationData::setPriority方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makePlaceNode
osg::Node* makePlaceNode(FilterContext& context,
Feature* feature,
const Style& style,
NumericExpression& priorityExpr )
{
osg::Vec3d center = feature->getGeometry()->getBounds().center();
AltitudeMode mode = ALTMODE_ABSOLUTE;
const AltitudeSymbol* alt = style.getSymbol<AltitudeSymbol>();
if (alt &&
(alt->clamping() == AltitudeSymbol::CLAMP_TO_TERRAIN || alt->clamping() == AltitudeSymbol::CLAMP_RELATIVE_TO_TERRAIN) &&
alt->technique() == AltitudeSymbol::TECHNIQUE_SCENE)
{
mode = ALTMODE_RELATIVE;
}
GeoPoint point(feature->getSRS(), center.x(), center.y(), center.z(), mode);
PlaceNode* node = new PlaceNode(0L, point, style, context.getDBOptions());
if ( !priorityExpr.empty() )
{
AnnotationData* data = new AnnotationData();
data->setPriority( feature->eval(priorityExpr, &context) );
node->setAnnotationData( data );
}
return node;
}
示例2: pos
/** Builds a bunch of tracks. */
void
createTrackNodes( MapNode* mapNode, osg::Group* parent, const TrackNodeFieldSchema& schema, TrackSims& sims )
{
// load an icon to use:
osg::ref_ptr<osg::Image> srcImage = osgDB::readImageFile( ICON_URL );
osg::ref_ptr<osg::Image> image;
ImageUtils::resizeImage( srcImage.get(), ICON_SIZE, ICON_SIZE, image );
// make some tracks, choosing a random simulation for each.
Random prng;
const SpatialReference* geoSRS = mapNode->getMapSRS()->getGeographicSRS();
for( unsigned i=0; i<g_numTracks; ++i )
{
double lon0 = -180.0 + prng.next() * 360.0;
double lat0 = -80.0 + prng.next() * 160.0;
GeoPoint pos(geoSRS, lon0, lat0);
TrackNode* track = new TrackNode(mapNode, pos, image, schema);
track->setFieldValue( FIELD_NAME, Stringify() << "Track:" << i );
track->setFieldValue( FIELD_POSITION, Stringify() << s_format(pos) );
track->setFieldValue( FIELD_NUMBER, Stringify() << (1 + prng.next(9)) );
// add a priority
AnnotationData* data = new AnnotationData();
data->setPriority( float(i) );
track->setAnnotationData( data );
Decluttering::setEnabled(track->getOrCreateStateSet(), true);
parent->addChild( track );
// add a simulator for this guy
double lon1 = -180.0 + prng.next() * 360.0;
double lat1 = -80.0 + prng.next() * 160.0;
TrackSim* sim = new TrackSim();
sim->_track = track;
sim->_startLat = lat0; sim->_startLon = lon0;
sim->_endLat = lat1; sim->_endLon = lon1;
sims.push_back( sim );
}
}
示例3: makePlaceNode
osg::Node* makePlaceNode(const FilterContext& context,
const Feature* feature,
const Style& style,
NumericExpression& priorityExpr )
{
osg::Vec3d center = feature->getGeometry()->getBounds().center();
GeoPoint point(feature->getSRS(), center.x(), center.y());
PlaceNode* placeNode = new PlaceNode(0L, point, style, context.getDBOptions());
if ( !priorityExpr.empty() )
{
AnnotationData* data = new AnnotationData();
data->setPriority( feature->eval(priorityExpr, &context) );
placeNode->setAnnotationData( data );
}
return placeNode;
}
示例4: makeLabelNode
osg::Node* makeLabelNode(const FilterContext& context,
const Feature* feature,
const std::string& value,
const TextSymbol* text,
NumericExpression& priorityExpr )
{
LabelNode* labelNode = new LabelNode(
context.getSession()->getMapInfo().getProfile()->getSRS(),
GeoPoint(feature->getSRS(), feature->getGeometry()->getBounds().center()),
value,
text );
if ( text->priority().isSet() )
{
AnnotationData* data = new AnnotationData();
data->setPriority( feature->eval(priorityExpr, &context) );
labelNode->setAnnotationData( data );
}
return labelNode;
}