Commit ae006c15 authored by Mike Kremer's avatar Mike Kremer
Browse files

Removed annoying warning about non-persistent properties when clearing OpenVolumeMeshes.

Patch was written by Max Lyon.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@254 66977474-1d4b-4f09-8fe9-267525286df2
parent 67552980
...@@ -200,20 +200,22 @@ void ResourceManager::entity_deleted(StdVecT& _vec, const OpenVolumeMeshHandle& ...@@ -200,20 +200,22 @@ void ResourceManager::entity_deleted(StdVecT& _vec, const OpenVolumeMeshHandle&
template<class StdVecT> template<class StdVecT>
void ResourceManager::clearVec(StdVecT& _vec) { void ResourceManager::clearVec(StdVecT& _vec) {
StdVecT newVec;
for(typename StdVecT::iterator it = _vec.begin(); for(typename StdVecT::iterator it = _vec.begin();
it != _vec.end(); ++it) { it != _vec.end(); ++it) {
if(!(*it)->persistent()) { if(!(*it)->persistent()) {
std::cerr << "Could not clear properties since at " << #ifndef NDEBUG
"least one property is still in use!" << std::endl; std::cerr << "Keeping property \"" << (*it)->name()
return; << "\" since it is still in use!" << std::endl;
#endif
(*it)->resize(0);
newVec.push_back(*it);
} }
else
delete *it;
} }
for(typename StdVecT::iterator it = _vec.begin(); _vec = newVec;
it != _vec.end(); ++it) {
delete *it;
}
_vec.clear();
} }
} // Namespace OpenVolumeMesh } // Namespace OpenVolumeMesh
...@@ -82,7 +82,7 @@ bool FileManager::readFile(const std::string& _filename, MeshT& _mesh, ...@@ -82,7 +82,7 @@ bool FileManager::readFile(const std::string& _filename, MeshT& _mesh,
Point v = Point(0.0, 0.0, 0.0); Point v = Point(0.0, 0.0, 0.0);
unsigned int v1 = 0; unsigned int v2 = 0; unsigned int v1 = 0; unsigned int v2 = 0;
_mesh.clear(); _mesh.clear(false);
// Temporarily disable bottom-up incidences // Temporarily disable bottom-up incidences
// since it's way faster to first add all the // since it's way faster to first add all the
// geometry and compute them in one pass afterwards // geometry and compute them in one pass afterwards
......
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