[1]osg::Group
        [2]osg::PositionAttitudeTransform
        [2]osg::MatrixTransform
                [3]osg::Geode
        [2]osg::MatrixTransform
        [2]osg::MatrixTransform
        [2]osg::MatrixTransform
        [2]osg::MatrixTransform
                [3]osg::Geode
                osg::Geometry
                        [4]osg::Geometry

class BoundVisitor :public osg::NodeVisitor
{
public:
//BoundVisitor():osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0)
//{ //} BoundVisitor() :osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent()
{
std::cout << "--" << std::endl;
} virtual void apply(osg::Node &node)
{
for (int i = ; i < _indent; ++i)
{
std::cout << "\t";
}
std::cout << "[" << _indent + << "]" << node.libraryName()<< "::" << node.className() << std::endl; _indent++;
traverse(node);
_indent--;
} virtual void apply(osg::Geode &geode)
{
for (int i = ; i < _indent; ++i)
{
std::cout << "\t";
}
std::cout << "[" << _indent + << "]" << geode.libraryName()<< "::" << geode.className() << std::endl; //osg::Drawable *drawable1= geode.getDrawable(0);
unsigned int count = geode.getNumDrawables();
for (int i = ; i < count; i++)
{
osg::Drawable *drawable = geode.getDrawable(i);
if (!drawable)
{
continue;
} osg::Geometry *geometry = geode.getDrawable(i)->asGeometry();
if (!geometry)
{
continue;
} // 顶点数据
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
//osg::Vec3Array vertices = geometry->getVertexArray();
int vertexlNum = vertices->size();
//std::cout << "size:"<<vertexlNum <<" "<< geometry->libraryName() <<" "<< geometry->getNumChildrenRequiringEventTraversal() << std::endl;
//geometry->libraryName(); //for (int j = 0; j<100; j++) {
//dstSubset.vertexs.push_back(vertices->at(j).x());
//dstSubset.vertexs.push_back(vertices->at(j).y());
//dstSubset.vertexs.push_back(vertices->at(j).z());
//std::cout << "x:" << vertices->at(j).x() << " y:" << vertices->at(j).y() << " z:" << vertices->at(j).z() << std::endl;
//} for (int i = ; i < _indent; ++i)
{
std::cout << "\t";
}
std::cout << drawable->libraryName()
<< "::" << drawable->className() << std::endl;
} _indent++;
traverse(geode);
_indent--;
} protected:
int _indent;
};

最新文章

  1. SQL Server里的文件和文件组
  2. AndroidManifest.xml中&lt;activity&gt;&lt;/activity&gt;相关属性说明
  3. java虚拟机和Dalvik虚拟机的区别
  4. [LintCode] Reverse Nodes in k-Group 每k个一组翻转链表
  5. 线程系列3---ThreadLocal类研究
  6. http://www.tracefact.net/CSharp-Programming/Delegates-and-Events-in-CSharp.aspx
  7. 如何在Fedora 22上面配置Apache的Docker容器
  8. wpa_supplicant 中的wpa_supplicant.conf
  9. North America Qualifier (2015)
  10. Tomcat 系统架构与设计模式,第 2 部分: 设计模式分析
  11. Frank自动化测试
  12. (转)ThinkPHP自定义标签
  13. Oracle Directory文件夹的知识
  14. 一个php user class
  15. AP模块发票过账标记为否检查方法
  16. ACM个人零散知识点整理
  17. 一、Python介绍
  18. 自学Aruba5.3.1-Aruba安全认证-有PEFNG 许可证环境的认证配置OPEN、PSK
  19. k8s单机部署1.11.5
  20. VisualVM、JConsole

热门文章

  1. 2019-ACM-ICPC-徐州站网络赛- I. query-二维偏序+树状数组
  2. P2P技术之STUN、TURN、ICE详解
  3. Makefile:248: /usr/local/otp_src_18.1/make/x86_64-unknown-linux-gnu/otp_ded.mk: No such file
  4. Z+F激光扫描仪
  5. js与json的区别,json的概述,json与面向对象,json与对象的转换
  6. 前端开发规范:命名规范、HTML 规范、CSS 规范、JavaScript 规范
  7. Hive的安装和配置
  8. React重置非受控组件state的方法
  9. 发布一个npm package
  10. 使用Keras训练神经网络备忘录