标签:style blog http io ar color os sp for
2014.12.5
这么多天的编译,终于把Boost+CGAL+Qt+Qt-Addin+libQGLViewer搞定了。。虽然../Demo/Polyhedron没有弄出来(编译全过,可是执行文件无法运行),但是把../Demo/AABB_Tree给弄通了。
AABB这个Demo感觉很实用。里面有Cut Plane,Intersection,Segements,需要把这个弄懂。
另外今天重新看了看学姐发给我的CGAL切割的例子,感觉有了新的收获,把链接记录下来:http://www.xpc-yx.com/2013/08/05/%e4%bd%bf%e7%94%a8cgal%e5%ae%9e%e7%8e%b0%e6%b2%bf%e7%9d%80%e9%bc%a0%e6%a0%87%e8%bd%a8%e8%bf%b9%e5%88%86%e5%89%b2%e6%a8%a1%e5%9e%8b/
Qt真的是一个很神奇的东西,感觉比MFC好用多了。
AABB Demo中,程序在..\CGAL\demo\AABB_tree\Scene.cpp里,其中Algorithm->Cut Plane->Intersection调用的函数为cut_segment_plane()。
1 void Scene::cut_segment_plane() 2 { 3 // Build tree (if build fail, exit) 4 build_facet_tree(); 5 if ( m_facet_tree.empty() ) { return; } 6 7 Plane plane = frame_plane(); //是否在这里可以修改呢? 8 9 // Compute intersections 10 typedef std::vector<Facet_tree::Object_and_primitive_id> Intersections; 11 Intersections intersections; 12 m_facet_tree.all_intersections(plane, std::back_inserter(intersections)); 13 14 // Fill data structure 15 m_cut_segments.clear(); 16 for ( Intersections::iterator it = intersections.begin(), 17 end = intersections.end() ; it != end ; ++it ) 18 { 19 const Segment* inter_seg = CGAL::object_cast<Segment>(&(it->first)); 20 21 if ( NULL != inter_seg ) 22 { 23 m_cut_segments.push_back(*inter_seg); 24 } 25 } 26 27 m_cut_plane = CUT_SEGMENTS; 28 }
标签:style blog http io ar color os sp for
原文地址:http://www.cnblogs.com/jast/p/4145187.html