Added functions to copy all properties between entities. (Thanks to Duncan Paterson for the patch)

refs #990

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@675 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2012-09-17 08:02:13 +00:00
parent 77c02b8107
commit a036b00d5f
3 changed files with 49 additions and 2 deletions

View File

@@ -439,6 +439,46 @@ public: //------------------------------------------------ copy property
}
//@}
public:
//------------------------------------------------ copy all properties
//@{
/** Copies all properties from one mesh element to another (of the same type)
*
* \param _vh_from A vertex handle - source
* \param _vh_to A vertex handle - target
*
*/
void copy_all_properties(VertexHandle _vh_from, VertexHandle _vh_to) {
for( PropertyContainer::iterator p_it = vprops_.begin();
p_it != vprops_.end(); ++p_it) {
(*p_it)->copy(_vh_from.idx(), _vh_to.idx());
}
}
void copy_all_properties(HalfedgeHandle _hh_from, HalfedgeHandle _hh_to) {
for( PropertyContainer::iterator p_it = hprops_.begin();
p_it != hprops_.end(); ++p_it) {
(*p_it)->copy(_hh_from.idx(), _hh_to.idx());
}
}
void copy_all_properties(EdgeHandle _eh_from, EdgeHandle _eh_to) {
for( PropertyContainer::iterator p_it = eprops_.begin();
p_it != eprops_.end(); ++p_it) {
(*p_it)->copy(_eh_from.idx(), _eh_to.idx());
}
}
void copy_all_properties(FaceHandle _fh_from, FaceHandle _fh_to) {
for( PropertyContainer::iterator p_it = fprops_.begin();
p_it != fprops_.end(); ++p_it) {
(*p_it)->copy(_fh_from.idx(), _fh_to.idx());
}
}
//@}
protected: //------------------------------------------------- low-level access