本文整理汇总了C++中Triangulation::finite_faces_begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::finite_faces_begin方法的具体用法?C++ Triangulation::finite_faces_begin怎么用?C++ Triangulation::finite_faces_begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangulation
的用法示例。
在下文中一共展示了Triangulation::finite_faces_begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_triangles
void print_triangles(Triangulation dt){
Point p;
Triangle tri;
Triangulation::Finite_faces_iterator it;
for (it = dt.finite_faces_begin(); it != dt.finite_faces_end(); it++) {
tri = dt.triangle(it);
cout << "Triangle: " << tri << endl;
}
}
示例2: print_circles
void print_circles(Triangulation dt){
Point p;
Triangle tri;
Triangulation::Finite_faces_iterator it;
for (it = dt.finite_faces_begin(); it != dt.finite_faces_end(); it++) {
p=dt.circumcenter(it);
tri = dt.triangle(it);
cout << "Circle center located at: " << p << " and with radius: "
<< squared_distance(p, tri.vertex(0)) << endl;
}
}
示例3: retriangulateHole
//.........这里部分代码省略.........
v2_found = true;
}
}
// add constrainedge to the triangulation
t.insert_constraint( v1, v2 );
// add edge to the list of created/existing edges
edges.push_back( e );
}
// add additional and optional interior points
for( std::vector<std::pair<math::Vec3f, math::Vec2f> >::iterator it = interiorPoints.begin(); it != interiorPoints.end(); ++it )
{
// update triangulation
Vertex_handle v = t.insert( Point( it->second.x, it->second.y ) );
// insertion may return a vertex which already exists (when the position is the same)
if( vertexMap.find( v ) == vertexMap.end() )
// create according MeshEx::Vertex and keep mapping to the CGAL vertices
vertexMap[v] = createVertex( it->first );
}
// extract results and create triangles ----------------------------------------
// now we have the triangulation of the convex hull of the whole problem, now we
// have to find the faces which are inside the polygon - we mark each face with a
// segment(inside or outside) property and by finding a face which is adjacent to
// a infinite face, we find the segment which is outside
// we employ some floodfilling scheme
for( Triangulation::Finite_faces_iterator it = t.finite_faces_begin(); it != t.finite_faces_end(); ++it )
// reset info to -1
it->info() = -1;
int outsideSegment = -1;
findOutsideSegment( t, t.finite_faces_begin(), 0, -1, outsideSegment );
if( outsideSegment == -1 )
printf( "error : outsideSegment not found during triangulation\n" );
for( Triangulation::Finite_faces_iterator it = t.finite_faces_begin(); it != t.finite_faces_end(); ++it )
if( (it->info() == -1) && (!t.is_infinite(it)) )
printf( "triangle not touched!\n" );
// iterate over all faces of the triangulation and create edges/triangles
for( Triangulation::Finite_faces_iterator it = t.finite_faces_begin(); it != t.finite_faces_end(); ++it )
{
Face_handle fh = it;
// we are only interested in interior triangles
if( fh->info() == outsideSegment )
continue;
MeshEx::Vertex *v0, *v1, *v2;
v0 = vertexMap[ fh->vertex(0) ];
v1 = vertexMap[ fh->vertex(1) ];
v2 = vertexMap[ fh->vertex(2) ];
MeshEx::Edge *e0, *e1, *e2;
e0 = e1 = e2 = 0;