diff --git a/Doc/changelog.docu b/Doc/changelog.docu
index 9544b5ef..67971d0b 100644
--- a/Doc/changelog.docu
+++ b/Doc/changelog.docu
@@ -8,7 +8,13 @@
-
| 2.4 (?/?/?,Rev.820) |
+ |
| 2.4 (?/?/?,Rev.821) |
+
+Vector Type
+
+- 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)
+
IO
diff --git a/src/OpenMesh/Core/Geometry/VectorT_inc.hh b/src/OpenMesh/Core/Geometry/VectorT_inc.hh
index 6bf9c732..905f6bd3 100644
--- a/src/OpenMesh/Core/Geometry/VectorT_inc.hh
+++ b/src/OpenMesh/Core/Geometry/VectorT_inc.hh
@@ -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);
}
|