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


C++ ref_ptr::getChild方法代码示例

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


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

示例1: out_of_range

osg::Object *RefosgLOD::getChildObject(unsigned i) {
	if (i < 1) {
		return _object->getStateSet();
	} else {
		i -= 1;
	}
	if (i < 1) {
		return _object->getCullCallback();
	} else {
		i -= 1;
	}
	if (i < 1) {
		return _object->getUpdateCallback();
	} else {
		i -= 1;
	}
	if (i < 1) {
		return _object->getEventCallback();
	} else {
		i -= 1;
	}
	if (i < _object->getNumChildren()) {
		return _object->getChild(i);
	} else {
		i -= _object->getNumChildren();
	}
	throw std::out_of_range("child");
}
开发者ID:whztt07,项目名称:osgedit,代码行数:28,代码来源:reflect_osg_lod.cpp

示例2:

const ClassReflection::PropertyNames RefosgLOD::getTablePropertyRowTitles(const std::string &name) {
	PropertyNames titles;
	if (name == "_ranges") {
		for (unsigned i=0; i < _object->getNumChildren(); i++) {
			titles.push_back(_object->getChild(i)->getName());
		}
	}
	return titles;
}
开发者ID:whztt07,项目名称:osgedit,代码行数:9,代码来源:reflect_osg_lod.cpp

示例3: UpdateTriangleNode

void UpdateTriangleNode(osg::ref_ptr<osg::Group> const &gp,
                        osg::Vec4 const &color)
{
    // Change the color of the triangle if
    // its currently intersecting the view frustum

    osg::Geode * gd = static_cast<osg::Geode*>(gp->getChild(0));
    osg::Geometry * gm = static_cast<osg::Geometry*>(gd->getDrawable(0));

    osg::ref_ptr<osg::Vec4Array> list_cx = new osg::Vec4Array;
    list_cx->push_back(color);

    gm->setColorArray(list_cx,osg::Array::BIND_OVERALL);
}
开发者ID:lanixXx,项目名称:scratch,代码行数:14,代码来源:sat.cpp

示例4: previousSlide

void SlideEventHandler::previousSlide()
{
    if (_switch->getNumChildren()==0) return;

    if (_fileList.size()>0) {
        if (_activeSlide==0) _activeSlide = _fileList.size()/2-1;
        else --_activeSlide;
        osg::ref_ptr<osg::Group> images = loadImages(_fileList[2*_activeSlide],_fileList[2*_activeSlide+1],_texmatLeft.get(),_texmatRight.get(),_radius,_height,_length);
        if (images.valid()) _switch->replaceChild(_switch->getChild(0),images.get());
    } else {
        if (_activeSlide==0) _activeSlide = _switch->getNumChildren()-1;
        else --_activeSlide;

        _switch->setSingleChildOn(_activeSlide);
    }
}
开发者ID:nsmoooose,项目名称:osg,代码行数:16,代码来源:osgstereoimage.cpp

示例5: addSimpleObject

// insert a sphere in the scene with desired position, radius and reflectance properties
void addSimpleObject(osg::ref_ptr<osg::Group> root, osg::Vec3 position, float radius, float reflectance) {
    // create the drawable
    osg::ref_ptr<osg::Drawable> drawable = new osg::ShapeDrawable(new osg::Sphere(position, radius));

    // create the stateset and add the uniform
    osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet();
    stateset->addUniform(new osg::Uniform("reflectance", reflectance));

    // add the stateset to the drawable
    drawable->setStateSet(stateset);

    if(!root->getNumChildren()) {
        osg::ref_ptr<osg::Geode> geode = new osg::Geode();
        root->addChild(geode);
    }

    root->getChild(0)->asGeode()->addDrawable(drawable);
}
开发者ID:rock-gazebo,项目名称:simulation-normal_depth_map,代码行数:19,代码来源:MaterialProperties_test.cpp


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