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: ...@@ -60,61 +60,61 @@ public:
~StatusAttrib(); ~StatusAttrib();
const OpenVolumeMeshStatus& operator[](const VertexHandle& _h) const { const OpenVolumeMeshStatus& operator[](const VertexHandle& _h) const {
return v_status_[_h]; return v_status_[_h.idx()];
} }
OpenVolumeMeshStatus& operator[](const VertexHandle& _h) { OpenVolumeMeshStatus& operator[](const VertexHandle& _h) {
return v_status_[_h]; return v_status_[_h.idx()];
} }
const OpenVolumeMeshStatus& operator[](const EdgeHandle& _h) const { const OpenVolumeMeshStatus& operator[](const EdgeHandle& _h) const {
return e_status_[_h]; return e_status_[_h.idx()];
} }
OpenVolumeMeshStatus& operator[](const EdgeHandle& _h) { OpenVolumeMeshStatus& operator[](const EdgeHandle& _h) {
return e_status_[_h]; return e_status_[_h.idx()];
} }
const OpenVolumeMeshStatus& operator[](const HalfEdgeHandle& _h) const { const OpenVolumeMeshStatus& operator[](const HalfEdgeHandle& _h) const {
return he_status_[_h]; return he_status_[_h.idx()];
} }
OpenVolumeMeshStatus& operator[](const HalfEdgeHandle& _h) { OpenVolumeMeshStatus& operator[](const HalfEdgeHandle& _h) {
return he_status_[_h]; return he_status_[_h.idx()];
} }
const OpenVolumeMeshStatus& operator[](const FaceHandle& _h) const { const OpenVolumeMeshStatus& operator[](const FaceHandle& _h) const {
return f_status_[_h]; return f_status_[_h.idx()];
} }
OpenVolumeMeshStatus& operator[](const FaceHandle& _h) { OpenVolumeMeshStatus& operator[](const FaceHandle& _h) {
return f_status_[_h]; return f_status_[_h.idx()];
} }
const OpenVolumeMeshStatus& operator[](const HalfFaceHandle& _h) const { const OpenVolumeMeshStatus& operator[](const HalfFaceHandle& _h) const {
return hf_status_[_h]; return hf_status_[_h.idx()];
} }
OpenVolumeMeshStatus& operator[](const HalfFaceHandle& _h) { OpenVolumeMeshStatus& operator[](const HalfFaceHandle& _h) {
return hf_status_[_h]; return hf_status_[_h.idx()];
} }
const OpenVolumeMeshStatus& operator[](const CellHandle& _h) const { const OpenVolumeMeshStatus& operator[](const CellHandle& _h) const {
return c_status_[_h]; return c_status_[_h.idx()];
} }
OpenVolumeMeshStatus& operator[](const CellHandle& _h) { OpenVolumeMeshStatus& operator[](const CellHandle& _h) {
return c_status_[_h]; return c_status_[_h.idx()];
} }
const OpenVolumeMeshStatus& mesh_status() const { const OpenVolumeMeshStatus& mesh_status() const {
OpenVolumeMeshHandle h(0); OpenVolumeMeshHandle h(0);
return m_status_[h]; return m_status_[h.idx()];
} }
OpenVolumeMeshStatus& mesh_status() { OpenVolumeMeshStatus& mesh_status() {
OpenVolumeMeshHandle h(0); OpenVolumeMeshHandle h(0);
return m_status_[h]; return m_status_[h.idx()];
} }
typedef VertexPropertyT<OpenVolumeMeshStatus>::const_iterator const_vstatus_iterator; typedef VertexPropertyT<OpenVolumeMeshStatus>::const_iterator const_vstatus_iterator;
......
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
/// Get point _vh's coordinates /// Get point _vh's coordinates
const VecT& vertex(const VertexHandle& _vh) const { const VecT& vertex(const VertexHandle& _vh) const {
return vertices_[_vh]; return vertices_[_vh.idx()];
} }
virtual VertexIter delete_vertex(const VertexHandle& _h) { virtual VertexIter delete_vertex(const VertexHandle& _h) {
......
...@@ -65,19 +65,19 @@ cur_index_(0) { ...@@ -65,19 +65,19 @@ cur_index_(0) {
return; 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); BaseIter::valid(false);
} }
if(BaseIter::valid()) { 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); BaseIter::valid(false);
} }
} }
if(BaseIter::valid()) { if(BaseIter::valid()) {
BaseIter::cur_handle(( 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--() { ...@@ -90,7 +90,7 @@ VertexOHalfEdgeIter& VertexOHalfEdgeIter::operator--() {
BaseIter::valid(false); BaseIter::valid(false);
} else { } else {
BaseIter::cur_handle(( 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; return *this;
...@@ -101,11 +101,11 @@ VertexOHalfEdgeIter& VertexOHalfEdgeIter::operator++() { ...@@ -101,11 +101,11 @@ VertexOHalfEdgeIter& VertexOHalfEdgeIter::operator++() {
++cur_index_; ++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); BaseIter::valid(false);
} else { } else {
BaseIter::cur_handle(( 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; return *this;
...@@ -127,19 +127,19 @@ cur_index_(0) { ...@@ -127,19 +127,19 @@ cur_index_(0) {
return; 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); BaseIter::valid(false);
} }
if(BaseIter::valid()) { 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); BaseIter::valid(false);
} }
} }
if(BaseIter::valid()) { if(BaseIter::valid()) {
BaseIter::cur_handle(( 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--() { ...@@ -152,7 +152,7 @@ HalfEdgeHalfFaceIter& HalfEdgeHalfFaceIter::operator--() {
BaseIter::valid(false); BaseIter::valid(false);
} else { } else {
BaseIter::cur_handle(( 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; return *this;
...@@ -163,11 +163,11 @@ HalfEdgeHalfFaceIter& HalfEdgeHalfFaceIter::operator++() { ...@@ -163,11 +163,11 @@ HalfEdgeHalfFaceIter& HalfEdgeHalfFaceIter::operator++() {
++cur_index_; ++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); BaseIter::valid(false);
} else { } else {
BaseIter::cur_handle(( 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; return *this;
...@@ -188,22 +188,22 @@ BaseIter(_mesh, _ref_h) { ...@@ -188,22 +188,22 @@ BaseIter(_mesh, _ref_h) {
return; 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); BaseIter::valid(false);
return; return;
} }
// Build up cell list // 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) { 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; 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]; std::vector<HalfFaceHandle> incidentHalfFaces = BaseIter::mesh()->incident_hfs_per_he_[it->idx()];
for(std::vector<HalfFaceHandle>::const_iterator hf_it = incidentHalfFaces.begin(); for(std::vector<HalfFaceHandle>::const_iterator hf_it = incidentHalfFaces.begin();
hf_it != incidentHalfFaces.end(); ++hf_it) { hf_it != incidentHalfFaces.end(); ++hf_it) {
if((unsigned int)*hf_it < BaseIter::mesh()->incident_cell_per_hf_.size()) { if((unsigned int)hf_it->idx() < BaseIter::mesh()->incident_cell_per_hf_.size()) {
CellHandle c_idx = BaseIter::mesh()->incident_cell_per_hf_[*hf_it]; CellHandle c_idx = BaseIter::mesh()->incident_cell_per_hf_[hf_it->idx()];
if(c_idx != TopologyKernel::InvalidCellHandle) if(c_idx != TopologyKernel::InvalidCellHandle)
cells_.insert(c_idx); cells_.insert(c_idx);
} }
...@@ -256,24 +256,24 @@ cur_index_(0) { ...@@ -256,24 +256,24 @@ cur_index_(0) {
return; 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); BaseIter::valid(false);
return; 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); BaseIter::valid(false);
return; 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::mesh()->incident_cell_per_hf_.size()) {
BaseIter::valid(false); BaseIter::valid(false);
return; 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--() { ...@@ -285,7 +285,7 @@ HalfEdgeCellIter& HalfEdgeCellIter::operator--() {
return *this; return *this;
} }
BaseIter::cur_handle(BaseIter::mesh()->incident_cell_per_hf_[( 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; return *this;
} }
...@@ -293,19 +293,19 @@ HalfEdgeCellIter& HalfEdgeCellIter::operator--() { ...@@ -293,19 +293,19 @@ HalfEdgeCellIter& HalfEdgeCellIter::operator--() {
HalfEdgeCellIter& HalfEdgeCellIter::operator++() { HalfEdgeCellIter& HalfEdgeCellIter::operator++() {
++cur_index_; ++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); BaseIter::valid(false);
return *this; 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::mesh()->incident_cell_per_hf_.size()) {
BaseIter::valid(false); BaseIter::valid(false);
return *this; return *this;
} }
BaseIter::cur_handle(BaseIter::mesh()->incident_cell_per_hf_[( 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; return *this;
} }
...@@ -377,7 +377,7 @@ BaseIter(_mesh, _ref_h) { ...@@ -377,7 +377,7 @@ BaseIter(_mesh, _ref_h) {
for(; hf_iter != BaseIter::mesh()->cell(_ref_h).halffaces().end(); ++hf_iter) { for(; hf_iter != BaseIter::mesh()->cell(_ref_h).halffaces().end(); ++hf_iter) {
HalfFaceHandle opp_hf = BaseIter::mesh()->opposite_halfface_handle(*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) { if(ch != TopologyKernel::InvalidCellHandle) {
adjacent_cells_.insert(ch); adjacent_cells_.insert(ch);
} }
......
...@@ -44,6 +44,25 @@ ...@@ -44,6 +44,25 @@
namespace OpenVolumeMesh { 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) { std::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle) {
_ostr << _handle.idx(); _ostr << _handle.idx();
return _ostr; return _ostr;
......
...@@ -72,13 +72,21 @@ public: ...@@ -72,13 +72,21 @@ public:
inline bool operator<(int _idx) const { return idx_ < _idx; } 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_; } inline const int& idx() const { return idx_; }
void idx(const int& _idx) { idx_ = _idx; } void idx(const int& _idx) { idx_ = _idx; }
void reset() { idx_ = -1; } void reset() { idx_ = -1; }
inline operator int() const { return idx_; } //inline operator int() const { return idx_; }
private: private:
int idx_; int idx_;
...@@ -139,6 +147,14 @@ private: ...@@ -139,6 +147,14 @@ private:
CellHandle thld_; 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::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle);
std::istream& operator>>(std::istream& _istr, OpenVolumeMeshHandle& _handle); std::istream& operator>>(std::istream& _istr, OpenVolumeMeshHandle& _handle);
......
...@@ -95,6 +95,9 @@ public: ...@@ -95,6 +95,9 @@ public:
reference operator[](size_t _idx) { return (*ptr::shared_ptr<PropT>::get())[_idx]; } 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]; } 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 OpenVolumeMeshHandle handle() const;
virtual bool persistent() const { return ptr::shared_ptr<PropT>::get()->persistent(); } virtual bool persistent() const { return ptr::shared_ptr<PropT>::get()->persistent(); }
......
...@@ -93,7 +93,7 @@ VertexHandle TopologyKernel::add_vertex() { ...@@ -93,7 +93,7 @@ VertexHandle TopologyKernel::add_vertex() {
EdgeHandle TopologyKernel::add_edge(const VertexHandle& _fromVertex, EdgeHandle TopologyKernel::add_edge(const VertexHandle& _fromVertex,
const VertexHandle& _toVertex) { 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; std::cerr << "Vertex handle is out of bounds!" << std::endl;
return InvalidEdgeHandle; return InvalidEdgeHandle;
} }
...@@ -123,8 +123,8 @@ EdgeHandle TopologyKernel::add_edge(const VertexHandle& _fromVertex, ...@@ -123,8 +123,8 @@ EdgeHandle TopologyKernel::add_edge(const VertexHandle& _fromVertex,
if(v_bottom_up_) { if(v_bottom_up_) {
assert(outgoing_hes_per_vertex_.size() > (unsigned int)_fromVertex.idx()); assert(outgoing_hes_per_vertex_.size() > (unsigned int)_fromVertex.idx());
assert(outgoing_hes_per_vertex_.size() > (unsigned int)_toVertex.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_[_fromVertex.idx()].push_back(halfedge_handle(eh, 0));
outgoing_hes_per_vertex_[_toVertex].push_back(halfedge_handle(eh, 1)); outgoing_hes_per_vertex_[_toVertex.idx()].push_back(halfedge_handle(eh, 1));
} }
// Create item for edge bottom-up adjacencies // Create item for edge bottom-up adjacencies
...@@ -144,7 +144,7 @@ FaceHandle TopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedge ...@@ -144,7 +144,7 @@ FaceHandle TopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedge
// Test if all edges are valid // Test if all edges are valid
for(std::vector<HalfEdgeHandle>::const_iterator it = _halfedges.begin(), for(std::vector<HalfEdgeHandle>::const_iterator it = _halfedges.begin(),
end = _halfedges.end(); it != end; ++it) { 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; std::cerr << "Halfedge handle out of bounds!" << std::endl;
return InvalidFaceHandle; return InvalidFaceHandle;
} }
...@@ -205,8 +205,8 @@ FaceHandle TopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedge ...@@ -205,8 +205,8 @@ FaceHandle TopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedge
end = _halfedges.end(); it != end; ++it) { end = _halfedges.end(); it != end; ++it) {
assert(incident_hfs_per_he_.size() > (unsigned int)it->idx()); assert(incident_hfs_per_he_.size() > (unsigned int)it->idx());
assert(incident_hfs_per_he_.size() > (unsigned int)opposite_halfedge_handle(*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_[it->idx()].push_back(halfface_handle(fh, 0));
incident_hfs_per_he_[opposite_halfedge_handle(*it)].push_back(halfface_handle(fh, 1)); 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) ...@@ -228,7 +228,7 @@ FaceHandle TopologyKernel::add_face(const std::vector<VertexHandle>& _vertices)
// Test if all vertices exist // Test if all vertices exist
for(std::vector<VertexHandle>::const_iterator it = _vertices.begin(), for(std::vector<VertexHandle>::const_iterator it = _vertices.begin(),
end = _vertices.end(); it != end; ++it) { 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; std::cerr << "Vertex handle out of bounds!" << std::endl;
return InvalidFaceHandle; return InvalidFaceHandle;
} }
...@@ -293,10 +293,10 @@ void TopologyKernel::reorder_incident_halffaces(const EdgeHandle& _eh) { ...@@ -293,10 +293,10 @@ void TopologyKernel::reorder_incident_halffaces(const EdgeHandle& _eh) {
// into the first direction // into the first direction
assert(incident_hfs_per_he_.size() > (unsigned int)cur_he.idx()); assert(incident_hfs_per_he_.size() > (unsigned int)cur_he.idx());