# ************** ************** # # PyJuggler is (C) Copyright 2002, 2003 by Patrick Hartling # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # ----------------------------------------------------------------- # File: $RCSfile: gmtl.pyste,v $ # Date modified: $Date: 2003-08-17 06:32:58 $ # Version: $Revision: 1.3 $ # ----------------------------------------------------------------- # # *************** *************** # Basics ====================================================================== AllFromHeader('gmtl/Defines.h') # ====================================================================== Basics # gmtl::Matrix<> ============================================================== Matrix = Template('gmtl::Matrix', 'gmtl/Matrix.h') Matrix44f = Matrix('float 4 4') rename(Matrix44f, 'Matrix44f') exclude(Matrix44f.getData) exclude(Matrix44f.mData) #set_policy(Matrix44f.operator['()'], return_internal_reference()) exclude(Matrix44f.operator['()']) Include('gmtl-getData-wrappers.h') Matrix33f = Matrix('float 3 3') rename(Matrix33f, 'Matrix33f') set_wrapper(Matrix33f.getData, 'gmtlWrappers::Matrix_3_3_getData') exclude(Matrix33f.mData) #set_policy(Matrix33f.operator['()'], return_internal_reference()) exclude(Matrix33f.operator['()']) Matrix_identity = Function('gmtl::identity', 'gmtl-MatrixOps.h') set_policy(Matrix_identity, return_internal_reference()) Matrix_zero = Function('gmtl::zero', 'gmtl-MatrixOps.h') set_policy(Matrix_zero, return_internal_reference()) set_policy(Function('gmtl::mult', 'gmtl-MatrixOps.h'), return_internal_reference()) Matrix_sub = Function('gmtl::sub', 'gmtl-MatrixOps.h') set_policy(Matrix_sub, return_internal_reference()) Matrix_add = Function('gmtl::add', 'gmtl-MatrixOps.h') set_policy(Matrix_add, return_internal_reference()) Matrix_postMult = Function('gmtl::postMult', 'gmtl-MatrixOps.h') set_policy(Matrix_postMult, return_internal_reference()) Matrix_preMult = Function('gmtl::preMult', 'gmtl-MatrixOps.h') set_policy(Matrix_preMult, return_internal_reference()) Matrix_transpose = Function('gmtl::transpose', 'gmtl-MatrixOps.h') set_policy(Matrix_transpose, return_internal_reference()) Matrix_invertFull = Function('gmtl::invertFull', 'gmtl-MatrixOps.h') set_policy(Matrix_invertFull, return_internal_reference()) Matrix_invert = Function('gmtl::invert', 'gmtl-MatrixOps.h') set_policy(Matrix_invert, return_internal_reference()) # ============================================================== gmtl::Matrix<> # gmtl::Vec<> ================================================================= VecBase = Template('gmtl::VecBase', 'gmtl/VecBase.h') Include('gmtl-getData-wrappers.h') VecBase2d = VecBase('double 2') rename(VecBase2d, 'VecBase2d') set_wrapper(VecBase2d.getData, 'gmtlWrappers::VecBase_2_getData') exclude(VecBase2d.mData) Include('gmtl-getData-wrappers.h') VecBase2f = VecBase('float 2') rename(VecBase2f, 'VecBase2f') set_wrapper(VecBase2f.getData, 'gmtlWrappers::VecBase_2_getData') exclude(VecBase2f.mData) Include('gmtl-getData-wrappers.h') VecBase2i = VecBase('int 2') rename(VecBase2i, 'VecBase2i') set_wrapper(VecBase2i.getData, 'gmtlWrappers::VecBase_2_getData') exclude(VecBase2i.mData) Include('gmtl-getData-wrappers.h') VecBase3d = VecBase('double 3') rename(VecBase3d, 'VecBase3d') set_wrapper(VecBase3d.getData, 'gmtlWrappers::VecBase_3_getData') exclude(VecBase3d.mData) Include('gmtl-getData-wrappers.h') VecBase3f = VecBase('float 3') rename(VecBase3f, 'VecBase3f') set_wrapper(VecBase3f.getData, 'gmtlWrappers::VecBase_3_getData') exclude(VecBase3f.mData) Include('gmtl-getData-wrappers.h') VecBase3i = VecBase('int 3') rename(VecBase3i, 'VecBase3i') set_wrapper(VecBase3i.getData, 'gmtlWrappers::VecBase_3_getData') exclude(VecBase3i.mData) Include('gmtl-getData-wrappers.h') VecBase4d = VecBase('double 4') rename(VecBase4d, 'VecBase4d') set_wrapper(VecBase4d.getData, 'gmtlWrappers::VecBase_4_getData') exclude(VecBase4d.mData) Include('gmtl-getData-wrappers.h') VecBase4f = VecBase('float 4') rename(VecBase4f, 'VecBase4f') set_wrapper(VecBase4f.getData, 'gmtlWrappers::VecBase_4_getData') exclude(VecBase4f.mData) Include('gmtl-getData-wrappers.h') VecBase4i = VecBase('int 4') rename(VecBase4i, 'VecBase4i') set_wrapper(VecBase4i.getData, 'gmtlWrappers::VecBase_4_getData') exclude(VecBase4i.mData) Vec = Template('gmtl::Vec', 'gmtl/Vec.h') Vec3d = Vec('double 3') rename(Vec3d, 'Vec3d') Vec3f = Vec('float 3') rename(Vec3f, 'Vec3f') Vec3i = Vec('int 3') rename(Vec3i, 'Vec3i') Vec4d = Vec('double 4') rename(Vec4d, 'Vec4d') Vec4f = Vec('float 4') rename(Vec4f, 'Vec4f') Vec4i = Vec('int 4') rename(Vec4i, 'Vec4i') Function('gmtl::dot', 'gmtl-VecOps.h') Function('gmtl::length', 'gmtl-VecOps.h') Function('gmtl::lengthSquared', 'gmtl-VecOps.h') # XXX: This isn't quite right. gmtl::normalize() does not return a reference # in the vector case, but it does in the quaternion case. What I need is a # way to tell Pyste which version is which... set_policy(Function('gmtl::normalize', 'gmtl-VecOps.h'), return_internal_reference()) Function('gmtl::isNormalized', 'gmtl-VecOps.h') set_policy(Function('gmtl::cross', 'gmtl-VecOps.h'), return_internal_reference()) set_policy(Function('gmtl::reflect', 'gmtl-VecOps.h'), return_internal_reference()) set_policy(Function('gmtl::lerp', 'gmtl-VecOps.h'), return_internal_reference()) # ================================================================= gmtl::Vec<> # gmtl::Quat<> ================================================================ Quat = Template('gmtl::Quat', 'gmtl/Quat.h') Include('gmtl-getData-wrappers.h') Quatf = Quat('float') rename(Quatf, 'Quatf') set_wrapper(Quatf.getData, 'gmtlWrappers::Quat_getData') # Similar to the above where it is necessary to expose gmtl::Matrix33f and # gmtl::Vec4f, we need another instance of gmtl::Quat so that the function # overloading will work correctly. Blah... Include('gmtl-getData-wrappers.h') Quatd = Quat('double') rename(Quatd, 'Quatd') set_wrapper(Quatd.getData, 'gmtlWrappers::Quat_getData') set_policy(Function('gmtl::negate', 'gmtl-QuatOps.h'), return_internal_reference()) set_policy(Function('gmtl::div', 'gmtl-QuatOps.h'), return_internal_reference()) set_policy(Function('gmtl::conj', 'gmtl-QuatOps.h'), return_internal_reference()) set_policy(Function('gmtl::invert', 'gmtl-QuatOps.h'), return_internal_reference()) set_policy(Function('gmtl::exp', 'gmtl-QuatOps.h'), return_internal_reference()) set_policy(Function('gmtl::log', 'gmtl-QuatOps.h'), return_internal_reference()) set_policy(Function('gmtl::squad', 'gmtl-QuatOps.h'), return_internal_reference()) set_policy(Function('gmtl::slerp', 'gmtl-QuatOps.h'), return_internal_reference()) Function('gmtl::isEquiv', 'gmtl-QuatOps.h') # ================================================================ gmtl::Quat<> # gmtl::Point<> =============================================================== Point = Template('gmtl::Point', 'gmtl/Point.h') Point3f = Point('float 3') rename(Point3f, 'Point3f') Point3i = Point('int 3') rename(Point3i, 'Point3i') Point2f = Point('float 2') rename(Point2f, 'Point2f') Point2i = Point('int 2') rename(Point2i, 'Point2i') # =============================================================== gmtl::Point<> # gmtl::EulerAngle<> ========================================================== EulerAngle = Template('gmtl::EulerAngle', 'gmtl/EulerAngle.h') Include('gmtl-getData-wrappers.h') EulerAngleXYZf = EulerAngle('float gmtl::XYZ') rename(EulerAngleXYZf, 'EulerAngleXYZf') set_wrapper(EulerAngleXYZf.getData, 'gmtlWrappers::EulerAngle_getData') Include('gmtl-getData-wrappers.h') EulerAngleZYXf = EulerAngle('float gmtl::ZYX') rename(EulerAngleZYXf, 'EulerAngleZYXf') set_wrapper(EulerAngleZYXf.getData, 'gmtlWrappers::EulerAngle_getData') Include('gmtl-getData-wrappers.h') EulerAngleZXYf = EulerAngle('float gmtl::ZXY') rename(EulerAngleZXYf, 'EulerAngleZXYf') set_wrapper(EulerAngleZXYf.getData, 'gmtlWrappers::EulerAngle_getData') # ========================================================== gmtl::EulerAngle<> # gmtl::AxisAngle<> =========================================================== AxisAngle = Template('gmtl::AxisAngle', 'gmtl/AxisAngle.h') AxisAnglef = AxisAngle('float') rename(AxisAnglef, 'AxisAnglef') AxisAngled = AxisAngle('double') rename(AxisAngled, 'AxisAngled') # =========================================================== gmtl::AxisAngle<> # gmtl::Sphere<> ============================================================== Sphere = Template('gmtl::Sphere', 'gmtl/Sphere.h') Spheref = Sphere('float') rename(Spheref, 'Spheref') Sphered = Sphere('double') rename(Sphered, 'Sphered') # ============================================================== gmtl::Sphere<> # gmtl::AABox<> =============================================================== AABox = Template('gmtl::AABox', 'gmtl/AABox.h') AABoxf = AABox('float') rename(AABoxf, 'AABoxf') AABoxd = AABox('double') rename(AABoxd, 'AABoxd') # =============================================================== gmtl::AABox<> # gmtl::Ray<> ================================================================= Ray = Template('gmtl::Ray', 'gmtl/Ray.h') Rayf = Ray('float') rename(Rayf, 'Rayf') Rayd = Ray('double') rename(Rayd, 'Rayd') # ================================================================= gmtl::Ray<> # gmtl::LineSeg<> ============================================================= LineSeg = Template('gmtl::LineSeg', 'gmtl/LineSeg.h') LineSegf = LineSeg('float') rename(LineSegf, 'LineSegf') LineSegd = LineSeg('double') rename(LineSegd, 'LineSegd') Function('gmtl::distanceSquared', 'gmtl-LineSegOps.h') # ============================================================= gmtl::LineSeg<> # gmtl::Plane<> =============================================================== Plane = Template('gmtl::Plane', 'gmtl/Plane.h') Planef = Plane('float') rename(Planef, 'Planef') Planed = Plane('double') rename(Planed, 'Planed') Function('gmtl::distance', 'gmtl-functions.h') Function('gmtl::whichSide', 'gmtl-PlaneOps.h') Function('gmtl::findNearestPt', 'gmtl-functions.h') # =============================================================== gmtl::Plane<> # gmtl::Tri<> ================================================================= Tri = Template('gmtl::Tri', 'gmtl/Tri.h') Trif = Tri('float') rename(Trif, 'Trif') Trid = Tri('double') rename(Trid, 'Trid') Trii = Tri('int') rename(Trii, 'Trii') Function('gmtl::center', 'gmtl-TriOps.h') # ================================================================= gmtl::Tri<> # gmtl::Coord<> =============================================================== Coord = Template('gmtl::Coord', 'gmtl/Coord.h') Coord3fXYZ = Coord('gmtl::Vec3f gmtl::EulerAngleXYZf') rename(Coord3fXYZ, 'Coord3fXYZ') set_policy(Coord3fXYZ.getPos, return_internal_reference()) set_policy(Coord3fXYZ.getRot, return_internal_reference()) set_policy(Coord3fXYZ.pos, return_internal_reference()) set_policy(Coord3fXYZ.rot, return_internal_reference()) Coord3fZYX = Coord('gmtl::Vec3f gmtl::EulerAngleZYXf') rename(Coord3fZYX, 'Coord3fZYX') set_policy(Coord3fZYX.getPos, return_internal_reference()) set_policy(Coord3fZYX.getRot, return_internal_reference()) set_policy(Coord3fZYX.pos, return_internal_reference()) set_policy(Coord3fZYX.rot, return_internal_reference()) Coord3fZXY = Coord('gmtl::Vec3f gmtl::EulerAngleZXYf') rename(Coord3fZXY, 'Coord3fZXY') set_policy(Coord3fZXY.getPos, return_internal_reference()) set_policy(Coord3fZXY.getRot, return_internal_reference()) set_policy(Coord3fZXY.pos, return_internal_reference()) set_policy(Coord3fZXY.rot, return_internal_reference()) Coord3dXYZ = Coord('gmtl::Vec3d gmtl::EulerAngleXYZd') rename(Coord3dXYZ, 'Coord3dXYZ') set_policy(Coord3dXYZ.getPos, return_internal_reference()) set_policy(Coord3dXYZ.getRot, return_internal_reference()) set_policy(Coord3dXYZ.pos, return_internal_reference()) set_policy(Coord3dXYZ.rot, return_internal_reference()) Coord3dZYX = Coord('gmtl::Vec3d gmtl::EulerAngleZYXd') rename(Coord3dZYX, 'Coord3dZYX') set_policy(Coord3dZYX.getPos, return_internal_reference()) set_policy(Coord3dZYX.getRot, return_internal_reference()) set_policy(Coord3dZYX.pos, return_internal_reference()) set_policy(Coord3dZYX.rot, return_internal_reference()) Coord3dZXY = Coord('gmtl::Vec3d gmtl::EulerAngleZXYd') rename(Coord3dZXY, 'Coord3dZXY') set_policy(Coord3dZXY.getPos, return_internal_reference()) set_policy(Coord3dZXY.getRot, return_internal_reference()) set_policy(Coord3dZXY.pos, return_internal_reference()) set_policy(Coord3dZXY.rot, return_internal_reference()) Coord4fXYZ = Coord('gmtl::Vec4f gmtl::EulerAngleXYZf') rename(Coord4fXYZ, 'Coord4fXYZ') set_policy(Coord4fXYZ.getPos, return_internal_reference()) set_policy(Coord4fXYZ.getRot, return_internal_reference()) set_policy(Coord4fXYZ.pos, return_internal_reference()) set_policy(Coord4fXYZ.rot, return_internal_reference()) Coord4fZYX = Coord('gmtl::Vec4f gmtl::EulerAngleZYXf') rename(Coord4fZYX, 'Coord4fZYX') set_policy(Coord4fZYX.getPos, return_internal_reference()) set_policy(Coord4fZYX.getRot, return_internal_reference()) set_policy(Coord4fZYX.pos, return_internal_reference()) set_policy(Coord4fZYX.rot, return_internal_reference()) Coord4fZXY = Coord('gmtl::Vec4f gmtl::EulerAngleZXYf') rename(Coord4fZXY, 'Coord4fZXY') set_policy(Coord4fZXY.getPos, return_internal_reference()) set_policy(Coord4fZXY.getRot, return_internal_reference()) set_policy(Coord4fZXY.pos, return_internal_reference()) set_policy(Coord4fZXY.rot, return_internal_reference()) Coord4dXYZ = Coord('gmtl::Vec4d gmtl::EulerAngleXYZd') rename(Coord4dXYZ, 'Coord4dXYZ') set_policy(Coord4dXYZ.getPos, return_internal_reference()) set_policy(Coord4dXYZ.getRot, return_internal_reference()) set_policy(Coord4dXYZ.pos, return_internal_reference()) set_policy(Coord4dXYZ.rot, return_internal_reference()) Coord4dZYX = Coord('gmtl::Vec4d gmtl::EulerAngleZYXd') rename(Coord4dZYX, 'Coord4dZYX') set_policy(Coord4dZYX.getPos, return_internal_reference()) set_policy(Coord4dZYX.getRot, return_internal_reference()) set_policy(Coord4dZYX.pos, return_internal_reference()) set_policy(Coord4dZYX.rot, return_internal_reference()) Coord4dZXY = Coord('gmtl::Vec4d gmtl::EulerAngleZXYd') rename(Coord4dZXY, 'Coord4dZXY') set_policy(Coord4dZXY.getPos, return_internal_reference()) set_policy(Coord4dZXY.getRot, return_internal_reference()) set_policy(Coord4dZXY.pos, return_internal_reference()) set_policy(Coord4dZXY.rot, return_internal_reference()) Coord3fQuat = Coord('gmtl::Vec3f gmtl::Quatf') rename(Coord3fQuat, 'Coord3fQuat') set_policy(Coord3fQuat.getPos, return_internal_reference()) set_policy(Coord3fQuat.getRot, return_internal_reference()) set_policy(Coord3fQuat.pos, return_internal_reference()) set_policy(Coord3fQuat.rot, return_internal_reference()) Coord3dQuat = Coord('gmtl::Vec3d gmtl::Quatd') rename(Coord3dQuat, 'Coord3dQuat') set_policy(Coord3dQuat.getPos, return_internal_reference()) set_policy(Coord3dQuat.getRot, return_internal_reference()) set_policy(Coord3dQuat.pos, return_internal_reference()) set_policy(Coord3dQuat.rot, return_internal_reference()) Coord4fQuat = Coord('gmtl::Vec4f gmtl::Quatf') rename(Coord4fQuat, 'Coord4fQuat') set_policy(Coord4fQuat.getPos, return_internal_reference()) set_policy(Coord4fQuat.getRot, return_internal_reference()) set_policy(Coord4fQuat.pos, return_internal_reference()) set_policy(Coord4fQuat.rot, return_internal_reference()) Coord4dQuat = Coord('gmtl::Vec4d gmtl::Quatd') rename(Coord4dQuat, 'Coord4dQuat') set_policy(Coord4dQuat.getPos, return_internal_reference()) set_policy(Coord4dQuat.getRot, return_internal_reference()) set_policy(Coord4dQuat.pos, return_internal_reference()) set_policy(Coord4dQuat.rot, return_internal_reference()) Coord3fAxisAngle = Coord('gmtl::Vec3f gmtl::AxisAnglef') rename(Coord3fAxisAngle, 'Coord3fAxisAngle') set_policy(Coord3fAxisAngle.getPos, return_internal_reference()) set_policy(Coord3fAxisAngle.getRot, return_internal_reference()) set_policy(Coord3fAxisAngle.pos, return_internal_reference()) set_policy(Coord3fAxisAngle.rot, return_internal_reference()) Coord3dAxisAngle = Coord('gmtl::Vec3d gmtl::AxisAngled') rename(Coord3dAxisAngle, 'Coord3dAxisAngle') set_policy(Coord3dAxisAngle.getPos, return_internal_reference()) set_policy(Coord3dAxisAngle.getRot, return_internal_reference()) set_policy(Coord3dAxisAngle.pos, return_internal_reference()) set_policy(Coord3dAxisAngle.rot, return_internal_reference()) Coord4fAxisAngle = Coord('gmtl::Vec4f gmtl::AxisAnglef') rename(Coord4fAxisAngle, 'Coord4fAxisAngle') set_policy(Coord4fAxisAngle.getPos, return_internal_reference()) set_policy(Coord4fAxisAngle.getRot, return_internal_reference()) set_policy(Coord4fAxisAngle.pos, return_internal_reference()) set_policy(Coord4fAxisAngle.rot, return_internal_reference()) Coord4dAxisAngle = Coord('gmtl::Vec4d gmtl::AxisAngled') rename(Coord4dAxisAngle, 'Coord4dAxisAngle') set_policy(Coord4dAxisAngle.getPos, return_internal_reference()) set_policy(Coord4dAxisAngle.getRot, return_internal_reference()) set_policy(Coord4dAxisAngle.pos, return_internal_reference()) set_policy(Coord4dAxisAngle.rot, return_internal_reference()) # =============================================================== gmtl::Coord<> # Math operations ============================================================= Function('gmtl::Math::deg2Rad', 'gmtl/Math.h') Function('gmtl::Math::rad2Deg', 'gmtl/Math.h') # ============================================================= Math operations # Generator operations ======================================================== Function('gmtlWrappers::makeRotMatrix33', 'gmtl-wrappers.h') Function('gmtlWrappers::makeRotMatrix44', 'gmtl-wrappers.h') Function('gmtlWrappers::makeRotQuat', 'gmtl-wrappers.h') Function('gmtlWrappers::makeRotEulerAngleXYZ', 'gmtl-wrappers.h') Function('gmtlWrappers::makeRotEulerAngleZYX', 'gmtl-wrappers.h') Function('gmtlWrappers::makeRotEulerAngleZXY', 'gmtl-wrappers.h') Function('gmtlWrappers::makeDirCosMatrix33', 'gmtl-wrappers.h') Function('gmtlWrappers::makeDirCosMatrix44', 'gmtl-wrappers.h') Function('gmtlWrappers::makeTransMatrix44', 'gmtl-wrappers.h') Function('gmtlWrappers::makeTransVec3', 'gmtl-wrappers.h') Function('gmtlWrappers::makeScaleMatrix44', 'gmtl-wrappers.h') Function('gmtlWrappers::makeAxesMatrix44', 'gmtl-wrappers.h') set_policy(Function('gmtl::setRot', 'gmtl-Generate.h'), return_internal_reference()) Function('gmtl::makeVec', 'gmtl-Generate.h') Function('gmtl::makeNormal', 'gmtl-Generate.h') Function('gmtl::makeCross', 'gmtl-Generate.h') set_policy(Function('gmtl::setTrans', 'gmtl-Generate.h'), return_internal_reference()) set_policy(Function('gmtl::setPure', 'gmtl-Generate.h'), return_internal_reference()) Function('gmtl::makePure', 'gmtl-Generate.h') Function('gmtl::makeConj', 'gmtl-Generate.h') Function('gmtl::makeInvert', 'gmtl-Generate.h') set_policy(Function('gmtl::set', 'gmtl-Generate.h'), return_internal_reference()) set_policy(Function('gmtl::setScale', 'gmtl-Generate.h'), return_internal_reference()) Function('gmtl::makeYRot', 'gmtl-Generate.h') Function('gmtl::makeXRot', 'gmtl-Generate.h') Function('gmtl::makeZRot', 'gmtl-Generate.h') set_policy(Function('gmtl::setDirCos', 'gmtl-Generate.h'), return_internal_reference()) set_policy(Function('gmtl::setAxes', 'gmtl-Generate.h'), return_internal_reference()) Function('gmtl::makeTranspose', 'gmtl-Generate.h') set_policy(Function('gmtl::setFrustum', 'gmtl-Generate.h'), return_internal_reference()) set_policy(Function('gmtl::setPerspective', 'gmtl-Generate.h'), return_internal_reference()) # ======================================================== Generator operations # Containment operations ====================================================== Function('gmtl::isInVolume', 'gmtl-Containment.h') set_policy(Function('gmtl::extendVolume', 'gmtl-Containment.h'), return_internal_reference()) Function('gmtl::isOnVolume', 'gmtl-Containment.h') set_policy(Function('gmtl::makeVolume', 'gmtl-Containment.h'), return_internal_reference()) # ====================================================== Containment operations # Intersection operations ===================================================== Function('gmtlWrappers::intersect', 'gmtl-intersect-wrappers.h') # ===================================================== Intersection operations # Transform operations ======================================================== set_policy(Function('gmtl::xform', 'gmtl-Xforms.h'), return_internal_reference()) # ======================================================== Transform operations # General operations ========================================================== Function('gmtl::isEqual', 'gmtl-functions.h') # ========================================================== General operations