diff --git a/panda/src/linmath/lmatrix3_src.cxx b/panda/src/linmath/lmatrix3_src.cxx index 320f4010ec..ea14ea72e3 100644 --- a/panda/src/linmath/lmatrix3_src.cxx +++ b/panda/src/linmath/lmatrix3_src.cxx @@ -288,6 +288,29 @@ write(ostream &out, int indent_level) const { << "\n"; } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LMatrix3):: +python_repr(ostream &out, const string &class_name) const { + out << class_name << "(" + << MAYBE_ZERO(_m.m._00) << ", " + << MAYBE_ZERO(_m.m._01) << ", " + << MAYBE_ZERO(_m.m._02) << ", " + + << MAYBE_ZERO(_m.m._10) << ", " + << MAYBE_ZERO(_m.m._11) << ", " + << MAYBE_ZERO(_m.m._12) << ", " + + << MAYBE_ZERO(_m.m._20) << ", " + << MAYBE_ZERO(_m.m._21) << ", " + << MAYBE_ZERO(_m.m._22) << ")"; +} +#endif // HAVE_PYTHON + //////////////////////////////////////////////////////////////////// // Function: LMatrix3::generate_hash // Access: Public diff --git a/panda/src/linmath/lmatrix3_src.h b/panda/src/linmath/lmatrix3_src.h index 69a35c87bc..f595b4f36e 100644 --- a/panda/src/linmath/lmatrix3_src.h +++ b/panda/src/linmath/lmatrix3_src.h @@ -188,6 +188,9 @@ PUBLISHED: void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; +#ifdef HAVE_PYTHON + void python_repr(ostream &out, const string &class_name) const; +#endif public: INLINE_LINMATH void generate_hash(ChecksumHashGenerator &hashgen) const; diff --git a/panda/src/linmath/lmatrix4_src.cxx b/panda/src/linmath/lmatrix4_src.cxx index 1e6a14ac05..2c6027dbb6 100644 --- a/panda/src/linmath/lmatrix4_src.cxx +++ b/panda/src/linmath/lmatrix4_src.cxx @@ -196,6 +196,37 @@ output(ostream &out) const { << " ]"; } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LMatrix4):: +python_repr(ostream &out, const string &class_name) const { + out << class_name << "(" + << MAYBE_ZERO(_m.m._00) << ", " + << MAYBE_ZERO(_m.m._01) << ", " + << MAYBE_ZERO(_m.m._02) << ", " + << MAYBE_ZERO(_m.m._03) << ", " + + << MAYBE_ZERO(_m.m._10) << ", " + << MAYBE_ZERO(_m.m._11) << ", " + << MAYBE_ZERO(_m.m._12) << ", " + << MAYBE_ZERO(_m.m._13) << ", " + + << MAYBE_ZERO(_m.m._20) << ", " + << MAYBE_ZERO(_m.m._21) << ", " + << MAYBE_ZERO(_m.m._22) << ", " + << MAYBE_ZERO(_m.m._23) << ", " + + << MAYBE_ZERO(_m.m._30) << ", " + << MAYBE_ZERO(_m.m._31) << ", " + << MAYBE_ZERO(_m.m._32) << ", " + << MAYBE_ZERO(_m.m._33) << ")"; +} +#endif // HAVE_PYTHON + //////////////////////////////////////////////////////////////////// // Function: LMatrix4::write // Access: Public diff --git a/panda/src/linmath/lmatrix4_src.h b/panda/src/linmath/lmatrix4_src.h index 021113c42f..d665546b67 100644 --- a/panda/src/linmath/lmatrix4_src.h +++ b/panda/src/linmath/lmatrix4_src.h @@ -181,6 +181,9 @@ PUBLISHED: void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; +#ifdef HAVE_PYTHON + void python_repr(ostream &out, const string &class_name) const; +#endif public: INLINE_LINMATH void generate_hash(ChecksumHashGenerator &hashgen) const; diff --git a/panda/src/linmath/lpoint2_src.I b/panda/src/linmath/lpoint2_src.I index 4201fe76f4..f952f70d62 100644 --- a/panda/src/linmath/lpoint2_src.I +++ b/panda/src/linmath/lpoint2_src.I @@ -188,3 +188,15 @@ INLINE_LINMATH FLOATNAME(LPoint2) FLOATNAME(LPoint2):: operator / (FLOATTYPE scalar) const { return FLOATNAME(LPoint2)(FLOATNAME(LVecBase2)::operator / (scalar)); } + +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LPoint2::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LPoint2):: +python_repr(ostream &out, const string &class_name) const { + FLOATNAME(LVecBase2)::python_repr(out, class_name); +} +#endif // HAVE_PYTHON diff --git a/panda/src/linmath/lpoint2_src.h b/panda/src/linmath/lpoint2_src.h index 44f70639f2..2caf89d183 100644 --- a/panda/src/linmath/lpoint2_src.h +++ b/panda/src/linmath/lpoint2_src.h @@ -51,6 +51,10 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint2) operator * (FLOATTYPE scalar) const; INLINE_LINMATH FLOATNAME(LPoint2) operator / (FLOATTYPE scalar) const; +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/linmath/lpoint3_src.I b/panda/src/linmath/lpoint3_src.I index 4d9f995a2a..4a1eb19688 100644 --- a/panda/src/linmath/lpoint3_src.I +++ b/panda/src/linmath/lpoint3_src.I @@ -236,3 +236,14 @@ rfu(FLOATTYPE right_v, FLOATTYPE fwd_v, FLOATTYPE up_v, FLOATNAME(LVector3)::rfu(right_v, fwd_v, up_v, cs); } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LPoint3::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LPoint3):: +python_repr(ostream &out, const string &class_name) const { + FLOATNAME(LVecBase3)::python_repr(out, class_name); +} +#endif // HAVE_PYTHON diff --git a/panda/src/linmath/lpoint3_src.h b/panda/src/linmath/lpoint3_src.h index 3bcb55abfc..28dc5391b7 100644 --- a/panda/src/linmath/lpoint3_src.h +++ b/panda/src/linmath/lpoint3_src.h @@ -65,6 +65,11 @@ PUBLISHED: FLOATTYPE fwd, FLOATTYPE up, CoordinateSystem cs = CS_default); + +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/linmath/lpoint4_src.I b/panda/src/linmath/lpoint4_src.I index 6317db0807..fa267bd6ef 100644 --- a/panda/src/linmath/lpoint4_src.I +++ b/panda/src/linmath/lpoint4_src.I @@ -208,3 +208,15 @@ INLINE_LINMATH FLOATNAME(LPoint4) FLOATNAME(LPoint4):: operator / (FLOATTYPE scalar) const { return FLOATNAME(LPoint4)(FLOATNAME(LVecBase4)::operator / (scalar)); } + +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LPoint4::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LPoint4):: +python_repr(ostream &out, const string &class_name) const { + FLOATNAME(LVecBase4)::python_repr(out, class_name); +} +#endif // HAVE_PYTHON diff --git a/panda/src/linmath/lpoint4_src.h b/panda/src/linmath/lpoint4_src.h index feec73fa76..69eb7eab3e 100644 --- a/panda/src/linmath/lpoint4_src.h +++ b/panda/src/linmath/lpoint4_src.h @@ -52,6 +52,10 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint4) operator * (FLOATTYPE scalar) const; INLINE_LINMATH FLOATNAME(LPoint4) operator / (FLOATTYPE scalar) const; +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/linmath/lvecBase2_src.I b/panda/src/linmath/lvecBase2_src.I index a6d5ded1c5..bef5e96f5b 100644 --- a/panda/src/linmath/lvecBase2_src.I +++ b/panda/src/linmath/lvecBase2_src.I @@ -592,6 +592,20 @@ output(ostream &out) const { << MAYBE_ZERO(_v.v._1); } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVecBase2::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVecBase2):: +python_repr(ostream &out, const string &class_name) const { + out << class_name << "(" + << MAYBE_ZERO(_v.v._0) << ", " + << MAYBE_ZERO(_v.v._1) << ")"; +} +#endif // HAVE_PYTHON + //////////////////////////////////////////////////////////////////// // Function: LVecBase2::generate_hash // Access: Public diff --git a/panda/src/linmath/lvecBase2_src.h b/panda/src/linmath/lvecBase2_src.h index a9bc87386a..fe039deaa4 100644 --- a/panda/src/linmath/lvecBase2_src.h +++ b/panda/src/linmath/lvecBase2_src.h @@ -112,6 +112,9 @@ PUBLISHED: INLINE_LINMATH bool almost_equal(const FLOATNAME(LVecBase2) &other) const; INLINE_LINMATH void output(ostream &out) const; +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif public: INLINE_LINMATH void generate_hash(ChecksumHashGenerator &hashgen) const; diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index 8a4daa6ccb..9cb523ca00 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -764,6 +764,21 @@ output(ostream &out) const { << MAYBE_ZERO(_v.v._2); } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVecBase3::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVecBase3):: +python_repr(ostream &out, const string &class_name) const { + out << class_name << "(" + << MAYBE_ZERO(_v.v._0) << ", " + << MAYBE_ZERO(_v.v._1) << ", " + << MAYBE_ZERO(_v.v._2) << ")"; +} +#endif // HAVE_PYTHON + //////////////////////////////////////////////////////////////////// // Function: LVecBase3::generate_hash diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index 969ec1f59f..5a85ceaee8 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -122,6 +122,9 @@ PUBLISHED: INLINE_LINMATH bool almost_equal(const FLOATNAME(LVecBase3) &other) const; INLINE_LINMATH void output(ostream &out) const; +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif public: INLINE_LINMATH void generate_hash(ChecksumHashGenerator &hashgen) const; diff --git a/panda/src/linmath/lvecBase4_src.I b/panda/src/linmath/lvecBase4_src.I index 8fa98b5c87..f7b431d691 100644 --- a/panda/src/linmath/lvecBase4_src.I +++ b/panda/src/linmath/lvecBase4_src.I @@ -714,6 +714,22 @@ output(ostream &out) const { << MAYBE_ZERO(_v.v._3); } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVecBase4::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVecBase4):: +python_repr(ostream &out, const string &class_name) const { + out << class_name << "(" + << MAYBE_ZERO(_v.v._0) << ", " + << MAYBE_ZERO(_v.v._1) << ", " + << MAYBE_ZERO(_v.v._2) << ", " + << MAYBE_ZERO(_v.v._3) << ")"; +} +#endif // HAVE_PYTHON + //////////////////////////////////////////////////////////////////// // Function: LVecBase4::generate_hash // Access: Public diff --git a/panda/src/linmath/lvecBase4_src.h b/panda/src/linmath/lvecBase4_src.h index fdd15f170a..06299d27bd 100644 --- a/panda/src/linmath/lvecBase4_src.h +++ b/panda/src/linmath/lvecBase4_src.h @@ -117,6 +117,9 @@ PUBLISHED: INLINE_LINMATH bool almost_equal(const FLOATNAME(LVecBase4) &other) const; INLINE_LINMATH void output(ostream &out) const; +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif public: INLINE_LINMATH void generate_hash(ChecksumHashGenerator &hashgen) const; diff --git a/panda/src/linmath/lvector2_src.I b/panda/src/linmath/lvector2_src.I index 2637334a60..948f2e21f4 100644 --- a/panda/src/linmath/lvector2_src.I +++ b/panda/src/linmath/lvector2_src.I @@ -221,3 +221,15 @@ operator / (FLOATTYPE scalar) const { FLOATTYPE recip_scalar = 1.0f/scalar; return FLOATNAME(LVector2)(FLOATNAME(LVecBase2)::operator * (recip_scalar)); } + +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVector2::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVector2):: +python_repr(ostream &out, const string &class_name) const { + FLOATNAME(LVecBase2)::python_repr(out, class_name); +} +#endif // HAVE_PYTHON diff --git a/panda/src/linmath/lvector2_src.h b/panda/src/linmath/lvector2_src.h index 95ea6ff0b0..a3eed66b88 100644 --- a/panda/src/linmath/lvector2_src.h +++ b/panda/src/linmath/lvector2_src.h @@ -47,6 +47,10 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector2) operator * (FLOATTYPE scalar) const; INLINE_LINMATH FLOATNAME(LVector2) operator / (FLOATTYPE scalar) const; +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/linmath/lvector3_src.I b/panda/src/linmath/lvector3_src.I index 73aaf3bcf2..5336dfb077 100644 --- a/panda/src/linmath/lvector3_src.I +++ b/panda/src/linmath/lvector3_src.I @@ -383,3 +383,14 @@ rfu(FLOATTYPE right_v, FLOATTYPE fwd_v, FLOATTYPE up_v, return FLOATNAME(LVector3)(right_v,vy,vz); } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVector3::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVector3):: +python_repr(ostream &out, const string &class_name) const { + FLOATNAME(LVecBase3)::python_repr(out, class_name); +} +#endif // HAVE_PYTHON diff --git a/panda/src/linmath/lvector3_src.h b/panda/src/linmath/lvector3_src.h index 030ed881b3..0321e29d02 100644 --- a/panda/src/linmath/lvector3_src.h +++ b/panda/src/linmath/lvector3_src.h @@ -69,6 +69,10 @@ PUBLISHED: INLINE_LINMATH static FLOATNAME(LVector3) rfu(FLOATTYPE right, FLOATTYPE fwd,FLOATTYPE up, CoordinateSystem cs = CS_default); +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif + public: static TypeHandle get_class_type() { return _type_handle; diff --git a/panda/src/linmath/lvector4_src.I b/panda/src/linmath/lvector4_src.I index 685053bd24..bf6e1864c2 100644 --- a/panda/src/linmath/lvector4_src.I +++ b/panda/src/linmath/lvector4_src.I @@ -242,3 +242,15 @@ operator / (FLOATTYPE scalar) const { FLOATTYPE recip_scalar = 1.0f/scalar; return FLOATNAME(LVector4)(FLOATNAME(LVecBase4)::operator * (recip_scalar)); } + +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVector4::python_repr +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVector4):: +python_repr(ostream &out, const string &class_name) const { + FLOATNAME(LVecBase4)::python_repr(out, class_name); +} +#endif // HAVE_PYTHON diff --git a/panda/src/linmath/lvector4_src.h b/panda/src/linmath/lvector4_src.h index 3fdf31bb28..89f7ad7e13 100644 --- a/panda/src/linmath/lvector4_src.h +++ b/panda/src/linmath/lvector4_src.h @@ -49,6 +49,10 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector4) operator * (FLOATTYPE scalar) const; INLINE_LINMATH FLOATNAME(LVector4) operator / (FLOATTYPE scalar) const; +#ifdef HAVE_PYTHON + INLINE_LINMATH void python_repr(ostream &out, const string &class_name) const; +#endif + public: static TypeHandle get_class_type() { return _type_handle;