| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | #include <osgIntrospection/ReflectionMacros> |
|---|
| 9 | #include <osgIntrospection/TypedMethodInfo> |
|---|
| 10 | #include <osgIntrospection/StaticMethodInfo> |
|---|
| 11 | #include <osgIntrospection/Attributes> |
|---|
| 12 | |
|---|
| 13 | #include <osg/ApplicationUsage> |
|---|
| 14 | #include <osg/BoundingSphere> |
|---|
| 15 | #include <osg/Matrixd> |
|---|
| 16 | #include <osg/Node> |
|---|
| 17 | #include <osg/Vec3d> |
|---|
| 18 | #include <osgGA/GUIActionAdapter> |
|---|
| 19 | #include <osgGA/GUIEventAdapter> |
|---|
| 20 | #include <osgGA/SphericalManipulator> |
|---|
| 21 | #include <osgUtil/SceneView> |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | #ifdef IN |
|---|
| 25 | #undef IN |
|---|
| 26 | #endif |
|---|
| 27 | #ifdef OUT |
|---|
| 28 | #undef OUT |
|---|
| 29 | #endif |
|---|
| 30 | |
|---|
| 31 | BEGIN_ENUM_REFLECTOR(osgGA::SphericalManipulator::RotationMode) |
|---|
| 32 | I_DeclaringFile("osgGA/SphericalManipulator"); |
|---|
| 33 | I_EnumLabel(osgGA::SphericalManipulator::ELEVATION_HEADING); |
|---|
| 34 | I_EnumLabel(osgGA::SphericalManipulator::HEADING); |
|---|
| 35 | I_EnumLabel(osgGA::SphericalManipulator::ELEVATION); |
|---|
| 36 | I_EnumLabel(osgGA::SphericalManipulator::MAP); |
|---|
| 37 | END_REFLECTOR |
|---|
| 38 | |
|---|
| 39 | BEGIN_OBJECT_REFLECTOR(osgGA::SphericalManipulator) |
|---|
| 40 | I_DeclaringFile("osgGA/SphericalManipulator"); |
|---|
| 41 | I_BaseType(osgGA::MatrixManipulator); |
|---|
| 42 | I_Constructor0(____SphericalManipulator, |
|---|
| 43 | "", |
|---|
| 44 | ""); |
|---|
| 45 | I_Method0(const char *, className, |
|---|
| 46 | Properties::VIRTUAL, |
|---|
| 47 | __C5_char_P1__className, |
|---|
| 48 | "return the name of the object's class type. ", |
|---|
| 49 | "Must be defined by derived classes. "); |
|---|
| 50 | I_Method1(void, setByMatrix, IN, const osg::Matrixd &, matrix, |
|---|
| 51 | Properties::VIRTUAL, |
|---|
| 52 | __void__setByMatrix__C5_osg_Matrixd_R1, |
|---|
| 53 | "set the position of the matrix manipulator using a 4x4 Matrix. ", |
|---|
| 54 | ""); |
|---|
| 55 | I_Method1(void, setByInverseMatrix, IN, const osg::Matrixd &, matrix, |
|---|
| 56 | Properties::VIRTUAL, |
|---|
| 57 | __void__setByInverseMatrix__C5_osg_Matrixd_R1, |
|---|
| 58 | "set the position of the matrix manipulator using a 4x4 Matrix. ", |
|---|
| 59 | ""); |
|---|
| 60 | I_Method0(osg::Matrixd, getMatrix, |
|---|
| 61 | Properties::VIRTUAL, |
|---|
| 62 | __osg_Matrixd__getMatrix, |
|---|
| 63 | "get the position of the manipulator as 4x4 Matrix. ", |
|---|
| 64 | ""); |
|---|
| 65 | I_Method0(osg::Matrixd, getInverseMatrix, |
|---|
| 66 | Properties::VIRTUAL, |
|---|
| 67 | __osg_Matrixd__getInverseMatrix, |
|---|
| 68 | "get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix. ", |
|---|
| 69 | ""); |
|---|
| 70 | I_Method0(osgUtil::SceneView::FusionDistanceMode, getFusionDistanceMode, |
|---|
| 71 | Properties::VIRTUAL, |
|---|
| 72 | __osgUtil_SceneView_FusionDistanceMode__getFusionDistanceMode, |
|---|
| 73 | "Get the FusionDistanceMode. ", |
|---|
| 74 | "Used by SceneView for setting up stereo convergence. "); |
|---|
| 75 | I_Method0(float, getFusionDistanceValue, |
|---|
| 76 | Properties::VIRTUAL, |
|---|
| 77 | __float__getFusionDistanceValue, |
|---|
| 78 | "Get the FusionDistanceValue. ", |
|---|
| 79 | "Used by SceneView for setting up stereo convergence. "); |
|---|
| 80 | I_Method1(void, setNode, IN, osg::Node *, x, |
|---|
| 81 | Properties::VIRTUAL, |
|---|
| 82 | __void__setNode__osg_Node_P1, |
|---|
| 83 | "Attach a node to the manipulator. ", |
|---|
| 84 | "Automatically detaches previously attached node. setNode(NULL) detaches previously nodes. Is ignored by manipulators which do not require a reference model. "); |
|---|
| 85 | I_Method0(const osg::Node *, getNode, |
|---|
| 86 | Properties::VIRTUAL, |
|---|
| 87 | __C5_osg_Node_P1__getNode, |
|---|
| 88 | "Return node if attached. ", |
|---|
| 89 | ""); |
|---|
| 90 | I_Method0(osg::Node *, getNode, |
|---|
| 91 | Properties::VIRTUAL, |
|---|
| 92 | __osg_Node_P1__getNode, |
|---|
| 93 | "Return node if attached. ", |
|---|
| 94 | ""); |
|---|
| 95 | I_Method2(void, home, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, |
|---|
| 96 | Properties::VIRTUAL, |
|---|
| 97 | __void__home__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, |
|---|
| 98 | "Move the camera to the default position. ", |
|---|
| 99 | "May be ignored by manipulators if home functionality is not appropriate. "); |
|---|
| 100 | I_Method1(void, home, IN, double, x, |
|---|
| 101 | Properties::VIRTUAL, |
|---|
| 102 | __void__home__double, |
|---|
| 103 | "Move the camera to the default position. ", |
|---|
| 104 | "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. "); |
|---|
| 105 | I_Method2(void, init, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, |
|---|
| 106 | Properties::VIRTUAL, |
|---|
| 107 | __void__init__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, |
|---|
| 108 | "Start/restart the manipulator. ", |
|---|
| 109 | ""); |
|---|
| 110 | I_Method1(void, zoomOn, IN, const osg::BoundingSphere &, bound, |
|---|
| 111 | Properties::NON_VIRTUAL, |
|---|
| 112 | __void__zoomOn__C5_osg_BoundingSphere_R1, |
|---|
| 113 | "", |
|---|
| 114 | ""); |
|---|
| 115 | I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, |
|---|
| 116 | Properties::VIRTUAL, |
|---|
| 117 | __bool__handle__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, |
|---|
| 118 | "handle events, return true if handled, false otherwise. ", |
|---|
| 119 | ""); |
|---|
| 120 | I_Method0(void, computeHomePosition, |
|---|
| 121 | Properties::VIRTUAL, |
|---|
| 122 | __void__computeHomePosition, |
|---|
| 123 | "Compute the home position. ", |
|---|
| 124 | ""); |
|---|
| 125 | I_Method4(void, computeViewPosition, IN, const osg::BoundingSphere &, bound, IN, double &, scale, IN, double &, distance, IN, osg::Vec3d &, center, |
|---|
| 126 | Properties::NON_VIRTUAL, |
|---|
| 127 | __void__computeViewPosition__C5_osg_BoundingSphere_R1__double_R1__double_R1__osg_Vec3d_R1, |
|---|
| 128 | "", |
|---|
| 129 | ""); |
|---|
| 130 | I_Method1(void, setCenter, IN, const osg::Vec3d &, center, |
|---|
| 131 | Properties::NON_VIRTUAL, |
|---|
| 132 | __void__setCenter__C5_osg_Vec3d_R1, |
|---|
| 133 | "", |
|---|
| 134 | ""); |
|---|
| 135 | I_Method0(const osg::Vec3d &, getCenter, |
|---|
| 136 | Properties::NON_VIRTUAL, |
|---|
| 137 | __C5_osg_Vec3d_R1__getCenter, |
|---|
| 138 | "", |
|---|
| 139 | ""); |
|---|
| 140 | I_Method1(bool, setDistance, IN, double, distance, |
|---|
| 141 | Properties::NON_VIRTUAL, |
|---|
| 142 | __bool__setDistance__double, |
|---|
| 143 | "", |
|---|
| 144 | ""); |
|---|
| 145 | I_Method0(double, getDistance, |
|---|
| 146 | Properties::NON_VIRTUAL, |
|---|
| 147 | __double__getDistance, |
|---|
| 148 | "", |
|---|
| 149 | ""); |
|---|
| 150 | I_Method0(double, getHomeDistance, |
|---|
| 151 | Properties::NON_VIRTUAL, |
|---|
| 152 | __double__getHomeDistance, |
|---|
| 153 | "", |
|---|
| 154 | ""); |
|---|
| 155 | I_Method1(void, setHeading, IN, double, azimuth, |
|---|
| 156 | Properties::NON_VIRTUAL, |
|---|
| 157 | __void__setHeading__double, |
|---|
| 158 | "", |
|---|
| 159 | ""); |
|---|
| 160 | I_Method0(double, getHeading, |
|---|
| 161 | Properties::NON_VIRTUAL, |
|---|
| 162 | __double__getHeading, |
|---|
| 163 | "", |
|---|
| 164 | ""); |
|---|
| 165 | I_Method1(void, setElevation, IN, double, elevation, |
|---|
| 166 | Properties::NON_VIRTUAL, |
|---|
| 167 | __void__setElevation__double, |
|---|
| 168 | "", |
|---|
| 169 | ""); |
|---|
| 170 | I_Method0(double, getElevtion, |
|---|
| 171 | Properties::NON_VIRTUAL, |
|---|
| 172 | __double__getElevtion, |
|---|
| 173 | "", |
|---|
| 174 | ""); |
|---|
| 175 | I_Method0(double, getMinimumZoomScale, |
|---|
| 176 | Properties::NON_VIRTUAL, |
|---|
| 177 | __double__getMinimumZoomScale, |
|---|
| 178 | "get the minimum distance (as ratio) the eye point can be zoomed in ", |
|---|
| 179 | ""); |
|---|
| 180 | I_Method1(void, setMinimumZoomScale, IN, double, minimumZoomScale, |
|---|
| 181 | Properties::NON_VIRTUAL, |
|---|
| 182 | __void__setMinimumZoomScale__double, |
|---|
| 183 | "set the minimum distance (as ratio) the eye point can be zoomed in towards the center before the center is pushed forward. ", |
|---|
| 184 | ""); |
|---|
| 185 | I_Method1(void, setScroolWheelZoomDelta, IN, double, zoomDelta, |
|---|
| 186 | Properties::NON_VIRTUAL, |
|---|
| 187 | __void__setScroolWheelZoomDelta__double, |
|---|
| 188 | "set the mouse scroll wheel zoom delta. ", |
|---|
| 189 | "Range -1.0 to +1.0, -ve value inverts wheel direction and zero switches off scroll wheel. "); |
|---|
| 190 | I_Method0(double, getScroolWheelZoomDelta, |
|---|
| 191 | Properties::NON_VIRTUAL, |
|---|
| 192 | __double__getScroolWheelZoomDelta, |
|---|
| 193 | "get the mouse scroll wheel zoom delta. ", |
|---|
| 194 | ""); |
|---|
| 195 | I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage, |
|---|
| 196 | Properties::VIRTUAL, |
|---|
| 197 | __void__getUsage__osg_ApplicationUsage_R1, |
|---|
| 198 | "Get the keyboard and mouse usage of this manipulator. ", |
|---|
| 199 | ""); |
|---|
| 200 | I_Method0(osgGA::SphericalManipulator::RotationMode, getRotationMode, |
|---|
| 201 | Properties::NON_VIRTUAL, |
|---|
| 202 | __RotationMode__getRotationMode, |
|---|
| 203 | "", |
|---|
| 204 | ""); |
|---|
| 205 | I_Method1(void, setRotationMode, IN, osgGA::SphericalManipulator::RotationMode, mode, |
|---|
| 206 | Properties::NON_VIRTUAL, |
|---|
| 207 | __void__setRotationMode__RotationMode, |
|---|
| 208 | "", |
|---|
| 209 | ""); |
|---|
| 210 | I_Method0(bool, getAllowThrow, |
|---|
| 211 | Properties::NON_VIRTUAL, |
|---|
| 212 | __bool__getAllowThrow, |
|---|
| 213 | "Returns true if the camera can be thrown, false otherwise. ", |
|---|
| 214 | "This defaults to true. "); |
|---|
| 215 | I_Method1(void, setAllowThrow, IN, bool, allowThrow, |
|---|
| 216 | Properties::NON_VIRTUAL, |
|---|
| 217 | __void__setAllowThrow__bool, |
|---|
| 218 | "Set the 'allow throw' flag. ", |
|---|
| 219 | "Releasing the mouse button while moving the camera results in a throw. "); |
|---|
| 220 | I_ProtectedMethod0(void, flushMouseEventStack, |
|---|
| 221 | Properties::NON_VIRTUAL, |
|---|
| 222 | Properties::NON_CONST, |
|---|
| 223 | __void__flushMouseEventStack, |
|---|
| 224 | "Reset the internal GUIEvent stack. ", |
|---|
| 225 | ""); |
|---|
| 226 | I_ProtectedMethod1(void, addMouseEvent, IN, const osgGA::GUIEventAdapter &, ea, |
|---|
| 227 | Properties::NON_VIRTUAL, |
|---|
| 228 | Properties::NON_CONST, |
|---|
| 229 | __void__addMouseEvent__C5_osgGA_GUIEventAdapter_R1, |
|---|
| 230 | "Add the current mouse GUIEvent to internal stack. ", |
|---|
| 231 | ""); |
|---|
| 232 | I_ProtectedMethod0(bool, calcMovement, |
|---|
| 233 | Properties::NON_VIRTUAL, |
|---|
| 234 | Properties::NON_CONST, |
|---|
| 235 | __bool__calcMovement, |
|---|
| 236 | "For the give mouse movement calculate the movement of the camera. ", |
|---|
| 237 | "Return true is camera has moved and a redraw is required. "); |
|---|
| 238 | I_ProtectedMethod0(bool, isMouseMoving, |
|---|
| 239 | Properties::NON_VIRTUAL, |
|---|
| 240 | Properties::NON_CONST, |
|---|
| 241 | __bool__isMouseMoving, |
|---|
| 242 | "Check the speed at which the mouse is moving. ", |
|---|
| 243 | "If speed is below a threshold then return false, otherwise return true. "); |
|---|
| 244 | I_SimpleProperty(bool, AllowThrow, |
|---|
| 245 | __bool__getAllowThrow, |
|---|
| 246 | __void__setAllowThrow__bool); |
|---|
| 247 | I_SimpleProperty(const osg::Matrixd &, ByInverseMatrix, |
|---|
| 248 | 0, |
|---|
| 249 | __void__setByInverseMatrix__C5_osg_Matrixd_R1); |
|---|
| 250 | I_SimpleProperty(const osg::Matrixd &, ByMatrix, |
|---|
| 251 | 0, |
|---|
| 252 | __void__setByMatrix__C5_osg_Matrixd_R1); |
|---|
| 253 | I_SimpleProperty(const osg::Vec3d &, Center, |
|---|
| 254 | __C5_osg_Vec3d_R1__getCenter, |
|---|
| 255 | __void__setCenter__C5_osg_Vec3d_R1); |
|---|
| 256 | I_SimpleProperty(double, Distance, |
|---|
| 257 | __double__getDistance, |
|---|
| 258 | __bool__setDistance__double); |
|---|
| 259 | I_SimpleProperty(double, Elevation, |
|---|
| 260 | 0, |
|---|
| 261 | __void__setElevation__double); |
|---|
| 262 | I_SimpleProperty(double, Elevtion, |
|---|
| 263 | __double__getElevtion, |
|---|
| 264 | 0); |
|---|
| 265 | I_SimpleProperty(osgUtil::SceneView::FusionDistanceMode, FusionDistanceMode, |
|---|
| 266 | __osgUtil_SceneView_FusionDistanceMode__getFusionDistanceMode, |
|---|
| 267 | 0); |
|---|
| 268 | I_SimpleProperty(float, FusionDistanceValue, |
|---|
| 269 | __float__getFusionDistanceValue, |
|---|
| 270 | 0); |
|---|
| 271 | I_SimpleProperty(double, Heading, |
|---|
| 272 | __double__getHeading, |
|---|
| 273 | __void__setHeading__double); |
|---|
| 274 | I_SimpleProperty(double, HomeDistance, |
|---|
| 275 | __double__getHomeDistance, |
|---|
| 276 | 0); |
|---|
| 277 | I_SimpleProperty(osg::Matrixd, InverseMatrix, |
|---|
| 278 | __osg_Matrixd__getInverseMatrix, |
|---|
| 279 | 0); |
|---|
| 280 | I_SimpleProperty(osg::Matrixd, Matrix, |
|---|
| 281 | __osg_Matrixd__getMatrix, |
|---|
| 282 | 0); |
|---|
| 283 | I_SimpleProperty(double, MinimumZoomScale, |
|---|
| 284 | __double__getMinimumZoomScale, |
|---|
| 285 | __void__setMinimumZoomScale__double); |
|---|
| 286 | I_SimpleProperty(osg::Node *, Node, |
|---|
| 287 | __osg_Node_P1__getNode, |
|---|
| 288 | __void__setNode__osg_Node_P1); |
|---|
| 289 | I_SimpleProperty(osgGA::SphericalManipulator::RotationMode, RotationMode, |
|---|
| 290 | __RotationMode__getRotationMode, |
|---|
| 291 | __void__setRotationMode__RotationMode); |
|---|
| 292 | I_SimpleProperty(double, ScroolWheelZoomDelta, |
|---|
| 293 | __double__getScroolWheelZoomDelta, |
|---|
| 294 | __void__setScroolWheelZoomDelta__double); |
|---|
| 295 | END_REFLECTOR |
|---|