本文整理汇总了C++中GeometryFactory::createEllipticalArc方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryFactory::createEllipticalArc方法的具体用法?C++ GeometryFactory::createEllipticalArc怎么用?C++ GeometryFactory::createEllipticalArc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryFactory
的用法示例。
在下文中一共展示了GeometryFactory::createEllipticalArc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPositionAttitudeTransform
void
EllipseNode::rebuild()
{
osgEarth::clearChildren( getPositionAttitudeTransform() );
// construct a local-origin ellipse.
GeometryFactory factory;
Geometry* geom = NULL;
if (std::abs(_arcEnd.as(Units::DEGREES) - _arcStart.as(Units::DEGREES)) >= 360.0)
{
geom = factory.createEllipse(osg::Vec3d(0,0,0), _radiusMajor, _radiusMinor, _rotationAngle, _numSegments);
}
else
{
geom = factory.createEllipticalArc(osg::Vec3d(0,0,0), _radiusMajor, _radiusMinor, _rotationAngle, _arcStart, _arcEnd, _numSegments, 0L, _pie);
}
if ( geom )
{
GeometryCompiler compiler;
osg::ref_ptr<Feature> feature = new Feature(geom, 0L); //todo: consider the SRS
osg::ref_ptr<osg::Node> node = compiler.compile( feature.get(), _style, FilterContext(0L) );
if ( node )
{
node = AnnotationUtils::installOverlayParent(node.get(), _style);
getPositionAttitudeTransform()->addChild( node.get() );
}
applyRenderSymbology( _style );
setLightingIfNotSet( false );
}
}
示例2: setGeometry
void
EllipseNode::rebuildGeometry()
{
// construct a local-origin ellipse.
GeometryFactory factory;
osg::ref_ptr<Geometry> geom;
if (std::abs(_arcEnd.as(Units::DEGREES) - _arcStart.as(Units::DEGREES)) >= 360.0)
{
geom = factory.createEllipse(osg::Vec3d(0,0,0), _radiusMajor, _radiusMinor, _rotationAngle, _numSegments);
}
else
{
geom = factory.createEllipticalArc(osg::Vec3d(0,0,0), _radiusMajor, _radiusMinor, _rotationAngle, _arcStart, _arcEnd, _numSegments, 0L, _pie);
}
if ( geom.valid() )
{
setGeometry( geom.get() );
}
}
示例3: getDecoration
void
EllipseNode::rebuild()
{
std::string currentDecoration = getDecoration();
clearDecoration();
//Remove all children from this node
osgEarth::clearChildren( this );
osgEarth::clearChildren( _xform.get() );
this->addChild( _xform.get() );
// construct a local-origin ellipse.
GeometryFactory factory;
Geometry* geom = NULL;
if (std::abs(_arcEnd.as(Units::DEGREES) - _arcStart.as(Units::DEGREES)) >= 360.0)
{
geom = factory.createEllipse(osg::Vec3d(0,0,0), _radiusMajor, _radiusMinor, _rotationAngle, _numSegments);
}
else
{
geom = factory.createEllipticalArc(osg::Vec3d(0,0,0), _radiusMajor, _radiusMinor, _rotationAngle, _arcStart, _arcEnd, _numSegments, 0L, _pie);
}
if ( geom )
{
GeometryCompiler compiler;
osg::ref_ptr<Feature> feature = new Feature(geom, 0L); //todo: consider the SRS
osg::Node* node = compiler.compile( feature.get(), _style, FilterContext(0L) );
if ( node )
{
_xform->addChild( node );
this->replaceChild( _xform.get(), applyAltitudePolicy(_xform.get(), _style) );
}
applyRenderSymbology( _style );
setLightingIfNotSet( false );
}
setDecoration( currentDecoration );
}