Added to the ClearPerVertexAttribute the possibility of init with a value

This commit is contained in:
Paolo Cignoni 2018-02-13 19:37:37 +01:00
parent d49cf2a97c
commit 91c74665fb
1 changed files with 2 additions and 2 deletions

View File

@ -1157,12 +1157,12 @@ public:
template <class ATTR_TYPE>
static
void
ClearPerVertexAttribute( MeshType & m,typename MeshType::template PerVertexAttributeHandle<ATTR_TYPE> & h){
ClearPerVertexAttribute( MeshType & m,typename MeshType::template PerVertexAttributeHandle<ATTR_TYPE> & h, const ATTR_TYPE & initVal = ATTR_TYPE()){
typename std::set<PointerToAttribute > ::iterator i;
for( i = m.vert_attr.begin(); i != m.vert_attr.end(); ++i)
if( (*i)._handle == h._handle ){
for(typename MeshType::VertexIterator vi = m.vert.begin(); vi != m.vert.end(); ++vi)
h[vi] = ATTR_TYPE();
h[vi] = initVal;
return;}
assert(0);
}