本文整理汇总了C++中Halfedge_handle::face方法的典型用法代码示例。如果您正苦于以下问题:C++ Halfedge_handle::face方法的具体用法?C++ Halfedge_handle::face怎么用?C++ Halfedge_handle::face使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Halfedge_handle
的用法示例。
在下文中一共展示了Halfedge_handle::face方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_HalfedgeDS_decorator
void test_HalfedgeDS_decorator() {
// Simple instantiation of the default halfedge data structure.
typedef CGAL_HALFEDGEDS_DEFAULT<Dummy_traits_2> HDS;
typedef CGAL::HalfedgeDS_decorator<HDS> Decorator;
typedef HDS::Halfedge_handle Halfedge_handle;
typedef HDS::Face_handle Face_handle;
HDS hds;
Decorator decorator(hds);
// Check create single loop.
Halfedge_handle h = decorator.create_loop();
hds.normalize_border();
assert( hds.size_of_vertices() == 1);
assert( hds.size_of_halfedges() == 2);
assert( hds.size_of_faces() == 2);
assert( decorator.is_valid( false, 4));
// Restart with open segment.
hds.clear();
hds.normalize_border();
assert( decorator.is_valid( false, 4));
h = decorator.create_segment();
assert( hds.size_of_vertices() == 2);
assert( hds.size_of_halfedges() == 2);
assert( hds.size_of_faces() == 1);
assert( decorator.is_valid( false, 4));
// Create border edge and check normalization.
decorator.set_face( h->opposite(), Face_handle());
hds.normalize_border();
assert( hds.size_of_border_halfedges() == 1);
assert( hds.size_of_border_edges() == 1);
assert( decorator.normalized_border_is_valid());
decorator.set_face( h->opposite(), h->face());
hds.normalize_border();
assert( hds.size_of_border_halfedges() == 0);
assert( hds.size_of_border_edges() == 0);
assert( decorator.is_valid( false, 4));
// Extend edge to two triangles.
Halfedge_handle g = decorator.split_vertex( h, h);
assert( decorator.is_valid( false, 4));
assert( h != g);
assert( h->next()->next() == g);
assert( h == g->next()->next());
assert( h->opposite() == g->next());
assert( g->opposite() == h->next());
Halfedge_handle g2 = decorator.split_face(h->opposite(),g->opposite());
assert( decorator.is_valid( false, 4));
assert( h->opposite()->next() == g2);
assert( g2->next() == g);
decorator.split_vertex( g2, g->opposite());
assert( decorator.is_valid( false, 4));
assert( g->next()->next()->next()->next() == g);
Halfedge_handle g3 =
decorator.split_face( g2->next()->opposite(), h);
assert( decorator.is_valid( false, 4));
assert( g->next()->next()->next()->next() == g);
assert( h->next()->next()->next() == h);
assert( g3->next()->next()->next() == g3);
assert( g3->next() == g->opposite());
assert( g3->opposite()->next() == g2->opposite());
assert( g3->opposite() == h->next());
// Edge flip within the triangle.
Halfedge_handle g4 = decorator.flip_edge( g3);
assert( decorator.is_valid( false, 4));
assert( g4 == g3);
assert( g3->next()->next() == g2->opposite());
assert( g3->opposite()->next() == h);
assert( g->next()->next()->next()->next() == g);
assert( h->next()->next()->next() == h);
assert( g3->next()->next()->next() == g3);
// Reverse face orientation.
decorator.inside_out();
assert( decorator.is_valid( false, 4));
decorator.inside_out();
assert( decorator.is_valid( false, 4));
// Check hole manipulations.
decorator.make_hole(g);
hds.normalize_border();
assert( hds.size_of_border_halfedges() == 4);
assert( hds.size_of_border_edges() == 4);
assert( decorator.is_valid( false, 4));
// Reverse face orientation, deal also with the hole..
decorator.inside_out();
assert( decorator.is_valid( false, 3));
hds.normalize_border();
assert( decorator.is_valid( false, 4));
// Check add_face_to_border.
hds.clear();
h = decorator.create_loop();
decorator.make_hole( h->opposite());
hds.normalize_border();
assert( decorator.is_valid( false, 4));
decorator.add_face_to_border( h->opposite(), h->opposite());
assert( hds.size_of_halfedges() == 4);
//.........这里部分代码省略.........
示例2: test_HalfedgeDS_decorator2
void test_HalfedgeDS_decorator2() {
// Instantiation of the halfedge data structure using vector
// with max-bases for a polyhedral surface.
typedef CGAL::HalfedgeDS_vector< Dummy_traits_3,
CGAL::Polyhedron_items_3> HDS;
typedef CGAL::HalfedgeDS_decorator<HDS> Decorator;
typedef HDS::Halfedge_handle Halfedge_handle;
typedef HDS::Face_handle Face_handle;
HDS hds(4,10,3);
Decorator decorator(hds);
// Check create single loop.
Halfedge_handle h = decorator.create_loop();
hds.normalize_border();
assert( hds.size_of_vertices() == 1);
assert( hds.size_of_halfedges() == 2);
assert( hds.size_of_faces() == 2);
assert( decorator.is_valid( false, 4));
// Restart with open segment.
hds.clear();
hds.normalize_border();
assert( decorator.is_valid( false, 4));
h = decorator.create_segment();
assert( hds.size_of_vertices() == 2);
assert( hds.size_of_halfedges() == 2);
assert( hds.size_of_faces() == 1);
assert( decorator.is_valid( false, 3));
hds.normalize_border();
assert( decorator.is_valid( false, 4));
// Create border edge and check normalization.
decorator.set_face( h->opposite(), Face_handle());
hds.normalize_border();
assert( hds.size_of_border_halfedges() == 1);
assert( hds.size_of_border_edges() == 1);
assert( decorator.normalized_border_is_valid());
decorator.set_face( h->opposite(), h->face());
hds.normalize_border();
assert( hds.size_of_border_halfedges() == 0);
assert( hds.size_of_border_edges() == 0);
assert( decorator.is_valid( false, 4));
// Extend edge to two triangles.
Halfedge_handle g = decorator.split_vertex( h, h);
assert( decorator.is_valid( false, 3));
hds.normalize_border();
assert( decorator.is_valid( false, 4));
assert( h != g);
assert( h->next()->next() == g);
assert( h == g->next()->next());
assert( h->opposite() == g->next());
assert( g->opposite() == h->next());
Halfedge_handle g2 = decorator.split_face(h->opposite(),g->opposite());
hds.normalize_border();
assert( decorator.is_valid( false, 4));
assert( h->opposite()->next() == g2);
assert( g2->next() == g);
decorator.split_vertex( g2, g->opposite());
assert( decorator.is_valid( false, 3));
hds.normalize_border();
assert( decorator.is_valid( false, 4));
assert( g->next()->next()->next()->next() == g);
Halfedge_handle g3 =
decorator.split_face( g2->next()->opposite(), h);
hds.normalize_border();
assert( decorator.is_valid( false, 4));
assert( g->next()->next()->next()->next() == g);
assert( h->next()->next()->next() == h);
assert( g3->next()->next()->next() == g3);
assert( g3->next() == g->opposite());
assert( g3->opposite()->next() == g2->opposite());
assert( g3->opposite() == h->next());
// Edge flip within the triangle.
Halfedge_handle g4 = decorator.flip_edge( g3);
assert( decorator.is_valid( false, 3));
hds.normalize_border();
assert( decorator.is_valid( false, 4));
assert( g4 == g3);
assert( g3->next()->next() == g2->opposite());
assert( g3->opposite()->next() == h);
assert( g->next()->next()->next()->next() == g);
assert( h->next()->next()->next() == h);
assert( g3->next()->next()->next() == g3);
// Reverse face orientation.
decorator.inside_out();
assert( decorator.is_valid( false, 4));
}