From 42880ee2210f3d555ca3735958fbb56fa8608c65 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 16 May 2017 18:02:13 +0200 Subject: [PATCH] Fixes after Sebastien's review --- BGL/doc/BGL/Concepts/EdgeListGraph.h | 8 ++++-- BGL/doc/BGL/Concepts/FaceGraph.h | 12 +++++--- BGL/doc/BGL/Concepts/FaceListGraph.h | 4 +-- BGL/doc/BGL/Concepts/HalfedgeGraph.h | 32 ++++++++++++++------- BGL/doc/BGL/Concepts/HalfedgeListGraph.h | 6 ++-- BGL/doc/BGL/Concepts/MutableFaceGraph.h | 6 ++++ BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h | 7 +++++ BGL/doc/BGL/Concepts/VertexListGraph.h | 4 +-- BGL/doc/BGL/PackageDescription.txt | 2 ++ 9 files changed, 57 insertions(+), 24 deletions(-) diff --git a/BGL/doc/BGL/Concepts/EdgeListGraph.h b/BGL/doc/BGL/Concepts/EdgeListGraph.h index 1eb0daba5c2..7ae0a4d082d 100644 --- a/BGL/doc/BGL/Concepts/EdgeListGraph.h +++ b/BGL/doc/BGL/Concepts/EdgeListGraph.h @@ -16,6 +16,7 @@ class EdgeListGraph{}; /*! \relates EdgeListGraph * returns an iterator range over all edges. */ +template std::pair::edge_iterator, boost::graph_traits::edge_iterator> edges(const EdgeListGraph& g); @@ -26,6 +27,7 @@ edges(const EdgeListGraph& g); \attention `num_edges()` may return a number larger than `std::distance(edges(g).first, edges(g).second)`. This is the case for implementations only marking edges deleted in the edge container. */ +template boost::graph_traits::ver_size_type num_edges(const EdgeListGraph& g); @@ -33,12 +35,14 @@ num_edges(const EdgeListGraph& g); /*! \relates EdgeListGraph returns the source vertex of `h`. */ +template boost::graph_traits::vertex_descriptor -source(boost::graph_traits::halfedge_descriptor h, EdgeListGraph& g); +source(boost::graph_traits::halfedge_descriptor h, const EdgeListGraph& g); /*! \relates EdgeListGraph returns the target vertex of `h`. */ +template boost::graph_traits::vertex_descriptor -target(boost::graph_traits::halfedge_descriptor h, EdgeListGraph& g); +target(boost::graph_traits::halfedge_descriptor h, const EdgeListGraph& g); diff --git a/BGL/doc/BGL/Concepts/FaceGraph.h b/BGL/doc/BGL/Concepts/FaceGraph.h index 265c8fb46e8..6f2571ddab0 100644 --- a/BGL/doc/BGL/Concepts/FaceGraph.h +++ b/BGL/doc/BGL/Concepts/FaceGraph.h @@ -18,23 +18,27 @@ class FaceGraph {}; /*! \relates FaceGraph returns the face incident to halfedge `h`. */ +template boost::graph_traits::face_descriptor -face(boost::graph_traits::halfedge_descriptor h, FaceGraph& g); +face(boost::graph_traits::halfedge_descriptor h, const FaceGraph& g); /*! \relates FaceGraph returns the halfedge incident to face `f`. */ +template boost::graph_traits::halfedge_descriptor -halfedge(boost::graph_traits::face_descriptor f, FaceGraph& g); +halfedge(boost::graph_traits::face_descriptor f, const FaceGraph& g); /*! \relates FaceGraph returns the number of halfedges incident to face `f`. */ +template boost::graph_traits::degree_size_type -degree(boost::graph_traits::face_descriptor f, FaceGraph& g); +degree(boost::graph_traits::face_descriptor f, const FaceGraph& g); /*! \relates FaceGraph returns a special face that is not equal to any other face. */ +template boost::graph_traits::face_descriptor -null_face(FaceGraph& g); +null_face(const FaceGraph& g); diff --git a/BGL/doc/BGL/Concepts/FaceListGraph.h b/BGL/doc/BGL/Concepts/FaceListGraph.h index f21cf4d4c57..f67222a672c 100644 --- a/BGL/doc/BGL/Concepts/FaceListGraph.h +++ b/BGL/doc/BGL/Concepts/FaceListGraph.h @@ -16,7 +16,7 @@ class FaceListGraph{}; /*! \relates FaceListGraph * returns an iterator range over all faces. */ - +template std::pair::face_iterator, boost::graph_traits::face_iterator> faces(const FaceListGraph& g); @@ -27,7 +27,7 @@ faces(const FaceListGraph& g); \attention `num_faces()` may return a number larger than `std::distance(faces(g).first, faces(g).second)`. This is the case for implementations only marking faces deleted in the face container. */ - +template boost::graph_traits::face_size_type num_faces(const FaceListGraph& g); diff --git a/BGL/doc/BGL/Concepts/HalfedgeGraph.h b/BGL/doc/BGL/Concepts/HalfedgeGraph.h index 4af2c22b738..5a9c65f41b8 100644 --- a/BGL/doc/BGL/Concepts/HalfedgeGraph.h +++ b/BGL/doc/BGL/Concepts/HalfedgeGraph.h @@ -27,64 +27,74 @@ A model of `HalfedgeGraph` must have the interior property `vertex_point` attach class HalfedgeGraph {}; /*! \relates HalfedgeGraph -returns the edge corresponding to halfedges `h` and `opposite(h)` . +returns the edge corresponding to halfedges `h` and `opposite(h)`. */ +template boost::graph_traits::edge_descriptor -edge(boost::graph_traits::halfedge_descriptor h, HalfedgeGraph& g); +edge(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns one of the halfedges corresponding to `e`. */ +template boost::graph_traits::halfedge_descriptor -halfedge(boost::graph_traits::edge_descriptor f, HalfedgeGraph& g); +halfedge(boost::graph_traits::edge_descriptor f, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns a halfedge with target `v`. */ +template boost::graph_traits::halfedge_descriptor -halfedge(boost::graph_traits::vertex_descriptor v, HalfedgeGraph& g); +halfedge(boost::graph_traits::vertex_descriptor v, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns the halfedge with source `u` and target `v`. The Boolean is `true`, iff this halfedge exists. */ +template std::pair::halfedge_descriptor,bool> halfedge(boost::graph_traits::vertex_descriptor u, boost::graph_traits::vertex_descriptor v, - HalfedgeGraph& g); + const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns the halfedge with source and target swapped. */ +template boost::graph_traits::halfedge_descriptor -opposite(boost::graph_traits::halfedge_descriptor h, HalfedgeGraph& g); +opposite(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns the source vertex of `h`. */ +template boost::graph_traits::vertex_descriptor -source(boost::graph_traits::halfedge_descriptor h, HalfedgeGraph& g); +source(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns the target vertex of `h`. */ +template boost::graph_traits::vertex_descriptor -target(boost::graph_traits::halfedge_descriptor h, HalfedgeGraph& g); +target(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns the next halfedge around its face. */ +template boost::graph_traits::halfedge_descriptor -next(boost::graph_traits::halfedge_descriptor h, HalfedgeGraph& g); +next(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns the previous halfedge around its face. */ +template boost::graph_traits::halfedge_descriptor -prev(boost::graph_traits::halfedge_descriptor h, HalfedgeGraph& g); +prev(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); /*! \relates HalfedgeGraph returns a special halfedge that is not equal to any other halfedge. */ +template boost::graph_traits::halfedge_descriptor -null_halfedge(HalfedgeGraph& g); +null_halfedge(const HalfedgeGraph& g); diff --git a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h index a061c55ccf4..b7e61b02207 100644 --- a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h +++ b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h @@ -16,7 +16,7 @@ class HalfedgeListGraph {}; /*! \relates HalfedgeListGraph * returns an iterator range over all halfedges. */ - +template std::pair::halfedge_iterator, boost::graph_traits::halfedge_iterator> halfedges(const HalfedgeListGraph& g); @@ -27,7 +27,7 @@ halfedges(const HalfedgeListGraph& g); \attention `num_halfedges()` may return a number larger than `std::distance(halfedges(g).first, halfedges(g).second)`. This is the case for implementations only marking halfedges deleted in the halfedge container. */ - +template boost::graph_traits::halfedge_size_type -num_halfedges(const FaceListGraph& g); +num_halfedges(const HalfedgeListGraph& g); diff --git a/BGL/doc/BGL/Concepts/MutableFaceGraph.h b/BGL/doc/BGL/Concepts/MutableFaceGraph.h index 3510522316d..a930f6284d0 100644 --- a/BGL/doc/BGL/Concepts/MutableFaceGraph.h +++ b/BGL/doc/BGL/Concepts/MutableFaceGraph.h @@ -16,28 +16,34 @@ class MutableFaceGraph{}; /*! \relates MutableFaceGraph Adds a new face to the graph without initializing the connectivity. */ +template boost::graph_traits::face_descriptor add_face(MutableFaceGraph& g); /*! \relates MutableFaceGraph Removes `f` from the graph. */ +template boost::graph_traits::face_descriptor remove_face(boost::graph_traits::face_descriptor f, MutableFaceGraph& g); /*! \relates MutableFaceGraph Sets the corresponding face of `h` to `f`. */ +template void set_face(boost::graph_traits::halfedge_descriptor h, boost::graph_traits::face_descriptor f, MutableFaceGraph& g); /*! \relates MutableFaceGraph Sets the corresponding halfedge of `f` to `h`. */ +template void set_halfedge(boost::graph_traits::face_descriptor f, boost::graph_traits::halfedge_descriptor h, MutableFaceGraph& g); + /*! \relates MutableFaceGraph Indicates the expected size of vertices (`nv`), edges (`ed`) and faces (`nf`). */ +template void reserve(MutableFaceGraph& g, boost::graph_traits::vertices_size_type nv, boost::graph_traits::vertices_size_type ne, boost::graph_traits::vertices_size_type nf); diff --git a/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h b/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h index 6eda068d36a..10f46aeeb30 100644 --- a/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h +++ b/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h @@ -18,24 +18,28 @@ class MutableHalfedgeGraph{}; /*! \relates MutableFaceGraph Adds a new vertex to the graph without initializing the connectivity. */ +template boost::graph_traits::face_descriptor add_vertex(MutableHalfedgeGraph& g); /*! \relates MutableHalfedgeGraph Removes `v` from the graph. */ +template boost::graph_traits::face_descriptor remove_vertex(boost::graph_traits::vertex_descriptor v, MutableHalfedgeGraph& g); /*! \relates MutableFaceGraph Adds two opposite halfedges to the graph without initializing the connectivity. */ +template boost::graph_traits::edge_descriptor add_edge(MutableHalfedgeGraph& g); /*! \relates MutableHalfedgeGraph Removes the two halfedges corresponding to `e` from the graph. */ +template boost::graph_traits::face_descriptor remove_edge(boost::graph_traits::edge_descriptor e, MutableHalfedgeGraph& g); @@ -43,12 +47,14 @@ remove_edge(boost::graph_traits::edge_descriptor e, Mutabl /*! \relates MutableHalfedgeGraph Sets the target vertex of `h` and the source of `opposite(h)` to `v`. */ +template void set_target(boost::graph_traits::halfedge_descriptor h, boost::graph_traits::vertex_descriptor v, MutableHalfedgeGraph& g); /*! \relates MutableHalfedgeGraph Sets the halfedge of `v` to `h`. The target vertex of `h` must be `v`. */ +template void set_halfedge(boost::graph_traits::vertex_descriptor v, boost::graph_traits::halfedge_descriptor h, MutableHalfedgeGraph& g); @@ -56,5 +62,6 @@ set_halfedge(boost::graph_traits::vertex_descriptor v, boo /*! \relates MutableHalfedgeGraph Sets the successor of `h1` around a face to `h2`, and the prededecessor of `h2` to `h1`. */ +template void set_next(boost::graph_traits::halfedge_descriptor h1, boost::graph_traits::halfede_descriptor h2, MutableHalfedgeGraph& g); diff --git a/BGL/doc/BGL/Concepts/VertexListGraph.h b/BGL/doc/BGL/Concepts/VertexListGraph.h index d704e169a4f..b76ea193a56 100644 --- a/BGL/doc/BGL/Concepts/VertexListGraph.h +++ b/BGL/doc/BGL/Concepts/VertexListGraph.h @@ -16,7 +16,7 @@ class VertexListGraph{}; /*! \relates VertexListGraph * returns an iterator range over all vertices. */ - +template std::pair::vertex_iterator, boost::graph_traits::vertex_iterator> vertices(const VertexListGraph& g); @@ -27,7 +27,7 @@ vertices(const VertexListGraph& g); \attention `num_vertices()` may return a number larger than `std::distance(vertices(g).first, vertices(g).second)`. This is the case for implementations only marking vertices deleted in the vertex container. */ - +template boost::graph_traits::ver_size_type num_vertices(const VertexListGraph& g); diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 7049f56879c..613a4e37d6c 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -99,6 +99,8 @@ Valid Expression | Returns `prev(h, g)` | `halfedge_descriptor` | The previous halfedge around its face. `boost::graph_traits::%null_halfedge()` | `halfedge_descriptor` | Returns a special halfedge that is not equal to any other halfedge. +The `HalfedgeGraph`has the invariant `halfedge(edge(h,g))==h`. + \cgalHeading{%MutableHalfedgeGraph} The concept `MutableHalfedgeGraph` refines the concept `HalfedgeGraph`