fix: Nipoint3 Operator+= (#1172)

* fix operator +=

* fix operator +=
This commit is contained in:
David Markowitz
2023-07-31 00:22:56 -07:00
committed by GitHub
parent e299bf9b62
commit 0d48cfe8c0
3 changed files with 15 additions and 4 deletions

View File

@@ -129,11 +129,13 @@ NiPoint3 NiPoint3::operator+(const NiPoint3& point) const {
}
//! Operator for addition of vectors
NiPoint3 NiPoint3::operator+=(const NiPoint3& point) const {
return NiPoint3(this->x + point.x, this->y + point.y, this->z + point.z);
NiPoint3& NiPoint3::operator+=(const NiPoint3& point) {
this->x += point.x;
this->y += point.y;
this->z += point.z;
return *this;
}
//! Operator for subtraction of vectors
NiPoint3 NiPoint3::operator-(const NiPoint3& point) const {
return NiPoint3(this->x - point.x, this->y - point.y, this->z - point.z);

View File

@@ -136,7 +136,7 @@ public:
NiPoint3 operator+(const NiPoint3& point) const;
//! Operator for addition of vectors
NiPoint3 operator+=(const NiPoint3& point) const;
NiPoint3& operator+=(const NiPoint3& point);
//! Operator for subtraction of vectors
NiPoint3 operator-(const NiPoint3& point) const;