Commit 6abf39e9 authored by Philip Trettner's avatar Philip Trettner
Browse files

added new splits to ranges

parent c91c0b0e
...@@ -734,6 +734,12 @@ vertex_handle face_collection<iterator>::split(face_handle f) const ...@@ -734,6 +734,12 @@ vertex_handle face_collection<iterator>::split(face_handle f) const
return this->mesh->handle_of(low_level_api(this->mesh).face_split(f.idx)); return this->mesh->handle_of(low_level_api(this->mesh).face_split(f.idx));
} }
template <class iterator>
void face_collection<iterator>::split(face_handle f, vertex_handle v) const
{
low_level_api(this->mesh).face_split(f.idx, v.idx);
}
template <class iterator> template <class iterator>
face_handle face_collection<iterator>::fill(halfedge_handle h) const face_handle face_collection<iterator>::fill(halfedge_handle h) const
{ {
...@@ -746,6 +752,12 @@ vertex_handle edge_collection<iterator>::split(edge_handle e) const ...@@ -746,6 +752,12 @@ vertex_handle edge_collection<iterator>::split(edge_handle e) const
return this->mesh->handle_of(low_level_api(this->mesh).edge_split(e.idx)); return this->mesh->handle_of(low_level_api(this->mesh).edge_split(e.idx));
} }
template <class iterator>
void edge_collection<iterator>::split(edge_handle e, vertex_handle v) const
{
low_level_api(this->mesh).edge_split(e.idx, v.idx);
}
template <class iterator> template <class iterator>
void vertex_collection<iterator>::collapse(vertex_handle v) const void vertex_collection<iterator>::collapse(vertex_handle v) const
{ {
...@@ -776,6 +788,12 @@ vertex_handle halfedge_collection<iterator>::split(halfedge_handle h) const ...@@ -776,6 +788,12 @@ vertex_handle halfedge_collection<iterator>::split(halfedge_handle h) const
return this->mesh->handle_of(low_level_api(this->mesh).halfedge_split(h.idx)); return this->mesh->handle_of(low_level_api(this->mesh).halfedge_split(h.idx));
} }
template <class iterator>
void halfedge_collection<iterator>::split(halfedge_handle h, vertex_handle v) const
{
low_level_api(this->mesh).halfedge_split(h.idx, v.idx);
}
template <class iterator> template <class iterator>
void halfedge_collection<iterator>::attach(halfedge_handle h, vertex_handle v) const void halfedge_collection<iterator>::attach(halfedge_handle h, vertex_handle v) const
{ {
......
...@@ -236,6 +236,8 @@ struct face_collection : smart_collection<Mesh*, face_tag, iterator> ...@@ -236,6 +236,8 @@ struct face_collection : smart_collection<Mesh*, face_tag, iterator>
/// Preserves half-edge attributes /// Preserves half-edge attributes
/// The face itself is deleted and multiple new ones are created /// The face itself is deleted and multiple new ones are created
vertex_handle split(face_handle f) const; vertex_handle split(face_handle f) const;
/// same as before but splits at a given ISOLATED vertex
void split(face_handle f, vertex_handle v) const;
/// Fills the half-edge ring of a given boundary half-edge /// Fills the half-edge ring of a given boundary half-edge
/// Returns the new face /// Returns the new face
...@@ -271,6 +273,8 @@ struct edge_collection : smart_collection<Mesh*, edge_tag, iterator> ...@@ -271,6 +273,8 @@ struct edge_collection : smart_collection<Mesh*, edge_tag, iterator>
/// Preserves face attributes /// Preserves face attributes
/// The edge itself is deleted and two new ones are created /// The edge itself is deleted and two new ones are created
vertex_handle split(edge_handle e) const; vertex_handle split(edge_handle e) const;
/// same as before but splits at a given ISOLATED vertex
void split(edge_handle e, vertex_handle v) const;
/// Moves both half-edges vertices to their next half-edge vertex /// Moves both half-edges vertices to their next half-edge vertex
/// Equivalent to an edge flip if both faces are triangular /// Equivalent to an edge flip if both faces are triangular
...@@ -319,6 +323,8 @@ struct halfedge_collection : smart_collection<Mesh*, halfedge_tag, iterator> ...@@ -319,6 +323,8 @@ struct halfedge_collection : smart_collection<Mesh*, halfedge_tag, iterator>
/// Contrary to edges().split, the edge is preserved and a single new one is inserted AFTER h /// Contrary to edges().split, the edge is preserved and a single new one is inserted AFTER h
/// (thus h->next() is the newly inserted edge and h->vertex_to() is the returned vertex) /// (thus h->next() is the newly inserted edge and h->vertex_to() is the returned vertex)
vertex_handle split(halfedge_handle h) const; vertex_handle split(halfedge_handle h) const;
/// same as before but splits at a given ISOLATED vertex
void split(halfedge_handle h, vertex_handle v) const;
/// Given an isolated vertex v, inserts a self-adjacent edge at the to-vertex to v /// Given an isolated vertex v, inserts a self-adjacent edge at the to-vertex to v
void attach(halfedge_handle h, vertex_handle v) const; void attach(halfedge_handle h, vertex_handle v) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment