#include #include #include #include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point_3; int main(int argc, char* argv[]) { std::ifstream in( (argc>1)? argv[1] : "data/cloud.pol"); boost::property_tree::ptree tree; boost::property_tree::read_xml(in, tree); std::vector points; for(boost::property_tree::ptree::value_type& node : tree.get_child("PolySet.Polygon")){ boost::property_tree::ptree subtree = node.second; if( node.first == "Point" ){ for( boost::property_tree::ptree::value_type const& v : subtree.get_child( "" ) ) { std::string label = v.first; if ( label == "" ) { Point_3 p(subtree.get( label+".X"), subtree.get( label+".Y"), subtree.get( label+".Z")); points.push_back(p); } } } } std::cout << points.size() << " points read"<< std::endl; return 0; }