예제 #1
0
VisiLibity::Polygon ConvertPolygonCGAL2Vis(Polygon_2 pgn)
{
    VisiLibity::Polygon cPoly;
    Polygon_2::Vertex_iterator cv ;
    for (cv=pgn.vertices_begin();cv!=pgn.vertices_end();++cv)
          {
              cPoly.push_back(VisiLibity::Point(cv->x(),cv->y()));
          };
    return cPoly;

}
예제 #2
0
 std::ostream& print_ostream(std::ostream &os) const {
   if (name) {
     os << "name: " << name << " ";
   } else {
     os << "name: anonymous ";
   }
   os << "p: (" << CGAL::to_double(p.x()) << ", " << CGAL::to_double(p.y()) << ") ";
   os << "adesired: " << adesired << " ";
   os << "area: " << CGAL::to_double(region.area()) << " ";
   os << "childrens: " << children.size() << " ";
   os << "region:";
   Polygon_2::Vertex_iterator pit;
   for (pit = region.vertices_begin();
        pit != region.vertices_end();
        ++pit) {
     os << " (" << CGAL::to_double(pit->x()) << ", " << CGAL::to_double(pit->y()) << ")";
   }
   return os;
 }