x:-89.4588 y:-12.1245 z:-11.7807
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.2164 y:-9.07239 z:-11.811
x:-89.4588 y:-12.1245 z:-11.7807
x:-89.2164 y:-9.07239 z:-11.811
x:-89.2164 y:-15.9458 z:-11.811
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.2164 y:-2.19896 z:-11.811
x:-89.2164 y:-9.07239 z:-11.811
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.4959 y:-2.57999 z:-11.7705
x:-89.2164 y:-2.19896 z:-11.811
x:-89.6451 y:-4.75968 z:-11.7127
x:-89.4959 y:-2.57999 z:-11.7705
x:-89.4588 y:-6.44823 z:-11.7807
x:-89.6451 y:-4.75968 z:-11.7127
x:-89.7325 y:1.15286 z:-11.6649
x:-89.4959 y:-2.57999 z:-11.7705
x:-89.7325 y:1.15286 z:-11.6649
x:-89.6451 y:-4.75968 z:-11.7127
x:-89.8026 y:-2.48957 z:-11.6174
x:-89.8026 y:-2.48957 z:-11.6174
x:-89.8883 y:1.02162 z:-11.5459

#ifdef _WIN32
#include <Windows.h>
#endif // _WIN32
#include<iostream> #include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/CompositeViewer>
#include <osgDB/ReadFile>
#include <osg/Geode>
#include <osg/Node>
#include <osg/Geometry>
#include <osgGA/TrackballManipulator>
#include <osg/GraphicsContext>
#include <osg/ShapeDrawable>
#include <osg/Material>
#include <osg/Image>
#include <osg/Texture2D>
#include <osg/TexEnv>
#include <osg/TexGen>
#include <osg/NodeVisitor>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/AnimationPath>
#include <osg/Matrixd> #include <osgGA/GUIEventHandler>
#include <osgGA/CameraManipulator>
#include <osgGA/StandardManipulator>
#include <osgGA/OrbitManipulator>
#include <osgGA/TrackballManipulator>
#include <osgUtil/IntersectionVisitor>
#include <osgUtil/LineSegmentIntersector> class BoundVisitor :public osg::NodeVisitor
{
public:
BoundVisitor() :osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent()
{
std::cout << "--" << std::endl;
} virtual void apply(osg::Geode &geode)
{
//osg::Drawable *drawable1= geode.getDrawable(0);
unsigned int count = geode.getNumDrawables();
for (int i = ; i < count; i++)
{
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();
for (int j = ; j<vertexlNum; 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;
}
}
} protected:
int _indent;
}; int main()
{
osg::ref_ptr<osgViewer::Viewer> viewer1 = new osgViewer::Viewer;
osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\build1.OSGB");
BoundVisitor bv; node1->accept(bv);
viewer1->setSceneData(node1); viewer1->setUpViewInWindow(, , , , ); return viewer1->run();
}

osg::NodeVisitor osg3.4.0的更多相关文章

  1. osg::NodeVisitor

    [1]osg::Group [2]osg::PositionAttitudeTransform [2]osg::MatrixTransform [3]osg::Geode [2]osg::Matrix ...

  2. osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标

    class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...

  3. win10 + VS2015 + 64位OSG3.4.0

    一.下载 1.osg源码 2.整理好的第三方库 3.cmake3.7.1绿色版 4.osg3.4.0数据包 二.编译前的准备工作 在D:\下新建一个OSG文件夹,在其下再新建4个文件夹 D:\OSG\ ...

  4. win10操作系统vs2010编译osg3.4.0问题解决记录

    参考博客:OSG3.4.0+VS2010+WIN10编译及二次开发环境搭建 链接:https://blog.csdn.net/hsc1239653453/article/details/7827856 ...

  5. osg::NodeVisitor example

    [0]osg::Group [1]osg::MatrixTransform [1] osg::MatrixTransform [1]osg::MatrixTransform [2] osg::Geod ...

  6. vs2016x64&&qt5.7.1编译osg3.4.0&&osgEarth2.7

    此文仅备忘: 1.安装VS2013_Cn_Ult 2.安装qt-opensource-windows-x86-msvc2013_64-5.7.1 设置环境变量QTDIR,并将其bin加入到path中. ...

  7. vs2013x64&&qt5.7.1编译osg3.4.0&&osgEarth2.7

    此文仅备忘: 1.安装VS2013_Cn_Ult 2.安装qt-opensource-windows-x86-msvc2013_64-5.7.1 设置环境变量QTDIR,并将其bin加入到path中. ...

  8. OSG程序设计之osg::NodeVisitor

    本文所有内容来自<OpenSceneGraph三维渲染引擎设计与实践>一书. 本文主要讨论的是OSG中节点的访问. 对于节点的访问是从节点接收一个访问器开始的,用户执行某个节点的accep ...

  9. VS2013环境下配置OSG(3.4.0版本)

    参考链接1: http://blog.csdn.net/lonsegdi/article/details/50579439 参考链接2: http://bbs.osgchina.org/forum.p ...

随机推荐

  1. re模块及其用法

    一.re模块下的常用方法 首先在使用re模块之前,需要引入re模块 import re 1.与查找相关的: 1.findall 返回列表,找到所有的匹配项 ret = re.findall(" ...

  2. 微信支付报调用支付JSAPI缺少参数: sign

    检查后台返回参数中没有paySign字段

  3. 4.BeanFactory和ApplicationContext的区别

    ApplicationContext和BeanFactory都是用于加载Bean的, 但是二者之间存在区别, ApplicationContext能够提供更多的扩展功能. 1).BeanFactory ...

  4. plsql工具使用

    作者:lhrbest 作者:张冲andy 作者:jack_孟

  5. 理解*arg 、**kwargs

    这两个是python中的可变参数.*args表示任何多个无名参数,它是一个tuple(元祖):**kwargs表示关键字参数,它是一个dict(字典).并且同时使用*args和**kwargs时,必须 ...

  6. 前端项目中的必要文件-【robots.txt】

    放在src文件下::   robots.txt     告诉搜索引擎,该网站的被允许扒取得网页和静止扒取得     facicon.ico      网站地址栏的显示图   humans.txt   ...

  7. @select注解中可以用条件构造器

    https://mp.baomidou.com/guide/wrapper.html#lambda https://blog.csdn.net/weixin_42236404/article/deta ...

  8. man与info

    Linux系统中在线求助命令:man page 与info page 还有--help . --help没有man的详细,首先我们来看mna 命令.在linux中输入 man + 相关的文件 ,就可以 ...

  9. Linux 查看系统配置参数

    原文链接:http://www.cnblogs.com/aric2016/p/10971690.html 查看 cpu信息: cat /proc/cpuinfo 查看内存信息: grep MemTot ...

  10. The Boot Process at a Glance x86/x64系统启动过程解析

    哥又来干体力活了.人肉翻译一下: The Boot Process at a Glance This section explains the boot process in sufficient d ...