当前位置: 首页>>代码示例>>C++>>正文


C++ Triangulation::finite_faces_begin方法代码示例

本文整理汇总了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;
		}
	}	
开发者ID:martin-mfg,项目名称:voronoi-thesis-tester,代码行数:9,代码来源:problem.cpp

示例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;
		}
	}
开发者ID:martin-mfg,项目名称:voronoi-thesis-tester,代码行数:11,代码来源:problem.cpp

示例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;
开发者ID:Tonsty,项目名称:retiler,代码行数:66,代码来源:MeshEx_retriangulate.cpp


注:本文中的Triangulation::finite_faces_begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。