Commit eba9a44f by Philipp Adolf

Implement != for Triangle

parent 0727fa49
...@@ -139,6 +139,10 @@ bool Triangle::operator==(const Triangle &other) const { ...@@ -139,6 +139,10 @@ bool Triangle::operator==(const Triangle &other) const {
return u_ == other.u_ && v_ == other.v_ && w_ == other.w_; return u_ == other.u_ && v_ == other.v_ && w_ == other.w_;
} }
bool Triangle::operator!=(const Triangle &other) const {
return !(*this == other);
}
bool Triangle::operator<(const Triangle &other) const { bool Triangle::operator<(const Triangle &other) const {
if (u_ < other.u_) { if (u_ < other.u_) {
return true; return true;
......
...@@ -55,6 +55,7 @@ class Triangle { ...@@ -55,6 +55,7 @@ class Triangle {
// == and < both ignore the vertex buffer, they only compare indices. // == and < both ignore the vertex buffer, they only compare indices.
// They are implemented so that Triangle can be used as the key of a QMap. // They are implemented so that Triangle can be used as the key of a QMap.
bool operator==(const Triangle &other) const; bool operator==(const Triangle &other) const;
bool operator!=(const Triangle &other) const;
bool operator<(const Triangle &other) const; bool operator<(const Triangle &other) const;
bool next_ctrclockwise(Edge first, Edge next) const; bool next_ctrclockwise(Edge first, Edge next) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment