Commit fb81bf64 authored by Martin Heistermann's avatar Martin Heistermann

fix some signedness mismatches when indexing vectors with handle indexes

parent 8d3434ba
Pipeline #11829 passed with stage
in 4 minutes and 1 second
...@@ -675,7 +675,7 @@ public: ...@@ -675,7 +675,7 @@ public:
assert(has_vertex_bottom_up_incidences()); assert(has_vertex_bottom_up_incidences());
assert(_vh.is_valid() && _vh.uidx() < outgoing_hes_per_vertex_.size()); assert(_vh.is_valid() && _vh.uidx() < outgoing_hes_per_vertex_.size());
return outgoing_hes_per_vertex_[_vh.idx()].size(); return outgoing_hes_per_vertex_[_vh.uidx()].size();
} }
/// Get valence of edge (number of incident faces) /// Get valence of edge (number of incident faces)
...@@ -684,7 +684,7 @@ public: ...@@ -684,7 +684,7 @@ public:
assert(_eh.is_valid() && _eh.uidx() < edges_.size()); assert(_eh.is_valid() && _eh.uidx() < edges_.size());
assert(halfedge_handle(_eh, 0).uidx() < incident_hfs_per_he_.size()); assert(halfedge_handle(_eh, 0).uidx() < incident_hfs_per_he_.size());
return incident_hfs_per_he_[halfedge_handle(_eh, 0).idx()].size(); return incident_hfs_per_he_[halfedge_handle(_eh, 0).uidx()].size();
} }
/// Get valence of face (number of incident edges) /// Get valence of face (number of incident edges)
...@@ -718,12 +718,12 @@ public: ...@@ -718,12 +718,12 @@ public:
virtual void collect_garbage(); virtual void collect_garbage();
virtual bool is_deleted(const VertexHandle& _h) const { return vertex_deleted_[_h.idx()]; } virtual bool is_deleted(const VertexHandle& _h) const { return vertex_deleted_[_h.uidx()]; }
virtual bool is_deleted(const EdgeHandle& _h) const { return edge_deleted_[_h.idx()]; } virtual bool is_deleted(const EdgeHandle& _h) const { return edge_deleted_[_h.uidx()]; }
virtual bool is_deleted(const HalfEdgeHandle& _h) const { return edge_deleted_[_h.idx()/2]; } virtual bool is_deleted(const HalfEdgeHandle& _h) const { return edge_deleted_[_h.uidx()/2]; }
virtual bool is_deleted(const FaceHandle& _h) const { return face_deleted_[_h.idx()]; } virtual bool is_deleted(const FaceHandle& _h) const { return face_deleted_[_h.uidx()]; }
virtual bool is_deleted(const HalfFaceHandle& _h) const { return face_deleted_[_h.idx()/2]; } virtual bool is_deleted(const HalfFaceHandle& _h) const { return face_deleted_[_h.uidx()/2]; }
virtual bool is_deleted(const CellHandle& _h) const { return cell_deleted_[_h.idx()]; } virtual bool is_deleted(const CellHandle& _h) const { return cell_deleted_[_h.uidx()]; }
private: private:
...@@ -774,8 +774,8 @@ protected: ...@@ -774,8 +774,8 @@ protected:
newIndices_(_newIndices) {} newIndices_(_newIndices) {}
void operator()(Edge& _edge) { void operator()(Edge& _edge) {
_edge.set_from_vertex(VertexHandle(newIndices_[_edge.from_vertex().idx()])); _edge.set_from_vertex(VertexHandle(newIndices_[_edge.from_vertex().uidx()]));
_edge.set_to_vertex(VertexHandle(newIndices_[_edge.to_vertex().idx()])); _edge.set_to_vertex(VertexHandle(newIndices_[_edge.to_vertex().uidx()]));
} }
private: private:
const std::vector<int>& newIndices_; const std::vector<int>& newIndices_;
...@@ -793,7 +793,7 @@ protected: ...@@ -793,7 +793,7 @@ protected:
EdgeHandle eh = edge_handle(*he_it); EdgeHandle eh = edge_handle(*he_it);
unsigned char opp = he_it->idx() == halfedge_handle(eh, 1).idx(); unsigned char opp = he_it->idx() == halfedge_handle(eh, 1).idx();
*he_it = halfedge_handle(EdgeHandle(newIndices_[eh.idx()]), opp); *he_it = halfedge_handle(EdgeHandle(newIndices_[eh.uidx()]), opp);
} }
_face.set_halfedges(hes); _face.set_halfedges(hes);
} }
...@@ -813,7 +813,7 @@ protected: ...@@ -813,7 +813,7 @@ protected:
FaceHandle fh = face_handle(*hf_it); FaceHandle fh = face_handle(*hf_it);
unsigned char opp = hf_it->idx() == halfface_handle(fh, 1).idx(); unsigned char opp = hf_it->idx() == halfface_handle(fh, 1).idx();
*hf_it = halfface_handle(FaceHandle(newIndices_[fh.idx()]), opp); *hf_it = halfface_handle(FaceHandle(newIndices_[fh.uidx()]), opp);
} }
_cell.set_halffaces(hfs); _cell.set_halffaces(hfs);
} }
...@@ -1034,7 +1034,7 @@ public: ...@@ -1034,7 +1034,7 @@ public:
assert(_halfFaceHandle.is_valid() && _halfFaceHandle.uidx() < faces_.size() * 2u); assert(_halfFaceHandle.is_valid() && _halfFaceHandle.uidx() < faces_.size() * 2u);
assert(has_face_bottom_up_incidences()); assert(has_face_bottom_up_incidences());
assert(_halfFaceHandle.uidx() < incident_cell_per_hf_.size()); assert(_halfFaceHandle.uidx() < incident_cell_per_hf_.size());
return incident_cell_per_hf_[_halfFaceHandle.idx()] == InvalidCellHandle; return incident_cell_per_hf_[_halfFaceHandle.uidx()] == InvalidCellHandle;
} }
bool is_boundary(const FaceHandle& _faceHandle) const { bool is_boundary(const FaceHandle& _faceHandle) 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