From 7530915985ab2af487e2d5290a7d2ee14d14333c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 19 May 2009 15:10:41 +0000 Subject: [PATCH] Updated wrappers --- src/osgWrappers/osg/Notify.cpp | 26 ++ src/osgWrappers/osg/Vec2b.cpp | 6 +- src/osgWrappers/osg/Vec3b.cpp | 2 +- src/osgWrappers/osg/Vec4b.cpp | 2 +- src/osgWrappers/osg/Vec4ub.cpp | 44 +-- .../osgGA/SphericalManipulator.cpp | 284 ++++++++++++++++++ 6 files changed, 337 insertions(+), 27 deletions(-) create mode 100644 src/osgWrappers/osgGA/SphericalManipulator.cpp diff --git a/src/osgWrappers/osg/Notify.cpp b/src/osgWrappers/osg/Notify.cpp index b8d920900..5c6f2c797 100644 --- a/src/osgWrappers/osg/Notify.cpp +++ b/src/osgWrappers/osg/Notify.cpp @@ -20,6 +20,32 @@ #undef OUT #endif +BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::NotifyHandler) + I_DeclaringFile("osg/Notify"); + I_BaseType(osg::Referenced); + I_Constructor0(____NotifyHandler, + "", + ""); + I_Method2(void, notify, IN, osg::NotifySeverity, severity, IN, const char *, message, + Properties::PURE_VIRTUAL, + __void__notify__osg_NotifySeverity__C5_char_P1, + "", + ""); +END_REFLECTOR + +BEGIN_OBJECT_REFLECTOR(osg::StandardNotifyHandler) + I_DeclaringFile("osg/Notify"); + I_BaseType(osg::NotifyHandler); + I_Constructor0(____StandardNotifyHandler, + "", + ""); + I_Method2(void, notify, IN, osg::NotifySeverity, severity, IN, const char *, message, + Properties::VIRTUAL, + __void__notify__osg_NotifySeverity__C5_char_P1, + "", + ""); +END_REFLECTOR + BEGIN_ENUM_REFLECTOR(osg::NotifySeverity) I_DeclaringFile("osg/Notify"); I_EnumLabel(osg::ALWAYS); diff --git a/src/osgWrappers/osg/Vec2b.cpp b/src/osgWrappers/osg/Vec2b.cpp index dc77adef6..9eb9eed06 100644 --- a/src/osgWrappers/osg/Vec2b.cpp +++ b/src/osgWrappers/osg/Vec2b.cpp @@ -22,7 +22,7 @@ #include -TYPE_NAME_ALIAS(char, osg::Vec2b::value_type) +TYPE_NAME_ALIAS(signed char, osg::Vec2b::value_type) BEGIN_VALUE_REFLECTOR(osg::Vec2b) I_ReaderWriter(osgIntrospection::StdReaderWriter); // user-defined @@ -31,8 +31,8 @@ BEGIN_VALUE_REFLECTOR(osg::Vec2b) I_Constructor0(____Vec2b, "", ""); - I_Constructor2(IN, char, r, IN, char, g, - ____Vec2b__char__char, + I_Constructor2(IN, osg::Vec2b::value_type, r, IN, osg::Vec2b::value_type, g, + ____Vec2b__value_type__value_type, "", ""); I_Method0(osg::Vec2b::value_type *, ptr, diff --git a/src/osgWrappers/osg/Vec3b.cpp b/src/osgWrappers/osg/Vec3b.cpp index 620ce64da..5850e4e3a 100644 --- a/src/osgWrappers/osg/Vec3b.cpp +++ b/src/osgWrappers/osg/Vec3b.cpp @@ -22,7 +22,7 @@ #include -TYPE_NAME_ALIAS(char, osg::Vec3b::value_type) +TYPE_NAME_ALIAS(signed char, osg::Vec3b::value_type) BEGIN_VALUE_REFLECTOR(osg::Vec3b) I_ReaderWriter(osgIntrospection::StdReaderWriter); // user-defined diff --git a/src/osgWrappers/osg/Vec4b.cpp b/src/osgWrappers/osg/Vec4b.cpp index ccb432ebc..4da66e781 100644 --- a/src/osgWrappers/osg/Vec4b.cpp +++ b/src/osgWrappers/osg/Vec4b.cpp @@ -22,7 +22,7 @@ #include -TYPE_NAME_ALIAS(char, osg::Vec4b::value_type) +TYPE_NAME_ALIAS(signed char, osg::Vec4b::value_type) BEGIN_VALUE_REFLECTOR(osg::Vec4b) I_ReaderWriter(osgIntrospection::StdReaderWriter); // user-defined diff --git a/src/osgWrappers/osg/Vec4ub.cpp b/src/osgWrappers/osg/Vec4ub.cpp index 8d9352947..fc284a06a 100644 --- a/src/osgWrappers/osg/Vec4ub.cpp +++ b/src/osgWrappers/osg/Vec4ub.cpp @@ -35,59 +35,59 @@ BEGIN_VALUE_REFLECTOR(osg::Vec4ub) ____Vec4ub__value_type__value_type__value_type__value_type, "", ""); - I_Method0(unsigned char *, ptr, + I_Method0(osg::Vec4ub::value_type *, ptr, Properties::NON_VIRTUAL, - __unsigned_char_P1__ptr, + __value_type_P1__ptr, "", ""); - I_Method0(const unsigned char *, ptr, + I_Method0(const osg::Vec4ub::value_type *, ptr, Properties::NON_VIRTUAL, - __C5_unsigned_char_P1__ptr, + __C5_value_type_P1__ptr, "", ""); - I_Method4(void, set, IN, unsigned char, r, IN, unsigned char, g, IN, unsigned char, b, IN, unsigned char, a, + I_Method4(void, set, IN, osg::Vec4ub::value_type, r, IN, osg::Vec4ub::value_type, g, IN, osg::Vec4ub::value_type, b, IN, osg::Vec4ub::value_type, a, Properties::NON_VIRTUAL, - __void__set__unsigned_char__unsigned_char__unsigned_char__unsigned_char, + __void__set__value_type__value_type__value_type__value_type, "", ""); - I_Method0(unsigned char &, r, + I_Method0(osg::Vec4ub::value_type &, r, Properties::NON_VIRTUAL, - __unsigned_char_R1__r, + __value_type_R1__r, "", ""); - I_Method0(unsigned char &, g, + I_Method0(osg::Vec4ub::value_type &, g, Properties::NON_VIRTUAL, - __unsigned_char_R1__g, + __value_type_R1__g, "", ""); - I_Method0(unsigned char &, b, + I_Method0(osg::Vec4ub::value_type &, b, Properties::NON_VIRTUAL, - __unsigned_char_R1__b, + __value_type_R1__b, "", ""); - I_Method0(unsigned char &, a, + I_Method0(osg::Vec4ub::value_type &, a, Properties::NON_VIRTUAL, - __unsigned_char_R1__a, + __value_type_R1__a, "", ""); - I_Method0(unsigned char, r, + I_Method0(osg::Vec4ub::value_type, r, Properties::NON_VIRTUAL, - __unsigned_char__r, + __value_type__r, "", ""); - I_Method0(unsigned char, g, + I_Method0(osg::Vec4ub::value_type, g, Properties::NON_VIRTUAL, - __unsigned_char__g, + __value_type__g, "", ""); - I_Method0(unsigned char, b, + I_Method0(osg::Vec4ub::value_type, b, Properties::NON_VIRTUAL, - __unsigned_char__b, + __value_type__b, "", ""); - I_Method0(unsigned char, a, + I_Method0(osg::Vec4ub::value_type, a, Properties::NON_VIRTUAL, - __unsigned_char__a, + __value_type__a, "", ""); END_REFLECTOR diff --git a/src/osgWrappers/osgGA/SphericalManipulator.cpp b/src/osgWrappers/osgGA/SphericalManipulator.cpp new file mode 100644 index 000000000..d3d36f78b --- /dev/null +++ b/src/osgWrappers/osgGA/SphericalManipulator.cpp @@ -0,0 +1,284 @@ +// *************************************************************************** +// +// Generated automatically by genwrapper. +// Please DO NOT EDIT this file! +// +// *************************************************************************** + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Must undefine IN and OUT macros defined in Windows headers +#ifdef IN +#undef IN +#endif +#ifdef OUT +#undef OUT +#endif + +BEGIN_ENUM_REFLECTOR(osgGA::SphericalManipulator::RotationMode) + I_DeclaringFile("osgGA/SphericalManipulator"); + I_EnumLabel(osgGA::SphericalManipulator::MODE_3D); + I_EnumLabel(osgGA::SphericalManipulator::MODE_3D_HORIZONTAL); + I_EnumLabel(osgGA::SphericalManipulator::MODE_3D_VERTICAL); + I_EnumLabel(osgGA::SphericalManipulator::MODE_2D); +END_REFLECTOR + +BEGIN_OBJECT_REFLECTOR(osgGA::SphericalManipulator) + I_DeclaringFile("osgGA/SphericalManipulator"); + I_BaseType(osgGA::MatrixManipulator); + I_Constructor0(____SphericalManipulator, + "", + ""); + I_Method0(const char *, className, + Properties::VIRTUAL, + __C5_char_P1__className, + "return the name of the object's class type. ", + "Must be defined by derived classes. "); + I_Method1(void, setByMatrix, IN, const osg::Matrixd &, matrix, + Properties::VIRTUAL, + __void__setByMatrix__C5_osg_Matrixd_R1, + "set the position of the matrix manipulator using a 4x4 Matrix. ", + ""); + I_Method1(void, setByInverseMatrix, IN, const osg::Matrixd &, matrix, + Properties::VIRTUAL, + __void__setByInverseMatrix__C5_osg_Matrixd_R1, + "set the position of the matrix manipulator using a 4x4 Matrix. ", + ""); + I_Method0(osg::Matrixd, getMatrix, + Properties::VIRTUAL, + __osg_Matrixd__getMatrix, + "get the position of the manipulator as 4x4 Matrix. ", + ""); + I_Method0(osg::Matrixd, getInverseMatrix, + Properties::VIRTUAL, + __osg_Matrixd__getInverseMatrix, + "get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix. ", + ""); + I_Method0(osgUtil::SceneView::FusionDistanceMode, getFusionDistanceMode, + Properties::VIRTUAL, + __osgUtil_SceneView_FusionDistanceMode__getFusionDistanceMode, + "Get the FusionDistanceMode. ", + "Used by SceneView for setting up stereo convergence. "); + I_Method0(float, getFusionDistanceValue, + Properties::VIRTUAL, + __float__getFusionDistanceValue, + "Get the FusionDistanceValue. ", + "Used by SceneView for setting up stereo convergence. "); + I_Method1(void, setNode, IN, osg::Node *, x, + Properties::VIRTUAL, + __void__setNode__osg_Node_P1, + "Attach a node to the manipulator. ", + "Automatically detaches previously attached node. setNode(NULL) detaches previously nodes. Is ignored by manipulators which do not require a reference model. "); + I_Method0(const osg::Node *, getNode, + Properties::VIRTUAL, + __C5_osg_Node_P1__getNode, + "Return node if attached. ", + ""); + I_Method0(osg::Node *, getNode, + Properties::VIRTUAL, + __osg_Node_P1__getNode, + "Return node if attached. ", + ""); + I_Method2(void, home, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, + Properties::VIRTUAL, + __void__home__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, + "Move the camera to the default position. ", + "May be ignored by manipulators if home functionality is not appropriate. "); + I_Method1(void, home, IN, double, x, + Properties::VIRTUAL, + __void__home__double, + "Move the camera to the default position. ", + "This version does not require GUIEventAdapter and GUIActionAdapter so may be called from somewhere other than a handle() method in GUIEventHandler. Application must be aware of implications. "); + I_Method2(void, init, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, + Properties::VIRTUAL, + __void__init__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, + "Start/restart the manipulator. ", + ""); + I_Method1(void, zoomOn, IN, const osg::BoundingSphere &, bound, + Properties::NON_VIRTUAL, + __void__zoomOn__C5_osg_BoundingSphere_R1, + "", + ""); + I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, + Properties::VIRTUAL, + __bool__handle__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, + "handle events, return true if handled, false otherwise. ", + ""); + I_Method0(void, computeHomePosition, + Properties::VIRTUAL, + __void__computeHomePosition, + "Compute the home position. ", + ""); + I_Method4(void, computeViewPosition, IN, const osg::BoundingSphere &, bound, IN, double &, scale, IN, double &, distance, IN, osg::Vec3d &, center, + Properties::NON_VIRTUAL, + __void__computeViewPosition__C5_osg_BoundingSphere_R1__double_R1__double_R1__osg_Vec3d_R1, + "", + ""); + I_Method1(void, setCenter, IN, const osg::Vec3d &, center, + Properties::NON_VIRTUAL, + __void__setCenter__C5_osg_Vec3d_R1, + "", + ""); + I_Method0(const osg::Vec3d &, getCenter, + Properties::NON_VIRTUAL, + __C5_osg_Vec3d_R1__getCenter, + "", + ""); + I_Method1(bool, setDistance, IN, double, distance, + Properties::NON_VIRTUAL, + __bool__setDistance__double, + "", + ""); + I_Method0(double, getDistance, + Properties::NON_VIRTUAL, + __double__getDistance, + "", + ""); + I_Method0(double, getHomeDistance, + Properties::NON_VIRTUAL, + __double__getHomeDistance, + "", + ""); + I_Method1(void, setAzimuth, IN, double, azimuth, + Properties::NON_VIRTUAL, + __void__setAzimuth__double, + "", + ""); + I_Method0(double, getAzimuth, + Properties::NON_VIRTUAL, + __double__getAzimuth, + "", + ""); + I_Method1(void, setZenith, IN, double, zenith, + Properties::NON_VIRTUAL, + __void__setZenith__double, + "", + ""); + I_Method0(double, getZenith, + Properties::NON_VIRTUAL, + __double__getZenith, + "", + ""); + I_Method0(double, getMinimumZoomScale, + Properties::NON_VIRTUAL, + __double__getMinimumZoomScale, + "get the minimum distance (as ratio) the eye point can be zoomed in ", + ""); + I_Method1(void, setMinimumZoomScale, IN, double, minimumZoomScale, + Properties::NON_VIRTUAL, + __void__setMinimumZoomScale__double, + "set the minimum distance (as ratio) the eye point can be zoomed in towards the center before the center is pushed forward. ", + ""); + I_Method1(void, setScroolWheelZoomDelta, IN, double, zoomDelta, + Properties::NON_VIRTUAL, + __void__setScroolWheelZoomDelta__double, + "set the mouse scroll wheel zoom delta. ", + "Range -1.0 to +1.0, -ve value inverts wheel direction and zero switches off scroll wheel. "); + I_Method0(double, getScroolWheelZoomDelta, + Properties::NON_VIRTUAL, + __double__getScroolWheelZoomDelta, + "get the mouse scroll wheel zoom delta. ", + ""); + I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage, + Properties::VIRTUAL, + __void__getUsage__osg_ApplicationUsage_R1, + "Get the keyboard and mouse usage of this manipulator. ", + ""); + I_Method0(osgGA::SphericalManipulator::RotationMode, getRotationMode, + Properties::NON_VIRTUAL, + __RotationMode__getRotationMode, + "", + ""); + I_Method1(void, setRotationMode, IN, osgGA::SphericalManipulator::RotationMode, mode, + Properties::NON_VIRTUAL, + __void__setRotationMode__RotationMode, + "", + ""); + I_StaticMethod3(double, computeAngles, IN, const osg::Vec3d &, vec, IN, double &, azimuth, IN, double &, zenith, + __double__computeAngles__C5_osg_Vec3d_R1__double_R1__double_R1_S, + "", + ""); + I_ProtectedMethod0(void, flushMouseEventStack, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __void__flushMouseEventStack, + "Reset the internal GUIEvent stack. ", + ""); + I_ProtectedMethod1(void, addMouseEvent, IN, const osgGA::GUIEventAdapter &, ea, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __void__addMouseEvent__C5_osgGA_GUIEventAdapter_R1, + "Add the current mouse GUIEvent to internal stack. ", + ""); + I_ProtectedMethod0(bool, calcMovement, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __bool__calcMovement, + "For the give mouse movement calculate the movement of the camera. ", + "Return true is camera has moved and a redraw is required. "); + I_ProtectedMethod0(bool, isMouseMoving, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __bool__isMouseMoving, + "Check the speed at which the mouse is moving. ", + "If speed is below a threshold then return false, otherwise return true. "); + I_SimpleProperty(double, Azimuth, + __double__getAzimuth, + __void__setAzimuth__double); + I_SimpleProperty(const osg::Matrixd &, ByInverseMatrix, + 0, + __void__setByInverseMatrix__C5_osg_Matrixd_R1); + I_SimpleProperty(const osg::Matrixd &, ByMatrix, + 0, + __void__setByMatrix__C5_osg_Matrixd_R1); + I_SimpleProperty(const osg::Vec3d &, Center, + __C5_osg_Vec3d_R1__getCenter, + __void__setCenter__C5_osg_Vec3d_R1); + I_SimpleProperty(double, Distance, + __double__getDistance, + __bool__setDistance__double); + I_SimpleProperty(osgUtil::SceneView::FusionDistanceMode, FusionDistanceMode, + __osgUtil_SceneView_FusionDistanceMode__getFusionDistanceMode, + 0); + I_SimpleProperty(float, FusionDistanceValue, + __float__getFusionDistanceValue, + 0); + I_SimpleProperty(double, HomeDistance, + __double__getHomeDistance, + 0); + I_SimpleProperty(osg::Matrixd, InverseMatrix, + __osg_Matrixd__getInverseMatrix, + 0); + I_SimpleProperty(osg::Matrixd, Matrix, + __osg_Matrixd__getMatrix, + 0); + I_SimpleProperty(double, MinimumZoomScale, + __double__getMinimumZoomScale, + __void__setMinimumZoomScale__double); + I_SimpleProperty(osg::Node *, Node, + __osg_Node_P1__getNode, + __void__setNode__osg_Node_P1); + I_SimpleProperty(osgGA::SphericalManipulator::RotationMode, RotationMode, + __RotationMode__getRotationMode, + __void__setRotationMode__RotationMode); + I_SimpleProperty(double, ScroolWheelZoomDelta, + __double__getScroolWheelZoomDelta, + __void__setScroolWheelZoomDelta__double); + I_SimpleProperty(double, Zenith, + __double__getZenith, + __void__setZenith__double); +END_REFLECTOR +