Merge pull request #702 from afabri/CGAL-source-GF

Use source() not prefixed with boost::
This commit is contained in:
Sebastien Loriot 2016-02-03 09:45:01 +01:00
commit 4f737d4682
9 changed files with 37 additions and 33 deletions

View File

@ -153,7 +153,7 @@ struct Propagate_normal_orientation
typedef typename MST_graph::vertex_descriptor vertex_descriptor;
// Gets source normal
vertex_descriptor source_vertex = boost::source(edge, mst_graph);
vertex_descriptor source_vertex = source(edge, mst_graph);
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
const Vector source_normal = get(mst_graph.m_normal_pmap, mst_graph[source_vertex].input_point);
#else
@ -161,7 +161,7 @@ struct Propagate_normal_orientation
#endif
const bool source_normal_is_oriented = mst_graph[source_vertex].is_oriented;
// Gets target normal
vertex_descriptor target_vertex = boost::target(edge, mst_graph);
vertex_descriptor target_vertex = target(edge, mst_graph);
#ifdef CGAL_USE_PROPERTY_MAPS_API_V1
const Vector& target_normal = get( mst_graph.m_normal_pmap, mst_graph[target_vertex].input_point);
#else
@ -394,9 +394,9 @@ create_riemannian_graph(
// Add edge
typename boost::graph_traits<Riemannian_graph>::edge_descriptor e;
bool inserted;
boost::tie(e, inserted) = boost::add_edge(boost::vertex(it_index, riemannian_graph),
boost::vertex(neighbor_index, riemannian_graph),
riemannian_graph);
boost::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph),
vertex(neighbor_index, riemannian_graph),
riemannian_graph);
CGAL_point_set_processing_assertion(inserted);
// -> ->
@ -472,7 +472,7 @@ create_mst_graph(
CGAL_point_set_processing_precondition(first != beyond);
// Number of input points
const std::size_t num_input_points = boost::num_vertices(riemannian_graph);
const std::size_t num_input_points = num_vertices(riemannian_graph);
std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Calls boost::prim_minimum_spanning_tree()\n");
@ -484,7 +484,7 @@ create_mst_graph(
PredecessorMap predecessor(num_input_points);
boost::prim_minimum_spanning_tree(riemannian_graph, &predecessor[0],
weight_map( riemannian_graph_weight_map )
.root_vertex( boost::vertex(source_point_index, riemannian_graph) ));
.root_vertex( vertex(source_point_index, riemannian_graph) ));
memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20);
CGAL_TRACE(" Creates MST Graph\n");
@ -514,9 +514,9 @@ create_mst_graph(
// check that bi-directed graph is useless
CGAL_point_set_processing_assertion(predecessor[predecessor[i]] != i);
boost::add_edge(boost::vertex(predecessor[i], mst_graph),
boost::vertex(i, mst_graph),
mst_graph);
add_edge(vertex(predecessor[i], mst_graph),
vertex(i, mst_graph),
mst_graph);
}
}
@ -631,7 +631,7 @@ mst_orient_normals(
Propagate_normal_orientation<ForwardIterator, NormalPMap, Kernel> orienter;
std::size_t source_point_index = get(index_pmap, source_point);
boost::breadth_first_search(mst_graph,
boost::vertex(source_point_index, mst_graph), // source
vertex(source_point_index, mst_graph), // source
visitor(boost::make_bfs_visitor(orienter)));
// Copy points with robust normal orientation to oriented_points[], the others to unoriented_points[].
@ -639,7 +639,7 @@ mst_orient_normals(
for (ForwardIterator it = first; it != beyond; it++)
{
std::size_t it_index = get(index_pmap,it);
typename MST_graph::vertex_descriptor v = boost::vertex(it_index, mst_graph);
typename MST_graph::vertex_descriptor v = vertex(it_index, mst_graph);
if (mst_graph[v].is_oriented)
oriented_points.push_back(*it);
else

View File

@ -1459,7 +1459,7 @@ private:
{
vertex_iterator current, end;
for (boost::tie(current, end) = boost::vertices(m_graph); current != end; ++current)
for (boost::tie(current, end) = vertices(m_graph); current != end; ++current)
{
std::size_t vertexIndex = get(m_vertexIndexMap, *current);
@ -1832,7 +1832,7 @@ private:
std::size_t numVertices = 0;
for (boost::tie(current,end) = boost::vertices(m_graph); current != end; ++current)
for (boost::tie(current,end) = vertices(m_graph); current != end; ++current)
{
std::cout << "Vertex#" << numVertices << ": p = " << get(m_vertexPointMap,*current) << " , Saddle Vertex: " << (is_saddle_vertex(*current) ? "yes" : "no") << " , Boundary Vertex: " << (is_boundary_vertex(*current) ? "yes" : "no") << std::endl;
++numVertices;
@ -1855,7 +1855,7 @@ private:
do
{
std::cout << get(m_vertexIndexMap, boost::source(faceEdgesCurrent, m_graph));
std::cout << get(m_vertexIndexMap, source(faceEdgesCurrent, m_graph));
faceEdgesCurrent = next(faceEdgesCurrent, m_graph);

View File

@ -37,7 +37,7 @@ Triangle_3 triangle_from_halfedge(typename boost::graph_traits<Triangle_mesh>::h
halfedge_descriptor e0 = edge;
halfedge_descriptor e1 = next(edge, g);
return Triangle_3(get(vertexPointMap, boost::source(e0, g)), get(vertexPointMap, boost::target(e0, g)), get(vertexPointMap, boost::target(e1, g)));
return Triangle_3(get(vertexPointMap, source(e0, g)), get(vertexPointMap, target(e0, g)), get(vertexPointMap, target(e1, g)));
}
template <class Triangle_3, class Triangle_mesh>

View File

@ -30,6 +30,7 @@ int main(int argc, char* argv[])
{
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel, CGAL::Polyhedron_items_with_id_3> Polyhedron_3;
typedef CGAL::Surface_mesh_shortest_path_traits<Kernel, Polyhedron_3> Traits;
typedef Traits::Barycentric_coordinate Barycentric_coordinate;
typedef Traits::FT FT;
@ -43,6 +44,8 @@ int main(int argc, char* argv[])
typedef boost::property_map<Polyhedron_3, boost::halfedge_index_t>::type HIM;
typedef boost::property_map<Polyhedron_3, boost::face_index_t>::type FIM;
Traits traits;
std::string mesh(argv[1]);
@ -74,7 +77,7 @@ int main(int argc, char* argv[])
std::vector<vertex_descriptor> vertices;
boost::tie(verticesStart, verticesEnd) = boost::vertices(polyhedron);
boost::tie(verticesStart, verticesEnd) = CGAL::vertices(polyhedron);
for (vertex_iterator it = verticesStart; it != verticesEnd; ++it)
{
@ -168,7 +171,7 @@ int main(int argc, char* argv[])
{
if (items[d].type == CGAL::test::SEQUENCE_ITEM_EDGE)
{
std::cout << "\t" << names[d] << "(edge): " << vertexIndexMap[CGAL::source(items[d].halfedge, polyhedron)] << " , " << vertexIndexMap[CGAL::target(items[d].halfedge, polyhedron)] << " : " << items[d].edgeAlpha << std::endl;
std::cout << "\t" << names[d] << "(edge): " << vertexIndexMap[source(items[d].halfedge, polyhedron)] << " , " << vertexIndexMap[target(items[d].halfedge, polyhedron)] << " : " << items[d].edgeAlpha << std::endl;
}
else if (items[d].type == CGAL::test::SEQUENCE_ITEM_VERTEX)
{
@ -266,6 +269,7 @@ int main(int argc, char* argv[])
}
}
}
return 0;
}

View File

@ -71,7 +71,7 @@ int main(int argc, char* argv[])
Surface_mesh_shortest_path shortestPaths(polyhedron, traits);
face_iterator facesBegin, facesEnd;
boost::tie(facesBegin, facesEnd) = CGAL::faces(polyhedron);
boost::tie(facesBegin, facesEnd) = faces(polyhedron);
std::vector<face_descriptor> facesList;
@ -90,7 +90,7 @@ int main(int argc, char* argv[])
size_t faceIndex = random.get_int(0, facesList.size());
face_descriptor face = facesList[faceIndex];
Triangle_3 faceTriangle = CGAL::internal::triangle_from_halfedge<Triangle_3, Polyhedron_3, VPM>(CGAL::halfedge(face, polyhedron), polyhedron, vertexPointMap);
Triangle_3 faceTriangle = CGAL::internal::triangle_from_halfedge<Triangle_3, Polyhedron_3, VPM>(halfedge(face, polyhedron), polyhedron, vertexPointMap);
Barycentric_coordinate location = CGAL::test::random_coordinate<Traits>(random);

View File

@ -74,7 +74,7 @@ int main(int argc, char* argv[])
Surface_mesh_shortest_path shortestPaths(polyhedron, traits);
face_iterator facesBegin, facesEnd;
boost::tie(facesBegin, facesEnd) = CGAL::faces(polyhedron);
boost::tie(facesBegin, facesEnd) = faces(polyhedron);
std::vector<face_descriptor> facesList;
@ -89,14 +89,14 @@ int main(int argc, char* argv[])
typedef boost::property_map<Polyhedron_3, CGAL::face_index_t>::type FIM;
FIM faceIndexMap(get(boost::face_index, polyhedron));
VPM vertexPointMap(CGAL::get(CGAL::vertex_point, polyhedron));
VPM vertexPointMap(get(CGAL::vertex_point, polyhedron));
for (size_t i = 0; i < numTrials; ++i)
{
size_t faceIndex = random.get_int(0, facesList.size());
face_descriptor face = facesList[faceIndex];
Triangle_3 faceTriangle = CGAL::internal::triangle_from_halfedge<Triangle_3, Polyhedron_3, VPM>(CGAL::halfedge(face, polyhedron), polyhedron, vertexPointMap);
Triangle_3 faceTriangle = CGAL::internal::triangle_from_halfedge<Triangle_3, Polyhedron_3, VPM>(halfedge(face, polyhedron), polyhedron, vertexPointMap);
Barycentric_coordinate location = CGAL::test::random_coordinate<Traits>(random);
@ -113,7 +113,7 @@ int main(int argc, char* argv[])
}
vertex_iterator startVertexIt, endVertexIt;
boost::tie(startVertexIt, endVertexIt) = boost::vertices(polyhedron);
boost::tie(startVertexIt, endVertexIt) = vertices(polyhedron);
bool first = true;

View File

@ -285,7 +285,7 @@ void detect_is_saddle_vertex()
vertex_iterator currentVertex;
vertex_iterator endVertex;
for (boost::tie(currentVertex, endVertex) = boost::vertices(P); currentVertex != endVertex; ++currentVertex)
for (boost::tie(currentVertex, endVertex) = vertices(P); currentVertex != endVertex; ++currentVertex)
{
if (currentVertexIndex <= 3 || currentVertexIndex == 7)
{

View File

@ -112,7 +112,7 @@ struct TestMeshProgramInstance
size_t x, y;
double alpha;
std::cin >> x >> y >> alpha;
std::pair<halfedge_descriptor, bool> he = CGAL::halfedge(vertices[x], vertices[y], polyhedron);
std::pair<halfedge_descriptor, bool> he = halfedge(vertices[x], vertices[y], polyhedron);
assert(he.second);
return shortestPath.face_location(he.first, FT(alpha));
}
@ -121,8 +121,8 @@ struct TestMeshProgramInstance
size_t x, y;
double alpha0, alpha1, alpha2;
std::cin >> x >> y >> alpha0 >> alpha1 >> alpha2;
std::pair<halfedge_descriptor, bool> he = CGAL::halfedge(vertices[x], vertices[y], polyhedron);
return Face_location(CGAL::face(he.first, polyhedron), construct_barycentric_coordinate(FT(alpha0), FT(alpha1), FT(alpha2)));
std::pair<halfedge_descriptor, bool> he = halfedge(vertices[x], vertices[y], polyhedron);
return Face_location(face(he.first, polyhedron), construct_barycentric_coordinate(FT(alpha0), FT(alpha1), FT(alpha2)));
}
return Face_location(Graph_traits::null_face(), construct_barycentric_coordinate(FT(0.0), FT(0.0), FT(0.0)));
@ -156,7 +156,7 @@ struct TestMeshProgramInstance
CGAL::set_halfedgeds_items_id(polyhedron);
numVertices = boost::num_vertices(polyhedron);
numVertices = num_vertices(polyhedron);
VIM vertexIndexMap(get(boost::vertex_index, polyhedron));
HIM halfedgeIndexMap(get(boost::halfedge_index, polyhedron));
@ -167,7 +167,7 @@ struct TestMeshProgramInstance
std::vector<vertex_descriptor> vertices;
boost::tie(verticesStart, verticesEnd) = boost::vertices(polyhedron);
boost::tie(verticesStart, verticesEnd) = CGAL::vertices(polyhedron);
for (vertex_iterator it = verticesStart; it != verticesEnd; ++it)
{
@ -192,7 +192,7 @@ struct TestMeshProgramInstance
Surface_mesh_shortest_path endToStartShortestPaths(polyhedron, traits);
endToStartShortestPaths.m_debugOutput = debugMode;
std::cout << "Mesh: " << meshName << " " << boost::num_vertices(polyhedron) << " " << CGAL::num_faces(polyhedron) << " " << CGAL::num_halfedges(polyhedron) << std::endl;
std::cout << "Mesh: " << meshName << " " << num_vertices(polyhedron) << " " << num_faces(polyhedron) << " " << num_halfedges(polyhedron) << std::endl;
std::cout << std::setprecision(20);
@ -250,7 +250,7 @@ struct TestMeshProgramInstance
if (seqItem.type == CGAL::test::SEQUENCE_ITEM_EDGE)
{
std::cout << vertexIndexMap[CGAL::source(seqItem.halfedge, polyhedron)] << " , " << vertexIndexMap[CGAL::target(seqItem.halfedge, polyhedron)] << " : " << seqItem.edgeAlpha << std::endl;
std::cout << vertexIndexMap[source(seqItem.halfedge, polyhedron)] << " , " << vertexIndexMap[target(seqItem.halfedge, polyhedron)] << " : " << seqItem.edgeAlpha << std::endl;
}
else if (seqItem.type == CGAL::test::SEQUENCE_ITEM_VERTEX)
{

View File

@ -43,7 +43,7 @@ int main(int argc,char** argv)
// Definition of the region of interest (use the whole mesh)
vertex_iterator vb,ve;
boost::tie(vb, ve) = boost::vertices(mesh);
boost::tie(vb, ve) = vertices(mesh);
//the selection is set by a file
input.open(argv[2]);