Commit c5c33164 authored by Mike Kremer's avatar Mike Kremer

Fixed property request function so that both persistent and non-persistent...

Fixed property request function so that both persistent and non-persistent properties can be fetched.

git-svn-id: 66977474-1d4b-4f09-8fe9-267525286df2
parent d7518286
......@@ -98,10 +98,10 @@ PropT ResourceManager::request_property(StdVecT& _vec, const std::string& _name,
if(!_name.empty()) {
for(typename StdVecT::iterator it = _vec.begin();
it != _vec.end(); ++it) {
if(!(*it)->persistent()) continue;
if((*it)->name() == _name) {
PropT* prop = dynamic_cast<PropT*>(*it);
return *prop;
if(prop != NULL) return *prop;
else break;
......@@ -45,13 +45,13 @@ TEST_F(PolyhedralMeshBase, PropertySmartPointerTest1) {
VertexPropertyT<float> v_prop_duplicate = mesh_.request_vertex_property<float>("MyVProp");
EXPECT_EQ(3u, mesh_.n_vertex_props());
EXPECT_EQ(2u, mesh_.n_vertex_props());
EXPECT_FLOAT_EQ(1.4f, v_prop3[0]);
VertexPropertyT<std::string> v_prop_duplicate_2 = mesh_.request_vertex_property<std::string>("MyVProp");
EXPECT_EQ(4u, mesh_.n_vertex_props());
EXPECT_EQ(3u, mesh_.n_vertex_props());
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment