Added a whole bunch of doxygen documentation.
This commit is contained in:
@@ -200,39 +200,79 @@ public:
|
||||
|
||||
//---------------------------------------------------- synchronize properties
|
||||
|
||||
/*
|
||||
* In C++11 an beyond we can introduce more efficient and more legible
|
||||
* implementations of the following methods.
|
||||
*/
|
||||
#if (_MSC_VER >= 1900 || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
|
||||
/**
|
||||
* Reserves space for \p _n elements in all property vectors.
|
||||
*/
|
||||
void reserve(size_t _n) const {
|
||||
std::for_each(properties_.begin(), properties_.end(),
|
||||
[_n](BaseProperty* p) { if (p) p->reserve(_n); });
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes all property vectors to the specified size.
|
||||
*/
|
||||
void resize(size_t _n) const {
|
||||
std::for_each(properties_.begin(), properties_.end(),
|
||||
[_n](BaseProperty* p) { if (p) p->resize(_n); });
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as resize() but ignores property vectors that have a size larger
|
||||
* than \p _n.
|
||||
*
|
||||
* Use this method instead of resize() if you plan to frequently reduce
|
||||
* and enlarge the property container and you don't want to waste time
|
||||
* reallocating the property vectors every time.
|
||||
*/
|
||||
void resize_if_smaller(size_t _n) const {
|
||||
std::for_each(properties_.begin(), properties_.end(),
|
||||
[_n](BaseProperty* p) { if (p && p->n_elements() < _n) p->resize(_n); });
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the items with index \p _i0 and index \p _i1 in all property
|
||||
* vectors.
|
||||
*/
|
||||
void swap(size_t _i0, size_t _i1) const {
|
||||
std::for_each(properties_.begin(), properties_.end(),
|
||||
[_i0, _i1](BaseProperty* p) { if (p) p->swap(_i0, _i1); });
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* Reserves space for \p _n elements in all property vectors.
|
||||
*/
|
||||
void reserve(size_t _n) const {
|
||||
std::for_each(properties_.begin(), properties_.end(), Reserve(_n));
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes all property vectors to the specified size.
|
||||
*/
|
||||
void resize(size_t _n) const {
|
||||
std::for_each(properties_.begin(), properties_.end(), Resize(_n));
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as \sa resize() but ignores property vectors that have a size
|
||||
* larger than \p _n.
|
||||
*
|
||||
* Use this method instead of \sa resize() if you plan to frequently reduce
|
||||
* and enlarge the property container and you don't want to waste time
|
||||
* reallocating the property vectors every time.
|
||||
*/
|
||||
void resize_if_smaller(size_t _n) const {
|
||||
std::for_each(properties_.begin(), properties_.end(), ResizeIfSmaller(_n));
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps the items with index \p _i0 and index \p _i1 in all property
|
||||
* vectors.
|
||||
*/
|
||||
void swap(size_t _i0, size_t _i1) const {
|
||||
std::for_each(properties_.begin(), properties_.end(), Swap(_i0, _i1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user