Commit d8885e88 authored by Philip Trettner's avatar Philip Trettner
Browse files

Merge branch 'patch-2' into 'master'

Fixed attribute_collection::accessor and const_accessor looking up attributes from the wrong maps.

See merge request !1
parents 03dcb61c 8a97032e
...@@ -80,21 +80,21 @@ public: ...@@ -80,21 +80,21 @@ public:
template <class AttrT> template <class AttrT>
face_attribute<AttrT>& face() face_attribute<AttrT>& face()
{ {
auto pa = ref.mVertexAttrs.at(name).get(); auto pa = ref.mFaceAttrs.at(name).get();
assert(pa && "non-existent attribute"); assert(pa && "non-existent attribute");
return *dynamic_cast<face_attribute<AttrT>*>(pa); return *dynamic_cast<face_attribute<AttrT>*>(pa);
} }
template <class AttrT> template <class AttrT>
edge_attribute<AttrT>& edge() edge_attribute<AttrT>& edge()
{ {
auto pa = ref.mVertexAttrs.at(name).get(); auto pa = ref.mEdgeAttrs.at(name).get();
assert(pa && "non-existent attribute"); assert(pa && "non-existent attribute");
return *dynamic_cast<edge_attribute<AttrT>*>(pa); return *dynamic_cast<edge_attribute<AttrT>*>(pa);
} }
template <class AttrT> template <class AttrT>
halfedge_attribute<AttrT>& halfedge() halfedge_attribute<AttrT>& halfedge()
{ {
auto pa = ref.mVertexAttrs.at(name).get(); auto pa = ref.mHalfedgeAttrs.at(name).get();
assert(pa && "non-existent attribute"); assert(pa && "non-existent attribute");
return *dynamic_cast<halfedge_attribute<AttrT>*>(pa); return *dynamic_cast<halfedge_attribute<AttrT>*>(pa);
} }
...@@ -114,21 +114,21 @@ public: ...@@ -114,21 +114,21 @@ public:
template <class AttrT> template <class AttrT>
face_attribute<AttrT>& face() face_attribute<AttrT>& face()
{ {
auto pa = ref.mVertexAttrs.at(name).get(); auto pa = ref.mFaceAttrs.at(name).get();
assert(pa && "non-existent attribute"); assert(pa && "non-existent attribute");
return *dynamic_cast<face_attribute<AttrT>*>(pa); return *dynamic_cast<face_attribute<AttrT>*>(pa);
} }
template <class AttrT> template <class AttrT>
edge_attribute<AttrT>& edge() edge_attribute<AttrT>& edge()
{ {
auto pa = ref.mVertexAttrs.at(name).get(); auto pa = ref.mEdgeAttrs.at(name).get();
assert(pa && "non-existent attribute"); assert(pa && "non-existent attribute");
return *dynamic_cast<edge_attribute<AttrT>*>(pa); return *dynamic_cast<edge_attribute<AttrT>*>(pa);
} }
template <class AttrT> template <class AttrT>
halfedge_attribute<AttrT>& halfedge() halfedge_attribute<AttrT>& halfedge()
{ {
auto pa = ref.mVertexAttrs.at(name).get(); auto pa = ref.mHalfedgeAttrs.at(name).get();
assert(pa && "non-existent attribute"); assert(pa && "non-existent attribute");
return *dynamic_cast<halfedge_attribute<AttrT>*>(pa); return *dynamic_cast<halfedge_attribute<AttrT>*>(pa);
} }
......
Supports Markdown
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