Commit 12e440a5 authored by Mike Kremer's avatar Mike Kremer
Browse files

Abandoned cast to int operator for handle types.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@182 66977474-1d4b-4f09-8fe9-267525286df2
parent a1b27325
......@@ -60,61 +60,61 @@ public:
~StatusAttrib();
const OpenVolumeMeshStatus& operator[](const VertexHandle& _h) const {
return v_status_[_h];
return v_status_[_h.idx()];
}
OpenVolumeMeshStatus& operator[](const VertexHandle& _h) {
return v_status_[_h];
return v_status_[_h.idx()];
}
const OpenVolumeMeshStatus& operator[](const EdgeHandle& _h) const {
return e_status_[_h];
return e_status_[_h.idx()];
}
OpenVolumeMeshStatus& operator[](const EdgeHandle& _h) {
return e_status_[_h];
return e_status_[_h.idx()];
}
const OpenVolumeMeshStatus& operator[](const HalfEdgeHandle& _h) const {
return he_status_[_h];
return he_status_[_h.idx()];
}
OpenVolumeMeshStatus& operator[](const HalfEdgeHandle& _h) {
return he_status_[_h];
return he_status_[_h.idx()];
}
const OpenVolumeMeshStatus& operator[](const FaceHandle& _h) const {
return f_status_[_h];
return f_status_[_h.idx()];
}
OpenVolumeMeshStatus& operator[](const FaceHandle& _h) {
return f_status_[_h];
return f_status_[_h.idx()];
}
const OpenVolumeMeshStatus& operator[](const HalfFaceHandle& _h) const {
return hf_status_[_h];
return hf_status_[_h.idx()];
}
OpenVolumeMeshStatus& operator[](const HalfFaceHandle& _h) {
return hf_status_[_h];
return hf_status_[_h.idx()];
}
const OpenVolumeMeshStatus& operator[](const CellHandle& _h) const {
return c_status_[_h];
return c_status_[_h.idx()];
}
OpenVolumeMeshStatus& operator[](const CellHandle& _h) {
return c_status_[_h];
return c_status_[_h.idx()];
}
const OpenVolumeMeshStatus& mesh_status() const {
OpenVolumeMeshHandle h(0);
return m_status_[h];
return m_status_[h.idx()];
}
OpenVolumeMeshStatus& mesh_status() {
OpenVolumeMeshHandle h(0);
return m_status_[h];
return m_status_[h.idx()];
}
typedef VertexPropertyT<OpenVolumeMeshStatus>::const_iterator const_vstatus_iterator;
......
......@@ -86,7 +86,7 @@ public:
/// Get point _vh's coordinates
const VecT& vertex(const VertexHandle& _vh) const {
return vertices_[_vh];
return vertices_[_vh.idx()];
}
virtual VertexIter delete_vertex(const VertexHandle& _h) {
......
......@@ -65,19 +65,19 @@ cur_index_(0) {
return;
}
if((unsigned int)_ref_h >= BaseIter::mesh()->outgoing_hes_per_vertex_.size()) {
if((unsigned int)_ref_h.idx() >= BaseIter::mesh()->outgoing_hes_per_vertex_.size()) {
BaseIter::valid(false);
}
if(BaseIter::valid()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->outgoing_hes_per_vertex_[_ref_h].size()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->outgoing_hes_per_vertex_[_ref_h.idx()].size()) {
BaseIter::valid(false);
}
}
if(BaseIter::valid()) {
BaseIter::cur_handle((
BaseIter::mesh()->outgoing_hes_per_vertex_[_ref_h])[cur_index_]);
BaseIter::mesh()->outgoing_hes_per_vertex_[_ref_h.idx()])[cur_index_]);
}
}
......@@ -90,7 +90,7 @@ VertexOHalfEdgeIter& VertexOHalfEdgeIter::operator--() {
BaseIter::valid(false);
} else {
BaseIter::cur_handle((
BaseIter::mesh()->outgoing_hes_per_vertex_[BaseIter::ref_handle()])[cur_index_]);
BaseIter::mesh()->outgoing_hes_per_vertex_[BaseIter::ref_handle().idx()])[cur_index_]);
}
return *this;
......@@ -101,11 +101,11 @@ VertexOHalfEdgeIter& VertexOHalfEdgeIter::operator++() {
++cur_index_;
if((unsigned int)cur_index_ >= BaseIter::mesh()->outgoing_hes_per_vertex_[BaseIter::ref_handle()].size()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->outgoing_hes_per_vertex_[BaseIter::ref_handle().idx()].size()) {
BaseIter::valid(false);
} else {
BaseIter::cur_handle((
BaseIter::mesh()->outgoing_hes_per_vertex_[BaseIter::ref_handle()])[cur_index_]);
BaseIter::mesh()->outgoing_hes_per_vertex_[BaseIter::ref_handle().idx()])[cur_index_]);
}
return *this;
......@@ -127,19 +127,19 @@ cur_index_(0) {
return;
}
if((unsigned int)_ref_h >= BaseIter::mesh()->incident_hfs_per_he_.size()) {
if((unsigned int)_ref_h.idx() >= BaseIter::mesh()->incident_hfs_per_he_.size()) {
BaseIter::valid(false);
}
if(BaseIter::valid()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[_ref_h].size()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[_ref_h.idx()].size()) {
BaseIter::valid(false);
}
}
if(BaseIter::valid()) {
BaseIter::cur_handle((
BaseIter::mesh()->incident_hfs_per_he_[_ref_h])[cur_index_]);
BaseIter::mesh()->incident_hfs_per_he_[_ref_h.idx()])[cur_index_]);
}
}
......@@ -152,7 +152,7 @@ HalfEdgeHalfFaceIter& HalfEdgeHalfFaceIter::operator--() {
BaseIter::valid(false);
} else {
BaseIter::cur_handle((
BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()])[cur_index_]);
BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle().idx()])[cur_index_]);
}
return *this;
......@@ -163,11 +163,11 @@ HalfEdgeHalfFaceIter& HalfEdgeHalfFaceIter::operator++() {
++cur_index_;
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()].size()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle().idx()].size()) {
BaseIter::valid(false);
} else {
BaseIter::cur_handle((
BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()])[cur_index_]);
BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle().idx()])[cur_index_]);
}
return *this;
......@@ -188,22 +188,22 @@ BaseIter(_mesh, _ref_h) {
return;
}
if((unsigned int)_ref_h >= BaseIter::mesh()->outgoing_hes_per_vertex_.size()) {
if((unsigned int)_ref_h.idx() >= BaseIter::mesh()->outgoing_hes_per_vertex_.size()) {
BaseIter::valid(false);
return;
}
// Build up cell list
std::vector<HalfEdgeHandle> incidentHalfedges = BaseIter::mesh()->outgoing_hes_per_vertex_[_ref_h];
std::vector<HalfEdgeHandle> incidentHalfedges = BaseIter::mesh()->outgoing_hes_per_vertex_[_ref_h.idx()];
for(std::vector<HalfEdgeHandle>::const_iterator it = incidentHalfedges.begin(); it != incidentHalfedges.end(); ++it) {
if(*it < 0 || (unsigned int)*it >= BaseIter::mesh()->incident_hfs_per_he_.size()) continue;
std::vector<HalfFaceHandle> incidentHalfFaces = BaseIter::mesh()->incident_hfs_per_he_[*it];
if(*it < 0 || (unsigned int)it->idx() >= BaseIter::mesh()->incident_hfs_per_he_.size()) continue;
std::vector<HalfFaceHandle> incidentHalfFaces = BaseIter::mesh()->incident_hfs_per_he_[it->idx()];
for(std::vector<HalfFaceHandle>::const_iterator hf_it = incidentHalfFaces.begin();
hf_it != incidentHalfFaces.end(); ++hf_it) {
if((unsigned int)*hf_it < BaseIter::mesh()->incident_cell_per_hf_.size()) {
CellHandle c_idx = BaseIter::mesh()->incident_cell_per_hf_[*hf_it];
if((unsigned int)hf_it->idx() < BaseIter::mesh()->incident_cell_per_hf_.size()) {
CellHandle c_idx = BaseIter::mesh()->incident_cell_per_hf_[hf_it->idx()];
if(c_idx != TopologyKernel::InvalidCellHandle)
cells_.insert(c_idx);
}
......@@ -256,24 +256,24 @@ cur_index_(0) {
return;
}
if((unsigned int)_ref_h >= BaseIter::mesh()->incident_hfs_per_he_.size()) {
if((unsigned int)_ref_h.idx() >= BaseIter::mesh()->incident_hfs_per_he_.size()) {
BaseIter::valid(false);
return;
}
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[_ref_h].size()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[_ref_h.idx()].size()) {
BaseIter::valid(false);
return;
}
if((unsigned int)((BaseIter::mesh()->incident_hfs_per_he_[_ref_h])[cur_index_]) >=
if((unsigned int)((BaseIter::mesh()->incident_hfs_per_he_[_ref_h.idx()])[cur_index_]).idx() >=
BaseIter::mesh()->incident_cell_per_hf_.size()) {
BaseIter::valid(false);
return;
}
BaseIter::cur_handle(BaseIter::mesh()->incident_cell_per_hf_[((BaseIter::mesh()->incident_hfs_per_he_[_ref_h])[cur_index_])]);
BaseIter::cur_handle(BaseIter::mesh()->incident_cell_per_hf_[((BaseIter::mesh()->incident_hfs_per_he_[_ref_h.idx()])[cur_index_]).idx()]);
}
......@@ -285,7 +285,7 @@ HalfEdgeCellIter& HalfEdgeCellIter::operator--() {
return *this;
}
BaseIter::cur_handle(BaseIter::mesh()->incident_cell_per_hf_[(
(BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()])[cur_index_])]);
(BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle().idx()])[cur_index_]).idx()]);
return *this;
}
......@@ -293,19 +293,19 @@ HalfEdgeCellIter& HalfEdgeCellIter::operator--() {
HalfEdgeCellIter& HalfEdgeCellIter::operator++() {
++cur_index_;
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()].size()) {
if((unsigned int)cur_index_ >= BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle().idx()].size()) {
BaseIter::valid(false);
return *this;
}
if((unsigned int)((BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()])[cur_index_]) >=
if((unsigned int)((BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle().idx()])[cur_index_]).idx() >=
BaseIter::mesh()->incident_cell_per_hf_.size()) {
BaseIter::valid(false);
return *this;
}
BaseIter::cur_handle(BaseIter::mesh()->incident_cell_per_hf_[(
(BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle()])[cur_index_])]);
(BaseIter::mesh()->incident_hfs_per_he_[BaseIter::ref_handle().idx()])[cur_index_]).idx()]);
return *this;
}
......@@ -377,7 +377,7 @@ BaseIter(_mesh, _ref_h) {
for(; hf_iter != BaseIter::mesh()->cell(_ref_h).halffaces().end(); ++hf_iter) {
HalfFaceHandle opp_hf = BaseIter::mesh()->opposite_halfface_handle(*hf_iter);
CellHandle ch = BaseIter::mesh()->incident_cell_per_hf_[opp_hf];
CellHandle ch = BaseIter::mesh()->incident_cell_per_hf_[opp_hf.idx()];
if(ch != TopologyKernel::InvalidCellHandle) {
adjacent_cells_.insert(ch);
}
......
......@@ -44,6 +44,25 @@
namespace OpenVolumeMesh {
bool operator==(const int& _lhs, const OpenVolumeMeshHandle& _rhs) {
return _lhs == _rhs.idx();
}
bool operator==(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs) {
return _lhs == (unsigned int)_rhs.idx();
}
bool operator!=(const int& _lhs, const OpenVolumeMeshHandle& _rhs) {
return !(_lhs == _rhs);
}
bool operator!=(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs) {
return !(_lhs == _rhs);
}
std::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle) {
_ostr << _handle.idx();
return _ostr;
......
......@@ -72,13 +72,21 @@ public:
inline bool operator<(int _idx) const { return idx_ < _idx; }
inline bool operator>(const OpenVolumeMeshHandle& _idx) const { return (this->idx_ > _idx.idx_); }
inline bool operator>(int _idx) const { return idx_ > _idx; }
inline bool operator==(const OpenVolumeMeshHandle& _h) const { return _h.idx_ == this->idx_; }
inline bool operator!=(const OpenVolumeMeshHandle& _h) const { return _h.idx_ != this->idx_; }
inline const int& idx() const { return idx_; }
void idx(const int& _idx) { idx_ = _idx; }
void reset() { idx_ = -1; }
inline operator int() const { return idx_; }
//inline operator int() const { return idx_; }
private:
int idx_;
......@@ -139,6 +147,14 @@ private:
CellHandle thld_;
};
bool operator==(const int& _lhs, const OpenVolumeMeshHandle& _rhs);
bool operator==(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs);
bool operator!=(const int& _lhs, const OpenVolumeMeshHandle& _rhs);
bool operator!=(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs);
std::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle);
std::istream& operator>>(std::istream& _istr, OpenVolumeMeshHandle& _handle);
......
......@@ -95,6 +95,9 @@ public:
reference operator[](size_t _idx) { return (*ptr::shared_ptr<PropT>::get())[_idx]; }
const_reference operator[](size_t _idx) const { return (*ptr::shared_ptr<PropT>::get())[_idx]; }
reference operator[](const OpenVolumeMeshHandle& _h) { return (*ptr::shared_ptr<PropT>::get())[_h.idx()]; }
const_reference operator[](const OpenVolumeMeshHandle& _h) const { return (*ptr::shared_ptr<PropT>::get())[_h.idx()]; }
virtual OpenVolumeMeshHandle handle() const;
virtual bool persistent() const { return ptr::shared_ptr<PropT>::get()->persistent(); }
......
......@@ -93,7 +93,7 @@ VertexHandle TopologyKernel::add_vertex() {
EdgeHandle TopologyKernel::add_edge(const VertexHandle& _fromVertex,
const VertexHandle& _toVertex) {
if((unsigned int)_fromVertex >= n_vertices() || (unsigned int)_toVertex >= n_vertices()) {
if((unsigned int)_fromVertex.idx() >= n_vertices() || (unsigned int)_toVertex.idx() >= n_vertices()) {
std::cerr << "Vertex handle is out of bounds!" << std::endl;
return InvalidEdgeHandle;
}
......@@ -123,8 +123,8 @@ EdgeHandle TopologyKernel::add_edge(const VertexHandle& _fromVertex,
if(v_bottom_up_) {
assert(outgoing_hes_per_vertex_.size() > (unsigned int)_fromVertex.idx());
assert(outgoing_hes_per_vertex_.size() > (unsigned int)_toVertex.idx());
outgoing_hes_per_vertex_[_fromVertex].push_back(halfedge_handle(eh, 0));
outgoing_hes_per_vertex_[_toVertex].push_back(halfedge_handle(eh, 1));
outgoing_hes_per_vertex_[_fromVertex.idx()].push_back(halfedge_handle(eh, 0));
outgoing_hes_per_vertex_[_toVertex.idx()].push_back(halfedge_handle(eh, 1));
}
// Create item for edge bottom-up adjacencies
......@@ -144,7 +144,7 @@ FaceHandle TopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedge
// Test if all edges are valid
for(std::vector<HalfEdgeHandle>::const_iterator it = _halfedges.begin(),
end = _halfedges.end(); it != end; ++it) {
if((unsigned int)*it >= n_edges_ * 2u) {
if((unsigned int)it->idx() >= n_edges_ * 2u) {
std::cerr << "Halfedge handle out of bounds!" << std::endl;
return InvalidFaceHandle;
}
......@@ -205,8 +205,8 @@ FaceHandle TopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedge
end = _halfedges.end(); it != end; ++it) {
assert(incident_hfs_per_he_.size() > (unsigned int)it->idx());
assert(incident_hfs_per_he_.size() > (unsigned int)opposite_halfedge_handle(*it).idx());
incident_hfs_per_he_[*it].push_back(halfface_handle(fh, 0));
incident_hfs_per_he_[opposite_halfedge_handle(*it)].push_back(halfface_handle(fh, 1));
incident_hfs_per_he_[it->idx()].push_back(halfface_handle(fh, 0));
incident_hfs_per_he_[opposite_halfedge_handle(*it).idx()].push_back(halfface_handle(fh, 1));
}
}
......@@ -228,7 +228,7 @@ FaceHandle TopologyKernel::add_face(const std::vector<VertexHandle>& _vertices)
// Test if all vertices exist
for(std::vector<VertexHandle>::const_iterator it = _vertices.begin(),
end = _vertices.end(); it != end; ++it) {
if((unsigned int)*it >= n_vertices()) {
if((unsigned int)it->idx() >= n_vertices()) {
std::cerr << "Vertex handle out of bounds!" << std::endl;
return InvalidFaceHandle;
}
......@@ -293,10 +293,10 @@ void TopologyKernel::reorder_incident_halffaces(const EdgeHandle& _eh) {
// into the first direction
assert(incident_hfs_per_he_.size() > (unsigned int)cur_he.idx());
if(incident_hfs_per_he_[cur_he].size() != 0) {
if(incident_hfs_per_he_[cur_he.idx()].size() != 0) {
// Get start halfface
cur_hf = *incident_hfs_per_he_[cur_he].begin();
cur_hf = *incident_hfs_per_he_[cur_he.idx()].begin();
start_hf = cur_hf;
while(cur_hf != InvalidHalfFaceHandle) {
......@@ -318,7 +318,7 @@ void TopologyKernel::reorder_incident_halffaces(const EdgeHandle& _eh) {
// If new_halffaces has the same size as old (unordered)
// vector of incident halffaces, we are done here
// If not, try the other way round
if(new_halffaces.size() != incident_hfs_per_he_[cur_he].size()) {
if(new_halffaces.size() != incident_hfs_per_he_[cur_he.idx()].size()) {
// Get opposite of start halfface
cur_hf = start_hf;
......@@ -337,8 +337,8 @@ void TopologyKernel::reorder_incident_halffaces(const EdgeHandle& _eh) {
}
// Everything worked just fine, set the new ordered vector
if(new_halffaces.size() == incident_hfs_per_he_[cur_he].size()) {
incident_hfs_per_he_[cur_he] = new_halffaces;
if(new_halffaces.size() == incident_hfs_per_he_[cur_he.idx()].size()) {
incident_hfs_per_he_[cur_he.idx()] = new_halffaces;
}
}
}
......@@ -352,7 +352,7 @@ CellHandle TopologyKernel::add_cell(const std::vector<HalfFaceHandle>& _halfface
// Test if halffaces have valid indices
for(std::vector<HalfFaceHandle>::const_iterator it = _halffaces.begin(),
end = _halffaces.end(); it != end; ++it) {
if((unsigned int)*it >= n_faces_ * 2u) {
if((unsigned int)it->idx() >= n_faces_ * 2u) {
std::cerr << "HalfFace handle is out of bounds!" << std::endl;
return InvalidCellHandle;
}
......@@ -410,7 +410,7 @@ CellHandle TopologyKernel::add_cell(const std::vector<HalfFaceHandle>& _halfface
end = _halffaces.end(); it != end; ++it) {
assert(incident_cell_per_hf_.size() > (unsigned int)it->idx());
assert(incident_cell_per_hf_[*it] == InvalidCellHandle);
incident_cell_per_hf_[*it] = ch;
incident_cell_per_hf_[it->idx()] = ch;
// Collect all edges of cell
const std::vector<HalfEdgeHandle> hes = halfface(*it).halfedges();
......@@ -469,7 +469,7 @@ VertexIter TopologyKernel::delete_vertex(const VertexHandle& _h) {
// Speed-up, because we know the incident edges
// Get incident edges
assert(outgoing_hes_per_vertex_.size() > (unsigned int)_h.idx());
const std::vector<HalfEdgeHandle>& inc_hes = outgoing_hes_per_vertex_[_h];
const std::vector<HalfEdgeHandle>& inc_hes = outgoing_hes_per_vertex_[_h.idx()];
for(std::vector<HalfEdgeHandle>::const_iterator he_it = inc_hes.begin(),
he_end = inc_hes.end(); he_it != he_end; ++he_it) {
incident_edges.push(edge_handle(*he_it));
......@@ -570,17 +570,17 @@ EdgeIter TopologyKernel::delete_edge(const EdgeHandle& _h) {
VertexHandle v1 = edge(_h).to_vertex();
assert(outgoing_hes_per_vertex_.size() > (unsigned int)std::max(v0, v1));
outgoing_hes_per_vertex_[v0].erase(
std::remove(outgoing_hes_per_vertex_[v0].begin(),
outgoing_hes_per_vertex_[v0].end(),
outgoing_hes_per_vertex_[v0.idx()].erase(
std::remove(outgoing_hes_per_vertex_[v0.idx()].begin(),
outgoing_hes_per_vertex_[v0.idx()].end(),
halfedge_handle(_h, 0)),
outgoing_hes_per_vertex_[v0].end());
outgoing_hes_per_vertex_[v0.idx()].end());
outgoing_hes_per_vertex_[v1].erase(
std::remove(outgoing_hes_per_vertex_[v1].begin(),
outgoing_hes_per_vertex_[v1].end(),
outgoing_hes_per_vertex_[v1.idx()].erase(
std::remove(outgoing_hes_per_vertex_[v1.idx()].begin(),
outgoing_hes_per_vertex_[v1.idx()].end(),
halfedge_handle(_h, 1)),
outgoing_hes_per_vertex_[v1].end());
outgoing_hes_per_vertex_[v1.idx()].end());
}
// 2)
......@@ -591,7 +591,7 @@ EdgeIter TopologyKernel::delete_edge(const EdgeHandle& _h) {
// Get incident faces
assert(incident_hfs_per_he_.size() > (unsigned int)halfedge_handle(_h, 0));
const std::vector<HalfFaceHandle>& inc_hfs = incident_hfs_per_he_[halfedge_handle(_h, 0)];
const std::vector<HalfFaceHandle>& inc_hfs = incident_hfs_per_he_[halfedge_handle(_h, 0).idx()];
for(std::vector<HalfFaceHandle>::const_iterator hf_it = inc_hfs.begin(),
hf_end = inc_hfs.end(); hf_it != hf_end; ++hf_it) {
incident_faces.push(face_handle(*hf_it));
......@@ -717,16 +717,16 @@ FaceIter TopologyKernel::delete_face(const FaceHandle& _h) {
assert(incident_hfs_per_he_.size() > (unsigned int)std::max(*he_it, opposite_halfedge_handle(*he_it)));
incident_hfs_per_he_[*he_it].erase(
std::remove(incident_hfs_per_he_[*he_it].begin(),
incident_hfs_per_he_[*he_it].end(),
halfface_handle(_h, 0)), incident_hfs_per_he_[*he_it].end());
incident_hfs_per_he_[he_it->idx()].erase(
std::remove(incident_hfs_per_he_[he_it->idx()].begin(),
incident_hfs_per_he_[he_it->idx()].end(),
halfface_handle(_h, 0)), incident_hfs_per_he_[he_it->idx()].end());
incident_hfs_per_he_[opposite_halfedge_handle(*he_it)].erase(
std::remove(incident_hfs_per_he_[opposite_halfedge_handle(*he_it)].begin(),
incident_hfs_per_he_[opposite_halfedge_handle(*he_it)].end(),
halfface_handle(_h, 1)), incident_hfs_per_he_[opposite_halfedge_handle(*he_it)].end());
incident_hfs_per_he_[opposite_halfedge_handle(*he_it).idx()].erase(
std::remove(incident_hfs_per_he_[opposite_halfedge_handle(*he_it).idx()].begin(),
incident_hfs_per_he_[opposite_halfedge_handle(*he_it).idx()].end(),
halfface_handle(_h, 1)), incident_hfs_per_he_[opposite_halfedge_handle(*he_it).idx()].end());
}
}
......@@ -737,11 +737,11 @@ FaceIter TopologyKernel::delete_face(const FaceHandle& _h) {
// Speed-up, since we already know all incident cells
// Get incident cells for deletion
assert(incident_cell_per_hf_.size() > (unsigned int)halfface_handle(_h, 1));
if(incident_cell_per_hf_[halfface_handle(_h, 0)].is_valid()) {
incident_cells.push(incident_cell_per_hf_[halfface_handle(_h, 0)]);
if(incident_cell_per_hf_[halfface_handle(_h, 0).idx()].is_valid()) {
incident_cells.push(incident_cell_per_hf_[halfface_handle(_h, 0).idx()]);
}
if(incident_cell_per_hf_[halfface_handle(_h, 1)].is_valid()) {
incident_cells.push(incident_cell_per_hf_[halfface_handle(_h, 1)]);
if(incident_cell_per_hf_[halfface_handle(_h, 1).idx()].is_valid()) {
incident_cells.push(incident_cell_per_hf_[halfface_handle(_h, 1).idx()]);
}
// Decrease all half-face handles > _h in all cells
......@@ -849,7 +849,7 @@ CellIter TopologyKernel::delete_cell(const CellHandle& _h) {
hf_end = hfs.end(); hf_it != hf_end; ++hf_it) {
assert(incident_cell_per_hf_.size() > (unsigned int)hf_it->idx());
incident_cell_per_hf_[*hf_it] = InvalidCellHandle;
incident_cell_per_hf_[hf_it->idx()] = InvalidCellHandle;
}
}
......@@ -880,7 +880,7 @@ const OpenVolumeMeshEdge& TopologyKernel::edge(const EdgeHandle& _edgeHandle) co
assert((unsigned int)_edgeHandle < n_edges_);
assert(_edgeHandle >= 0);
return edges_[_edgeHandle];
return edges_[_edgeHandle.idx()];
}
//========================================================================================
......@@ -892,7 +892,7 @@ const OpenVolumeMeshFace& TopologyKernel::face(const FaceHandle& _faceHandle) co
assert((unsigned int)_faceHandle < n_faces_);
assert(_faceHandle >= 0);
return faces_[_faceHandle];
return faces_[_faceHandle.idx()];
}
//========================================================================================
......@@ -904,7 +904,7 @@ const OpenVolumeMeshCell& TopologyKernel::cell(const CellHandle& _cellHandle) co
assert((unsigned int)_cellHandle < n_cells_);
assert(_cellHandle >= 0);
return cells_[_cellHandle];
return cells_[_cellHandle.idx()];
}
//========================================================================================
......@@ -916,7 +916,7 @@ OpenVolumeMeshEdge& TopologyKernel::edge(const EdgeHandle& _edgeHandle) {
assert((unsigned int)_edgeHandle < n_edges_);
assert(_edgeHandle >= 0);
return edges_[_edgeHandle];
return edges_[_edgeHandle.idx()];
}
//========================================================================================
......@@ -928,7 +928,7 @@ OpenVolumeMeshFace& TopologyKernel::face(const FaceHandle& _faceHandle) {
assert((unsigned int)_faceHandle < n_faces_);
assert(_faceHandle >= 0);
return faces_[_faceHandle];
return faces_[_faceHandle.idx()];
}
//========================================================================================
......@@ -940,7 +940,7 @@ OpenVolumeMeshCell& TopologyKernel::cell(const CellHandle& _cellHandle) {
assert((unsigned int)_cellHandle < n_cells_);
assert(_cellHandle >= 0);