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


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

本文整理汇总了C++中Triangulation::number_of_finite_edges方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::number_of_finite_edges方法的具体用法?C++ Triangulation::number_of_finite_edges怎么用?C++ Triangulation::number_of_finite_edges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Triangulation的用法示例。


在下文中一共展示了Triangulation::number_of_finite_edges方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
	Triangulation triangulation;

	boost::filesystem::path input_pathname = "C:/Carleton/CGAL-4.4/demo/Polyhedron/data/elephant.off";

	// create_cubes(triangulation, 2, 2, 1 );
	read_off( triangulation, input_pathname.string() );

	// read_off(triangulation, "C:/Carleton/Meshes/holmes_off/geometry/octahedron.off"); 
	// read_off(triangulation, "C:/Carleton/CGAL-4.4/demo/Polyhedron/data/cube.off");
	// read_off(triangulation, "C:/Carleton/CGAL-4.4/demo/Polyhedron/data/ellipsoid.off");

#if 0
	for (auto cell = triangulation.finite_cells_begin(); cell != triangulation.finite_cells_end(); ++cell)
	{
		for (int i = 0; i < 4; ++i)
		{
			Point p = cell->vertex(i)->point();
			assert(-10.0 < p.x() && p.x() < +10.0);
			assert(-10.0 < p.y() && p.y() < +10.0);
			assert(-10.0 < p.z() && p.z() < +10.0);
		}
	}
#endif

	set_cell_and_vertex_ids(triangulation);
	set_random_weights(triangulation);
	propagate_weights(triangulation);

	std::cout << "Number of finite vertices : " << triangulation.number_of_vertices() << std::endl;
	std::cout << "Number of finite edges    : " << triangulation.number_of_finite_edges() << std::endl;
	std::cout << "Number of finite facets   : " << triangulation.number_of_finite_facets() << std::endl;
	std::cout << "Number of finite cells    : " << triangulation.number_of_finite_cells() << std::endl;

	std::string filename = input_pathname.filename().stem().string() + "_tet.vtk";
	write_vtk( triangulation, filename );

	if (triangulation.number_of_finite_cells() < 100)
	{
		dump_triangulation(triangulation);
	}

	Graph graph;

	create_steiner_points(graph,triangulation);

	// the distances are temporary, so we choose an external property for that
	std::vector<double> distances(num_vertices(graph));
	std::vector<GraphNode_descriptor> predecessors(num_vertices(graph));

	boost::dijkstra_shortest_paths(
		graph, 
		*vertices(graph).first, 
		boost::weight_map(get(&GraphEdge::weight, graph)).
		distance_map(boost::make_iterator_property_map(distances.begin(), get(boost::vertex_index, graph))).
		predecessor_map(boost::make_iterator_property_map(predecessors.begin(), get(boost::vertex_index, graph)))
	);
	
	filename = input_pathname.filename().stem().string() + "_wsp.vtk";
	write_shortest_path_vtk( graph, predecessors, distances, filename );

	// write_graph_dot("graph.dot", graph);

	std::cout << "This is the end..." << std::endl;

	return EXIT_SUCCESS;
}
开发者ID:FrankBau,项目名称:wsp3d,代码行数:68,代码来源:main.cpp


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