本文整理汇总了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;
}