Remove assertion in halfedge(Polyehdron_3, vertex_descriptor)
as it is wrong for an isolated vertex. Document that add_vertex/edge/face(G&) do not initialize the connectivity
This commit is contained in:
@@ -23,7 +23,7 @@ the requirement for operations to add faces and to modify face-halfedge relation
|
||||
|
||||
Expression | returns | Description
|
||||
----------------------- | ------------ | -----------
|
||||
`add_face(g)` | `face_descriptor` | Adds a new face to the graph with no corresponding halfedge set.
|
||||
`add_face(g)` | `face_descriptor` | Adds a new face to the graph without inializing the connectivity.
|
||||
`remove_face(f, g)` | `void` | Removes `f` from the graph.
|
||||
`set_face(h, f, g)` | `void` | Sets the corresponding face of `h` to `f`.
|
||||
`set_halfedge(f, h, g)` | `void` | Sets the corresponding halfedge of `f` to `h`.
|
||||
|
||||
@@ -25,9 +25,9 @@ update the incidence information between vertices and halfedges.
|
||||
|
||||
Expression | returns | Description
|
||||
------------------------- | ------------ | -----------
|
||||
`add_vertex(g)` | `vertex_descriptor` | Adds a new vertex to the graph.
|
||||
`add_vertex(g)` | `vertex_descriptor` | Adds a new vertex to the graph without inializing the connectivity.
|
||||
`remove_vertex(v, g)` | `void` | Removes `v` from the graph.
|
||||
`add_edge(g)` | `edge_descriptor` | Adds two opposite halfedges to the graph.
|
||||
`add_edge(g)` | `edge_descriptor` | Adds two opposite halfedges to the graph without inializing the connectivity.
|
||||
`remove_edge(e, g)` | `void` | Removes the two halfedges corresponding to `e` from the graph.
|
||||
`set_target(h, v, g)` | `void` | Sets the target vertex of `h` and the source of `opposite(h)` to `v`.
|
||||
`set_halfedge(v, h, g)` | `void` | Sets the halfedge of `v` to `h`. The target vertex of `h` must be `v`.
|
||||
|
||||
@@ -338,7 +338,6 @@ typename boost::graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >::halfedge_descrip
|
||||
halfedge(typename boost::graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >::vertex_descriptor v
|
||||
, const CGAL::Polyhedron_3<Gt,I,HDS,A>&)
|
||||
{
|
||||
CGAL_assertion(v->halfedge()->vertex() == v);
|
||||
return v->halfedge();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
|
||||
typedef boost::unordered_set<std::size_t> id_map;
|
||||
|
||||
template <typename Graph>
|
||||
void test_isolated_vertex(const Graph& g)
|
||||
{
|
||||
std::cerr << typeid(g).name() << std::endl;
|
||||
Graph G;
|
||||
typedef boost::graph_traits< Graph > Traits;
|
||||
typedef typename Traits::vertex_descriptor vertex_descriptor;
|
||||
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
|
||||
vertex_descriptor v = add_vertex(G);
|
||||
// the connectivity of v may be anything
|
||||
set_halfedge(v, Traits::null_halfedge(), G);
|
||||
halfedge_descriptor h = halfedge(v,G);
|
||||
}
|
||||
|
||||
|
||||
template <typename Graph>
|
||||
void test_halfedge_around_vertex_iterator(const Graph& g)
|
||||
{
|
||||
@@ -255,6 +270,7 @@ test(const std::vector<Graph>& graphs)
|
||||
test_faces(p);
|
||||
test_halfedge_around_vertex_iterator(p);
|
||||
test_halfedge_around_face_iterator(p);
|
||||
test_isolated_vertex(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user