]> git.tdb.fi Git - libs/gl.git/blobdiff - source/armature.cpp
Visit the rest of an iteration statement in NodeRemover
[libs/gl.git] / source / armature.cpp
index d7a944ede7dbce5ce4dd316572dc7513d790db15..6e921e3f8e9ea95246b8dae655ba54f701d0689d 100644 (file)
@@ -1,3 +1,4 @@
+#include <msp/core/maputils.h>
 #include "armature.h"
 
 using namespace std;
@@ -13,24 +14,24 @@ Armature::Link &Armature::add_link()
 
 const Armature::Link &Armature::get_link(unsigned index) const
 {
-       for(list<Link>::const_iterator i=links.begin(); i!=links.end(); ++i)
+       for(vector<Link>::const_iterator i=links.begin(); i!=links.end(); ++i)
                if(i->get_index()==index)
                        return *i;
-       throw invalid_argument("Armature::get_link");
+       throw key_error(typeid(list<Link>));
 }
 
 const Armature::Link &Armature::get_link(const string &name) const
 {
-       for(list<Link>::const_iterator i=links.begin(); i!=links.end(); ++i)
+       for(vector<Link>::const_iterator i=links.begin(); i!=links.end(); ++i)
                if(i->get_name()==name)
                        return *i;
-       throw invalid_argument("Armature::get_link");
+       throw key_error(typeid(list<Link>));
 }
 
 unsigned Armature::get_max_link_index() const
 {
        unsigned max_index = 0;
-       for(list<Link>::const_iterator i=links.begin(); i!=links.end(); ++i)
+       for(vector<Link>::const_iterator i=links.begin(); i!=links.end(); ++i)
                max_index = max(max_index, i->get_index());
        return max_index;
 }