mathutil: Add proper __repr__ for LPlane class

Fixes #1248
This commit is contained in:
rdb 2022-02-06 15:26:41 +01:00
parent a37dfa727e
commit 287b0d5a74
2 changed files with 15 additions and 0 deletions

View File

@ -158,3 +158,17 @@ void FLOATNAME(LPlane)::
write(std::ostream &out, int indent_level) const {
indent(out, indent_level) << *this << "\n";
}
/**
* Returns a string representation of this LPlane.
*/
std::string FLOATNAME(LPlane)::
__repr__() const {
std::ostringstream out;
out << "LPlane" << FLOATTOKEN << "("
<< MAYBE_ZERO(_v(0)) << ", "
<< MAYBE_ZERO(_v(1)) << ", "
<< MAYBE_ZERO(_v(2)) << ", "
<< MAYBE_ZERO(_v(3)) << ")";
return out.str();
}

View File

@ -61,6 +61,7 @@ PUBLISHED:
void output(std::ostream &out) const;
void write(std::ostream &out, int indent_level = 0) const;
std::string __repr__() const;
};
INLINE_MATHUTIL std::ostream &