osg::NodeVisitor
2024-08-30 05:14:03
[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;
};
最新文章
- SQL Server里的文件和文件组
- AndroidManifest.xml中<;activity>;<;/activity>;相关属性说明
- java虚拟机和Dalvik虚拟机的区别
- [LintCode] Reverse Nodes in k-Group 每k个一组翻转链表
- 线程系列3---ThreadLocal类研究
- http://www.tracefact.net/CSharp-Programming/Delegates-and-Events-in-CSharp.aspx
- 如何在Fedora 22上面配置Apache的Docker容器
- wpa_supplicant 中的wpa_supplicant.conf
- North America Qualifier (2015)
- Tomcat 系统架构与设计模式,第 2 部分: 设计模式分析
- Frank自动化测试
- (转)ThinkPHP自定义标签
- Oracle Directory文件夹的知识
- 一个php user class
- AP模块发票过账标记为否检查方法
- ACM个人零散知识点整理
- 一、Python介绍
- 自学Aruba5.3.1-Aruba安全认证-有PEFNG 许可证环境的认证配置OPEN、PSK
- k8s单机部署1.11.5
- VisualVM、JConsole
热门文章
- 2019-ACM-ICPC-徐州站网络赛- I. query-二维偏序+树状数组
- P2P技术之STUN、TURN、ICE详解
- Makefile:248: /usr/local/otp_src_18.1/make/x86_64-unknown-linux-gnu/otp_ded.mk: No such file
- Z+F激光扫描仪
- js与json的区别,json的概述,json与面向对象,json与对象的转换
- 前端开发规范:命名规范、HTML 规范、CSS 规范、JavaScript 规范
- Hive的安装和配置
- React重置非受控组件state的方法
- 发布一个npm package
- 使用Keras训练神经网络备忘录