Commit 5763ee56 authored by Max Lyon's avatar Max Lyon

Merge branch 'swap-indices-methods' into 'master'

rename swap_*s methods to swap_*_indices and make them public

See merge request !26
parents 5a0ceeb4 22cb65e4
Pipeline #6218 passed with stage
in 4 minutes and 5 seconds
......@@ -124,7 +124,7 @@ public:
}
virtual void swap_vertices(VertexHandle _h1, VertexHandle _h2)
virtual void swap_vertex_indices(VertexHandle _h1, VertexHandle _h2)
{
assert(_h1.idx() >= 0 && _h1.idx() < (int)vertices_.size());
assert(_h2.idx() >= 0 && _h2.idx() < (int)vertices_.size());
......@@ -134,7 +134,7 @@ public:
std::swap(vertices_[_h1.idx()], vertices_[_h2.idx()]);
TopologyKernelT::swap_vertices(_h1, _h2);
TopologyKernelT::swap_vertex_indices(_h1, _h2);
}
protected:
......
......@@ -916,7 +916,7 @@ VertexIter TopologyKernel::delete_vertex_core(const VertexHandle& _h) {
{
VertexHandle last_undeleted_vertex = VertexHandle((int)n_vertices()-1);
assert(!vertex_deleted_[last_undeleted_vertex.idx()]);
swap_vertices(h, last_undeleted_vertex);
swap_vertex_indices(h, last_undeleted_vertex);
h = last_undeleted_vertex;
}
......@@ -1022,7 +1022,7 @@ EdgeIter TopologyKernel::delete_edge_core(const EdgeHandle& _h) {
{
EdgeHandle last_edge = EdgeHandle((int)edges_.size()-1);
assert(!edge_deleted_[last_edge.idx()]);
swap_edges(h, last_edge);
swap_edge_indices(h, last_edge);
h = last_edge;
}
......@@ -1207,7 +1207,7 @@ FaceIter TopologyKernel::delete_face_core(const FaceHandle& _h) {
{
FaceHandle last_face = FaceHandle((int)faces_.size()-1);
assert(!face_deleted_[last_face.idx()]);
swap_faces(h, last_face);
swap_face_indices(h, last_face);
h = last_face;
}
......@@ -1376,7 +1376,7 @@ CellIter TopologyKernel::delete_cell_core(const CellHandle& _h) {
{
CellHandle last_undeleted_cell = CellHandle((int)cells_.size()-1);
assert(!cell_deleted_[last_undeleted_cell.idx()]);
swap_cells(h, last_undeleted_cell);
swap_cell_indices(h, last_undeleted_cell);
h = last_undeleted_cell;
}
......@@ -1435,7 +1435,7 @@ CellIter TopologyKernel::delete_cell_core(const CellHandle& _h) {
}
}
void TopologyKernel::swap_cells(CellHandle _h1, CellHandle _h2)
void TopologyKernel::swap_cell_indices(CellHandle _h1, CellHandle _h2)
{
assert(_h1.idx() >= 0 && _h1.idx() < (int)cells_.size());
assert(_h2.idx() >= 0 && _h2.idx() < (int)cells_.size());
......@@ -1474,7 +1474,7 @@ void TopologyKernel::swap_cells(CellHandle _h1, CellHandle _h2)
swap_cell_properties(_h1, _h2);
}
void TopologyKernel::swap_faces(FaceHandle _h1, FaceHandle _h2)
void TopologyKernel::swap_face_indices(FaceHandle _h1, FaceHandle _h2)
{
assert(_h1.idx() >= 0 && _h1.idx() < (int)faces_.size());
assert(_h2.idx() >= 0 && _h2.idx() < (int)faces_.size());
......@@ -1615,7 +1615,7 @@ void TopologyKernel::swap_faces(FaceHandle _h1, FaceHandle _h2)
}
void TopologyKernel::swap_edges(EdgeHandle _h1, EdgeHandle _h2)
void TopologyKernel::swap_edge_indices(EdgeHandle _h1, EdgeHandle _h2)
{
assert(_h1.idx() >= 0 && _h1.idx() < (int)edges_.size());
assert(_h2.idx() >= 0 && _h2.idx() < (int)edges_.size());
......@@ -1753,7 +1753,7 @@ void TopologyKernel::swap_edges(EdgeHandle _h1, EdgeHandle _h2)
}
void TopologyKernel::swap_vertices(VertexHandle _h1, VertexHandle _h2)
void TopologyKernel::swap_vertex_indices(VertexHandle _h1, VertexHandle _h2)
{
assert(_h1.idx() >= 0 && _h1.idx() < (int)n_vertices_);
assert(_h2.idx() >= 0 && _h2.idx() < (int)n_vertices_);
......
......@@ -522,15 +522,21 @@ private:
CellIter delete_cell_core(const CellHandle& _h);
protected:
public:
virtual void swap_cells(CellHandle _h1, CellHandle _h2);
/// Exchanges the indices of two cells while keeping the mesh otherwise unaffected.
virtual void swap_cell_indices(CellHandle _h1, CellHandle _h2);
virtual void swap_faces(FaceHandle _h1, FaceHandle _h2);
/// Exchanges the indices of two faces while keeping the mesh otherwise unaffected.
virtual void swap_face_indices(FaceHandle _h1, FaceHandle _h2);
virtual void swap_edges(EdgeHandle _h1, EdgeHandle _h2);
/// Exchanges the indices of two edges while keeping the mesh otherwise unaffected.
virtual void swap_edge_indices(EdgeHandle _h1, EdgeHandle _h2);
virtual void swap_vertices(VertexHandle _h1, VertexHandle _h2);
/// Exchanges the indices of two vertices while keeping the mesh otherwise unaffected.
virtual void swap_vertex_indices(VertexHandle _h1, VertexHandle _h2);
protected:
virtual void delete_multiple_vertices(const std::vector<bool>& _tag);
......
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