本文整理汇总了C++中Vertex_iterator::incident_halfedges方法的典型用法代码示例。如果您正苦于以下问题:C++ Vertex_iterator::incident_halfedges方法的具体用法?C++ Vertex_iterator::incident_halfedges怎么用?C++ Vertex_iterator::incident_halfedges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertex_iterator
的用法示例。
在下文中一共展示了Vertex_iterator::incident_halfedges方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_arr
//! Initialize an arrangement
void init_arr(Arrangement& arr, int verbose_level)
{
// Initialize the data of the halfedges of the arrangement.
Halfedge_iterator heit;
for (heit = arr.halfedges_begin(); heit != arr.halfedges_end(); ++heit)
heit->set_data(heit->curve().data() *
((heit->direction() == CGAL::ARR_LEFT_TO_RIGHT) ? 1 : 2));
// Initialize the data of the faces of the arrangement.
Face_iterator fit;
for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) {
unsigned int count = 0;
// Outer ccb
Outer_ccb_iterator ocit;
for (ocit = fit->outer_ccbs_begin(); ocit != fit->outer_ccbs_end(); ++ocit) {
Ccb_halfedge_circulator curr = *ocit;
do count += curr->data() * 2;
while (++curr != *ocit);
}
// Inner ccbs
Inner_ccb_iterator icit;
for (icit = fit->inner_ccbs_begin(); icit != fit->inner_ccbs_end(); ++icit) {
Ccb_halfedge_circulator curr = *icit;
do count += curr->data();
while (++curr != *icit);
}
fit->set_data(count);
}
// Initialize the data of the vertices of the arrangement.
Vertex_iterator vit;
for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) {
unsigned int count = 0;
if (vit->is_isolated()) count = vit->face()->data();
else {
Halfedge_around_vertex_const_circulator curr = vit->incident_halfedges();
do count += curr->data();
while (++curr != vit->incident_halfedges());
}
vit->set_data(count);
}
if (verbose_level > 0) std::cout << "Arrangement Input: " << std::endl;
if (verbose_level > 1) {
std::cout << "Halfedge Data: " << std::endl;
Halfedge_iterator heit;
for (heit = arr.halfedges_begin(); heit != arr.halfedges_end(); ++heit)
std::cout << heit->source()->point() << " "
<< heit->target()->point() << " " << heit->data()
<< std::endl;
}
if (verbose_level > 0) {
std::cout << "Face Data: " << std::endl;
Face_iterator fit;
for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit)
std::cout << fit->data() << std::endl;
}
}