vector_type min(const vector_type& _rhs) and vector_type max(const vector_type& _rhs) are declared const now. (Thanks to Vladimir Chalupecky for the hint)
minimize and maximize return vector_type& (reference) instead of vector_type (value) to allow chaining p.minimize(p1).minimize(p2). (Thanks to Vladimir Chalupecky for the hint) git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@822 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -8,7 +8,13 @@
|
||||
<!-- --------------------------------------------------------------------- -->
|
||||
|
||||
|
||||
<tr valign=top><td><b>2.4</b> (?/?/?,Rev.820)</td><td>
|
||||
<tr valign=top><td><b>2.4</b> (?/?/?,Rev.821)</td><td>
|
||||
|
||||
<b>Vector Type</b>
|
||||
<ul>
|
||||
<li>vector_type min(const vector_type& _rhs) and vector_type max(const vector_type& _rhs) are declared const now. (Thanks to Vladimir Chalupecky for the hint)</li>
|
||||
<li>minimize and maximize return vector_type& (reference) instead of vector_type (value) to allow chaining p.minimize(p1).minimize(p2). (Thanks to Vladimir Chalupecky for the hint)</li>
|
||||
</ul>
|
||||
|
||||
<b>IO</b>
|
||||
<ul>
|
||||
|
||||
@@ -535,7 +535,7 @@ public:
|
||||
|
||||
|
||||
/// minimize values: same as *this = min(*this, _rhs), but faster
|
||||
inline vector_type minimize(const vector_type& _rhs) {
|
||||
inline vector_type& minimize(const vector_type& _rhs) {
|
||||
#define expr(i) if (_rhs[i] < Base::values_[i]) Base::values_[i] = _rhs[i];
|
||||
unroll(expr);
|
||||
#undef expr
|
||||
@@ -552,7 +552,7 @@ public:
|
||||
}
|
||||
|
||||
/// maximize values: same as *this = max(*this, _rhs), but faster
|
||||
inline vector_type maximize(const vector_type& _rhs) {
|
||||
inline vector_type& maximize(const vector_type& _rhs) {
|
||||
#define expr(i) if (_rhs[i] > Base::values_[i]) Base::values_[i] = _rhs[i];
|
||||
unroll(expr);
|
||||
#undef expr
|
||||
@@ -569,12 +569,12 @@ public:
|
||||
}
|
||||
|
||||
/// component-wise min
|
||||
inline vector_type min(const vector_type& _rhs) {
|
||||
inline vector_type min(const vector_type& _rhs) const {
|
||||
return vector_type(*this).minimize(_rhs);
|
||||
}
|
||||
|
||||
/// component-wise max
|
||||
inline vector_type max(const vector_type& _rhs) {
|
||||
inline vector_type max(const vector_type& _rhs) const {
|
||||
return vector_type(*this).maximize(_rhs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user