当前位置: 首页>>代码示例>>C++>>正文


C++ GeometryFactory::createRectangle方法代码示例

本文整理汇总了C++中GeometryFactory::createRectangle方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryFactory::createRectangle方法的具体用法?C++ GeometryFactory::createRectangle怎么用?C++ GeometryFactory::createRectangle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeometryFactory的用法示例。


在下文中一共展示了GeometryFactory::createRectangle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getDecoration

void
RectangleNode::rebuild()
{    
    std::string currentDecoration = getDecoration();
    clearDecoration();

    // Reset:
    osgEarth::clearChildren( this );
    osgEarth::clearChildren( _xform.get() );
    this->addChild( _xform.get() );

    // construct a local-origin circle.
    GeometryFactory factory;    
    Geometry* geom = factory.createRectangle(osg::Vec3d(0,0,0), _width, _height);
    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 );
            replaceChild( _xform.get(), applyAltitudePolicy(_xform.get(), _style) );
        }

        applyRenderSymbology( _style );
        setLightingIfNotSet( false );
    }

    setDecoration( currentDecoration );
}
开发者ID:omega-hub,项目名称:osgearth,代码行数:31,代码来源:RectangleNode.cpp

示例2: getPositionAttitudeTransform

void
RectangleNode::rebuild()
{    
    osgEarth::clearChildren( getPositionAttitudeTransform() );

    // construct a local-origin circle.
    GeometryFactory factory;    
    Geometry* geom = factory.createRectangle(osg::Vec3d(0,0,0), _width, _height);
    if ( geom )
    {
        GeometryCompiler compiler;
        osg::ref_ptr<osg::Node> node = compiler.compile( geom, _style, FilterContext() );
        if ( node )
        {
            node = AnnotationUtils::installOverlayParent( node.get(), _style );
            getPositionAttitudeTransform()->addChild( node.get() );
        }

        applyRenderSymbology( _style );
        setLightingIfNotSet( false );
    }
}
开发者ID:XenonofArcticus,项目名称:osgearth,代码行数:22,代码来源:RectangleNode.cpp

示例3: getDecoration

void
RectangleNode::rebuild()
{    
    std::string currentDecoration = getDecoration();
    clearDecoration();

    //Remove all children from this node
    //removeChildren( 0, getNumChildren() );
    if ( getRoot()->getNumParents() == 0 )
    {
        this->addChild( getRoot() );
    }

    //Remove all children from the attach point
    getChildAttachPoint()->removeChildren( 0, getChildAttachPoint()->getNumChildren() );

    // construct a local-origin circle.
    GeometryFactory factory;    
    Geometry* geom = factory.createRectangle(osg::Vec3d(0,0,0), _width, _height);
    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 )
        {
            getChildAttachPoint()->addChild( node );
            getOverlay()->setActive( _draped );
        }

        applyStyle( _style );

        setLightingIfNotSet( false );
    }

    setDecoration( currentDecoration );
}
开发者ID:hicom150,项目名称:osgearth,代码行数:37,代码来源:RectangleNode.cpp


注:本文中的GeometryFactory::createRectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。