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();
}

最新文章

  1. Hibernate--------八大类HQL查询集合
  2. js操作新添加的DOM的问题
  3. Google Developing for Android 三 - Performance最佳实践
  4. 学C#你应该熟练使用ILDasm和Reflector【带视频教程】
  5. 采用Hibernate框架的研发平台如何能够真正兼容Oracle和sqlServer数据库
  6. wpf:小问题总结
  7. OpenCV3编程入门笔记(4)腐蚀、膨胀、开闭运算、漫水填充、金字塔、阈值化、霍夫变换
  8. SQL中的内连接外连接和交叉连接是什么意思?
  9. A JavaFX based Game Authoring System
  10. wampserver修改mysql数据库密码后phpMyAdmin无法连接数据库
  11. 判断ios是app第一次启动
  12. elasticsearch中的概念简述
  13. Java基础语法&lt;六&gt; 数组 Arrays
  14. MarkDown里面的Emoji表情
  15. 【区块链】【一】Hash 算法【转】
  16. 自定义标签TLD文件中,rtexprvalue子标签的意思
  17. django之ORM专项训练之图书信息系统 了不起的双下方法实战 和 分组 聚合 Q, F查询,有約束和無約束
  18. 【WebService】使用CXF开发WebService(四)
  19. Typescript 接口(interface)
  20. jquery合并表格中相同文本的相邻单元格

热门文章

  1. Django modle基础样版
  2. 解决服务器openssh漏洞
  3. Bcompare 提示 “这个授权密钥已被吊销” 解决方法
  4. cookie和session基础知识学习
  5. matlab(4) Logistic regression:求θ的值使用fminunc / 画decision boundary(直线)plotDecisionBoundary
  6. Java原子类--AtomicLongArray
  7. Define Interfaces and Share Class Members through Mixins in Dart
  8. 加入redis缓存的 优 缺 点以及解决方案
  9. msf爆破
  10. springboot与jdk1.6结合使用需要注意的地方