# 【原创】CGAL中，2D Arrangements学习笔记

2D Arrangement类型简介：

2D Arrangement类型基本使用方法：

1、构造组成

2、迭代访问

template<class Arrangement>
void print_arrangement (const Arrangement& arr)
{
CGAL_precondition (arr.is_valid());
// Print the arrangement vertices.
typename Arrangement::Vertex_const_iterator vit;
std::cout << arr.number_of_vertices() << " vertices:" << std::endl;
for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit)
{
std::cout << "(" << vit->point() << ")";
if (vit->is_isolated())
std::cout << " - Isolated." << std::endl;
else
std::cout << " - degree " << vit->degree() << std::endl;
}

// Print the arrangement edges.
typename Arrangement::Edge_const_iterator    eit;
std::cout << arr.number_of_edges() << " edges:" << std::endl;
for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit)
std::cout << "[" << eit->curve() << "]" << std::endl;

// Print the arrangement faces.
typename Arrangement::Face_const_iterator    fit;
std::cout << arr.number_of_faces() << " faces:" << std::endl;
for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit)
print_face<Arrangement> (fit);
return;
}

A

B

posted @ 2013-04-14 13:06  编号一百零二  阅读(1702)  评论(0编辑  收藏  举报