From 9cec69981d2236b5fb84e6f84efe1b9322673949 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 11 Apr 2008 11:19:58 +0000 Subject: [PATCH] Updated wrappers --- src/osgWrappers/osg/BoundingBox.cpp | 101 +++++++++++----------- src/osgWrappers/osg/BoundingSphere.cpp | 63 +++++++++----- src/osgWrappers/osg/LOD.cpp | 33 +++---- src/osgWrappers/osg/ProxyNode.cpp | 24 ++--- src/osgWrappers/osgGA/GUIEventAdapter.cpp | 6 ++ 5 files changed, 129 insertions(+), 98 deletions(-) diff --git a/src/osgWrappers/osg/BoundingBox.cpp b/src/osgWrappers/osg/BoundingBox.cpp index 613678c42..44440c6d1 100644 --- a/src/osgWrappers/osg/BoundingBox.cpp +++ b/src/osgWrappers/osg/BoundingBox.cpp @@ -12,7 +12,6 @@ #include #include -#include // Must undefine IN and OUT macros defined in Windows headers #ifdef IN @@ -22,17 +21,21 @@ #undef OUT #endif +TYPE_NAME_ALIAS(osg::Vec3f, osg::BoundingBox::vec_type) + +TYPE_NAME_ALIAS(float, osg::BoundingBox::value_type) + BEGIN_VALUE_REFLECTOR(osg::BoundingBox) I_DeclaringFile("osg/BoundingBox"); I_Constructor0(____BoundingBox, "Creates an uninitialized bounding box. ", ""); - I_Constructor6(IN, float, xmin, IN, float, ymin, IN, float, zmin, IN, float, xmax, IN, float, ymax, IN, float, zmax, - ____BoundingBox__float__float__float__float__float__float, + I_Constructor6(IN, osg::BoundingBox::value_type, xmin, IN, osg::BoundingBox::value_type, ymin, IN, osg::BoundingBox::value_type, zmin, IN, osg::BoundingBox::value_type, xmax, IN, osg::BoundingBox::value_type, ymax, IN, osg::BoundingBox::value_type, zmax, + ____BoundingBox__value_type__value_type__value_type__value_type__value_type__value_type, "Creates a bounding box initialized to the given extents. ", ""); - I_Constructor2(IN, const osg::Vec3 &, min, IN, const osg::Vec3 &, max, - ____BoundingBox__C5_Vec3_R1__C5_Vec3_R1, + I_Constructor2(IN, const osg::BoundingBox::vec_type &, min, IN, const osg::BoundingBox::vec_type &, max, + ____BoundingBox__C5_vec_type_R1__C5_vec_type_R1, "Creates a bounding box initialized to the given extents. ", ""); I_Method0(void, init, @@ -45,104 +48,104 @@ BEGIN_VALUE_REFLECTOR(osg::BoundingBox) __bool__valid, "Returns true if the bounding box extents are valid, false otherwise. ", ""); - I_Method6(void, set, IN, float, xmin, IN, float, ymin, IN, float, zmin, IN, float, xmax, IN, float, ymax, IN, float, zmax, + I_Method6(void, set, IN, osg::BoundingBox::value_type, xmin, IN, osg::BoundingBox::value_type, ymin, IN, osg::BoundingBox::value_type, zmin, IN, osg::BoundingBox::value_type, xmax, IN, osg::BoundingBox::value_type, ymax, IN, osg::BoundingBox::value_type, zmax, Properties::NON_VIRTUAL, - __void__set__float__float__float__float__float__float, + __void__set__value_type__value_type__value_type__value_type__value_type__value_type, "Sets the bounding box extents. ", ""); - I_Method2(void, set, IN, const osg::Vec3 &, min, IN, const osg::Vec3 &, max, + I_Method2(void, set, IN, const osg::BoundingBox::vec_type &, min, IN, const osg::BoundingBox::vec_type &, max, Properties::NON_VIRTUAL, - __void__set__C5_Vec3_R1__C5_Vec3_R1, + __void__set__C5_vec_type_R1__C5_vec_type_R1, "Sets the bounding box extents. ", ""); - I_Method0(float &, xMin, + I_Method0(osg::BoundingBox::value_type &, xMin, Properties::NON_VIRTUAL, - __float_R1__xMin, + __value_type_R1__xMin, "", ""); - I_Method0(float, xMin, + I_Method0(osg::BoundingBox::value_type, xMin, Properties::NON_VIRTUAL, - __float__xMin, + __value_type__xMin, "", ""); - I_Method0(float &, yMin, + I_Method0(osg::BoundingBox::value_type &, yMin, Properties::NON_VIRTUAL, - __float_R1__yMin, + __value_type_R1__yMin, "", ""); - I_Method0(float, yMin, + I_Method0(osg::BoundingBox::value_type, yMin, Properties::NON_VIRTUAL, - __float__yMin, + __value_type__yMin, "", ""); - I_Method0(float &, zMin, + I_Method0(osg::BoundingBox::value_type &, zMin, Properties::NON_VIRTUAL, - __float_R1__zMin, + __value_type_R1__zMin, "", ""); - I_Method0(float, zMin, + I_Method0(osg::BoundingBox::value_type, zMin, Properties::NON_VIRTUAL, - __float__zMin, + __value_type__zMin, "", ""); - I_Method0(float &, xMax, + I_Method0(osg::BoundingBox::value_type &, xMax, Properties::NON_VIRTUAL, - __float_R1__xMax, + __value_type_R1__xMax, "", ""); - I_Method0(float, xMax, + I_Method0(osg::BoundingBox::value_type, xMax, Properties::NON_VIRTUAL, - __float__xMax, + __value_type__xMax, "", ""); - I_Method0(float &, yMax, + I_Method0(osg::BoundingBox::value_type &, yMax, Properties::NON_VIRTUAL, - __float_R1__yMax, + __value_type_R1__yMax, "", ""); - I_Method0(float, yMax, + I_Method0(osg::BoundingBox::value_type, yMax, Properties::NON_VIRTUAL, - __float__yMax, + __value_type__yMax, "", ""); - I_Method0(float &, zMax, + I_Method0(osg::BoundingBox::value_type &, zMax, Properties::NON_VIRTUAL, - __float_R1__zMax, + __value_type_R1__zMax, "", ""); - I_Method0(float, zMax, + I_Method0(osg::BoundingBox::value_type, zMax, Properties::NON_VIRTUAL, - __float__zMax, + __value_type__zMax, "", ""); - I_Method0(const osg::Vec3, center, + I_Method0(const osg::BoundingBox::vec_type, center, Properties::NON_VIRTUAL, - __C5_Vec3__center, + __C5_vec_type__center, "Calculates and returns the bounding box center. ", ""); - I_Method0(float, radius, + I_Method0(osg::BoundingBox::value_type, radius, Properties::NON_VIRTUAL, - __float__radius, + __value_type__radius, "Calculates and returns the bounding box radius. ", ""); - I_Method0(float, radius2, + I_Method0(osg::BoundingBox::value_type, radius2, Properties::NON_VIRTUAL, - __float__radius2, + __value_type__radius2, "Calculates and returns the squared length of the bounding box radius. ", "Note, radius2() is faster to calculate than radius(). "); - I_Method1(const osg::Vec3, corner, IN, unsigned int, pos, + I_Method1(const osg::BoundingBox::vec_type, corner, IN, unsigned int, pos, Properties::NON_VIRTUAL, - __C5_Vec3__corner__unsigned_int, + __C5_vec_type__corner__unsigned_int, "Returns a specific corner of the bounding box. ", "pos specifies the corner as a number between 0 and 7. Each bit selects an axis, X, Y, or Z from least- to most-significant. Unset bits select the minimum value for that axis, and set bits select the maximum. "); - I_Method1(void, expandBy, IN, const osg::Vec3 &, v, + I_Method1(void, expandBy, IN, const osg::BoundingBox::vec_type &, v, Properties::NON_VIRTUAL, - __void__expandBy__C5_Vec3_R1, + __void__expandBy__C5_vec_type_R1, "Expands the bounding box to include the given coordinate. ", "If the box is uninitialized, set its min and max extents to v. "); - I_Method3(void, expandBy, IN, float, x, IN, float, y, IN, float, z, + I_Method3(void, expandBy, IN, osg::BoundingBox::value_type, x, IN, osg::BoundingBox::value_type, y, IN, osg::BoundingBox::value_type, z, Properties::NON_VIRTUAL, - __void__expandBy__float__float__float, + __void__expandBy__value_type__value_type__value_type, "Expands the bounding box to include the given coordinate. ", "If the box is uninitialized, set its min and max extents to Vec3(x,y,z). "); I_Method1(void, expandBy, IN, const osg::BoundingBox &, bb, @@ -165,12 +168,12 @@ BEGIN_VALUE_REFLECTOR(osg::BoundingBox) __bool__intersects__C5_BoundingBox_R1, "Return true if this bounding box intersects the specified bounding box. ", ""); - I_Method1(bool, contains, IN, const osg::Vec3 &, v, + I_Method1(bool, contains, IN, const osg::BoundingBox::vec_type &, v, Properties::NON_VIRTUAL, - __bool__contains__C5_Vec3_R1, + __bool__contains__C5_vec_type_R1, "Returns true if this bounding box contains the specified coordinate. ", ""); - I_PublicMemberProperty(osg::Vec3, _min); - I_PublicMemberProperty(osg::Vec3, _max); + I_PublicMemberProperty(osg::BoundingBox::vec_type, _min); + I_PublicMemberProperty(osg::BoundingBox::vec_type, _max); END_REFLECTOR diff --git a/src/osgWrappers/osg/BoundingSphere.cpp b/src/osgWrappers/osg/BoundingSphere.cpp index 88c1e4b04..63e5404ee 100644 --- a/src/osgWrappers/osg/BoundingSphere.cpp +++ b/src/osgWrappers/osg/BoundingSphere.cpp @@ -12,7 +12,8 @@ #include #include -#include +#include +#include // Must undefine IN and OUT macros defined in Windows headers #ifdef IN @@ -22,13 +23,17 @@ #undef OUT #endif +TYPE_NAME_ALIAS(osg::Vec3f, osg::BoundingSphere::vec_type) + +TYPE_NAME_ALIAS(float, osg::BoundingSphere::value_type) + BEGIN_VALUE_REFLECTOR(osg::BoundingSphere) I_DeclaringFile("osg/BoundingSphere"); I_Constructor0(____BoundingSphere, "Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphere. ", ""); - I_Constructor2(IN, const osg::Vec3 &, center, IN, float, radius, - ____BoundingSphere__C5_Vec3_R1__float, + I_Constructor2(IN, const osg::BoundingSphere::vec_type &, center, IN, osg::BoundingSphere::value_type, radius, + ____BoundingSphere__C5_vec_type_R1__value_type, "Creates a bounding sphere initialized to the given extents. ", ""); I_Constructor1(IN, const osg::BoundingSphere &, bs, @@ -51,44 +56,54 @@ BEGIN_VALUE_REFLECTOR(osg::BoundingSphere) __bool__valid, "Returns true of the bounding sphere extents are valid, false otherwise. ", ""); - I_Method2(void, set, IN, const osg::Vec3 &, center, IN, float, radius, + I_Method2(void, set, IN, const osg::BoundingSphere::vec_type &, center, IN, osg::BoundingSphere::value_type, radius, Properties::NON_VIRTUAL, - __void__set__C5_Vec3_R1__float, - "Set the bounding sphere to the given center/radius. ", + __void__set__C5_vec_type_R1__value_type, + "Set the bounding sphere to the given center/radius using floats. ", ""); - I_Method0(osg::Vec3 &, center, + I_Method0(osg::BoundingSphere::vec_type &, center, Properties::NON_VIRTUAL, - __Vec3_R1__center, + __vec_type_R1__center, "Returns the center of the bounding sphere. ", ""); - I_Method0(const osg::Vec3 &, center, + I_Method0(const osg::BoundingSphere::vec_type &, center, Properties::NON_VIRTUAL, - __C5_Vec3_R1__center, + __C5_vec_type_R1__center, "Returns the const center of the bounding sphere. ", ""); - I_Method0(float &, radius, + I_Method0(osg::BoundingSphere::value_type &, radius, Properties::NON_VIRTUAL, - __float_R1__radius, + __value_type_R1__radius, "Returns the radius of the bounding sphere. ", ""); - I_Method0(float, radius, + I_Method0(osg::BoundingSphere::value_type, radius, Properties::NON_VIRTUAL, - __float__radius, + __value_type__radius, "Returns the const radius of the bounding sphere. ", ""); - I_Method0(float, radius2, + I_Method0(osg::BoundingSphere::value_type, radius2, Properties::NON_VIRTUAL, - __float__radius2, + __value_type__radius2, "Returns the squared length of the radius. ", "Note, For performance reasons, the calling method is responsible for checking to make sure the sphere is valid. "); - I_Method1(void, expandBy, IN, const osg::Vec3 &, v, + I_Method1(void, expandBy, IN, const osg::Vec3f &, v, Properties::NON_VIRTUAL, - __void__expandBy__C5_Vec3_R1, + __void__expandBy__C5_Vec3f_R1, "Expands the sphere to encompass the given point. ", "Repositions the sphere center to minimize the radius increase. If the sphere is uninitialized, set its center to v and radius to zero. "); - I_Method1(void, expandRadiusBy, IN, const osg::Vec3 &, v, + I_Method1(void, expandRadiusBy, IN, const osg::Vec3f &, v, Properties::NON_VIRTUAL, - __void__expandRadiusBy__C5_Vec3_R1, + __void__expandRadiusBy__C5_Vec3f_R1, + "Expands the sphere to encompass the given point. ", + "Does not reposition the sphere center. If the sphere is uninitialized, set its center to v and radius to zero. "); + I_Method1(void, expandBy, IN, const osg::Vec3d &, v, + Properties::NON_VIRTUAL, + __void__expandBy__C5_Vec3d_R1, + "Expands the sphere to encompass the given point. ", + "Repositions the sphere center to minimize the radius increase. If the sphere is uninitialized, set its center to v and radius to zero. "); + I_Method1(void, expandRadiusBy, IN, const osg::Vec3d &, v, + Properties::NON_VIRTUAL, + __void__expandRadiusBy__C5_Vec3d_R1, "Expands the sphere to encompass the given point. ", "Does not reposition the sphere center. If the sphere is uninitialized, set its center to v and radius to zero. "); I_Method1(void, expandBy, IN, const osg::BoundingSphere &, sh, @@ -111,9 +126,9 @@ BEGIN_VALUE_REFLECTOR(osg::BoundingSphere) __void__expandRadiusBy__C5_BoundingBox_R1, "Expands the sphere to encompass the given box. ", "Does not repositions the sphere center. "); - I_Method1(bool, contains, IN, const osg::Vec3 &, v, + I_Method1(bool, contains, IN, const osg::BoundingSphere::vec_type &, v, Properties::NON_VIRTUAL, - __bool__contains__C5_Vec3_R1, + __bool__contains__C5_vec_type_R1, "Returns true if v is within the sphere. ", ""); I_Method1(bool, intersects, IN, const osg::BoundingSphere &, bs, @@ -121,7 +136,7 @@ BEGIN_VALUE_REFLECTOR(osg::BoundingSphere) __bool__intersects__C5_BoundingSphere_R1, "Returns true if there is a non-empty intersection with the given bounding sphere. ", ""); - I_PublicMemberProperty(osg::Vec3, _center); - I_PublicMemberProperty(float, _radius); + I_PublicMemberProperty(osg::BoundingSphere::vec_type, _center); + I_PublicMemberProperty(osg::BoundingSphere::value_type, _radius); END_REFLECTOR diff --git a/src/osgWrappers/osg/LOD.cpp b/src/osgWrappers/osg/LOD.cpp index 21dce5933..3a76918f1 100644 --- a/src/osgWrappers/osg/LOD.cpp +++ b/src/osgWrappers/osg/LOD.cpp @@ -16,7 +16,6 @@ #include #include #include -#include // Must undefine IN and OUT macros defined in Windows headers #ifdef IN @@ -26,6 +25,10 @@ #undef OUT #endif +TYPE_NAME_ALIAS(osg::BoundingSphere::vec_type, osg::LOD::vec_type) + +TYPE_NAME_ALIAS(osg::BoundingSphere::value_type, osg::LOD::value_type) + TYPE_NAME_ALIAS(std::pair< float COMMA float >, osg::LOD::MinMaxPair) TYPE_NAME_ALIAS(std::vector< osg::LOD::MinMaxPair >, osg::LOD::RangeList) @@ -112,24 +115,24 @@ BEGIN_OBJECT_REFLECTOR(osg::LOD) __CenterMode__getCenterMode, "Get how the center of object should be determined when computing which child is active. ", ""); - I_Method1(void, setCenter, IN, const osg::Vec3 &, center, + I_Method1(void, setCenter, IN, const osg::LOD::vec_type &, center, Properties::NON_VIRTUAL, - __void__setCenter__C5_Vec3_R1, + __void__setCenter__C5_vec_type_R1, "Sets the object-space point which defines the center of the osg::LOD. ", "center is affected by any transforms in the hierarchy above the osg::LOD. "); - I_Method0(const osg::Vec3 &, getCenter, + I_Method0(const osg::LOD::vec_type &, getCenter, Properties::NON_VIRTUAL, - __C5_Vec3_R1__getCenter, + __C5_vec_type_R1__getCenter, "return the LOD center point. ", ""); - I_Method1(void, setRadius, IN, float, radius, + I_Method1(void, setRadius, IN, osg::LOD::value_type, radius, Properties::NON_VIRTUAL, - __void__setRadius__float, + __void__setRadius__value_type, "Set the object-space reference radius of the volume enclosed by the LOD. ", "Used to determine the bounding sphere of the LOD in the absence of any children. "); - I_Method0(float, getRadius, + I_Method0(osg::LOD::value_type, getRadius, Properties::NON_VIRTUAL, - __float__getRadius, + __value_type__getRadius, "Get the object-space radius of the volume enclosed by the LOD. ", ""); I_Method1(void, setRangeMode, IN, osg::LOD::RangeMode, mode, @@ -177,15 +180,15 @@ BEGIN_OBJECT_REFLECTOR(osg::LOD) __BoundingSphere__computeBound, "Compute the bounding sphere around Node's geometry or children. ", "This method is automatically called by getBound() when the bounding sphere has been marked dirty via dirtyBound(). "); - I_SimpleProperty(const osg::Vec3 &, Center, - __C5_Vec3_R1__getCenter, - __void__setCenter__C5_Vec3_R1); + I_SimpleProperty(const osg::LOD::vec_type &, Center, + __C5_vec_type_R1__getCenter, + __void__setCenter__C5_vec_type_R1); I_SimpleProperty(osg::LOD::CenterMode, CenterMode, __CenterMode__getCenterMode, __void__setCenterMode__CenterMode); - I_SimpleProperty(float, Radius, - __float__getRadius, - __void__setRadius__float); + I_SimpleProperty(osg::LOD::value_type, Radius, + __value_type__getRadius, + __void__setRadius__value_type); I_SimpleProperty(const osg::LOD::RangeList &, RangeList, __C5_RangeList_R1__getRangeList, __void__setRangeList__C5_RangeList_R1); diff --git a/src/osgWrappers/osg/ProxyNode.cpp b/src/osgWrappers/osg/ProxyNode.cpp index 8506272ee..901b9ff83 100644 --- a/src/osgWrappers/osg/ProxyNode.cpp +++ b/src/osgWrappers/osg/ProxyNode.cpp @@ -26,6 +26,10 @@ #undef OUT #endif +TYPE_NAME_ALIAS(osg::BoundingSphere::vec_type, osg::ProxyNode::vec_type) + +TYPE_NAME_ALIAS(osg::BoundingSphere::value_type, osg::ProxyNode::value_type) + TYPE_NAME_ALIAS(std::vector< std::string >, osg::ProxyNode::FileNameList) BEGIN_ENUM_REFLECTOR(osg::ProxyNode::CenterMode) @@ -151,19 +155,19 @@ BEGIN_OBJECT_REFLECTOR(osg::ProxyNode) __void__setCenter__C5_Vec3_R1, "Sets the object-space point which defines the center of the osg::ProxyNode. ", "center is affected by any transforms in the hierarchy above the osg::ProxyNode. "); - I_Method0(const osg::Vec3 &, getCenter, + I_Method0(const osg::ProxyNode::vec_type &, getCenter, Properties::NON_VIRTUAL, - __C5_Vec3_R1__getCenter, + __C5_vec_type_R1__getCenter, "return the ProxyNode center point. ", ""); - I_Method1(void, setRadius, IN, float, radius, + I_Method1(void, setRadius, IN, osg::ProxyNode::value_type, radius, Properties::NON_VIRTUAL, - __void__setRadius__float, + __void__setRadius__value_type, "Set the object-space reference radius of the volume enclosed by the ProxyNode. ", "Used to determine the bounding sphere of the ProxyNode in the absence of any children. "); - I_Method0(float, getRadius, + I_Method0(osg::ProxyNode::value_type, getRadius, Properties::NON_VIRTUAL, - __float__getRadius, + __value_type__getRadius, "Get the object-space radius of the volume enclosed by the ProxyNode. ", ""); I_Method0(osg::BoundingSphere, computeBound, @@ -178,7 +182,7 @@ BEGIN_OBJECT_REFLECTOR(osg::ProxyNode) "", ""); I_SimpleProperty(const osg::Vec3 &, Center, - __C5_Vec3_R1__getCenter, + 0, __void__setCenter__C5_Vec3_R1); I_SimpleProperty(osg::ProxyNode::CenterMode, CenterMode, __CenterMode__getCenterMode, @@ -196,8 +200,8 @@ BEGIN_OBJECT_REFLECTOR(osg::ProxyNode) I_SimpleProperty(osg::ProxyNode::LoadingExternalReferenceMode, LoadingExternalReferenceMode, __LoadingExternalReferenceMode__getLoadingExternalReferenceMode, __void__setLoadingExternalReferenceMode__LoadingExternalReferenceMode); - I_SimpleProperty(float, Radius, - __float__getRadius, - __void__setRadius__float); + I_SimpleProperty(osg::ProxyNode::value_type, Radius, + __value_type__getRadius, + __void__setRadius__value_type); END_REFLECTOR diff --git a/src/osgWrappers/osgGA/GUIEventAdapter.cpp b/src/osgWrappers/osgGA/GUIEventAdapter.cpp index c14abc32f..cb6449497 100644 --- a/src/osgWrappers/osgGA/GUIEventAdapter.cpp +++ b/src/osgWrappers/osgGA/GUIEventAdapter.cpp @@ -186,12 +186,18 @@ BEGIN_ENUM_REFLECTOR(osgGA::GUIEventAdapter::ModKeyMask) I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_RIGHT_ALT); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_LEFT_META); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_RIGHT_META); + I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_LEFT_SUPER); + I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_RIGHT_SUPER); + I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_LEFT_HYPER); + I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_RIGHT_HYPER); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_NUM_LOCK); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_CAPS_LOCK); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_CTRL); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_SHIFT); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_ALT); I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_META); + I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_SUPER); + I_EnumLabel(osgGA::GUIEventAdapter::MODKEY_HYPER); END_REFLECTOR BEGIN_ENUM_REFLECTOR(osgGA::GUIEventAdapter::MouseYOrientation)