| 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/Matrixd> |
|---|
| 15 | #include <osg/Node> |
|---|
| 16 | #include <osg/Quat> |
|---|
| 17 | #include <osg/Vec3d> |
|---|
| 18 | #include <osgGA/GUIActionAdapter> |
|---|
| 19 | #include <osgGA/GUIEventAdapter> |
|---|
| 20 | #include <osgGA/TrackballManipulator> |
|---|
| 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_OBJECT_REFLECTOR(osgGA::TrackballManipulator) |
|---|
| 32 | I_DeclaringFile("osgGA/TrackballManipulator"); |
|---|
| 33 | I_BaseType(osgGA::MatrixManipulator); |
|---|
| 34 | I_Constructor0(____TrackballManipulator, |
|---|
| 35 | "", |
|---|
| 36 | ""); |
|---|
| 37 | I_Method0(const char *, className, |
|---|
| 38 | Properties::VIRTUAL, |
|---|
| 39 | __C5_char_P1__className, |
|---|
| 40 | "return the name of the object's class type. ", |
|---|
| 41 | "Must be defined by derived classes. "); |
|---|
| 42 | I_Method1(void, setByMatrix, IN, const osg::Matrixd &, matrix, |
|---|
| 43 | Properties::VIRTUAL, |
|---|
| 44 | __void__setByMatrix__C5_osg_Matrixd_R1, |
|---|
| 45 | "set the position of the matrix manipulator using a 4x4 Matrix. ", |
|---|
| 46 | ""); |
|---|
| 47 | I_Method1(void, setByInverseMatrix, IN, const osg::Matrixd &, matrix, |
|---|
| 48 | Properties::VIRTUAL, |
|---|
| 49 | __void__setByInverseMatrix__C5_osg_Matrixd_R1, |
|---|
| 50 | "set the position of the matrix manipulator using a 4x4 Matrix. ", |
|---|
| 51 | ""); |
|---|
| 52 | I_Method0(osg::Matrixd, getMatrix, |
|---|
| 53 | Properties::VIRTUAL, |
|---|
| 54 | __osg_Matrixd__getMatrix, |
|---|
| 55 | "get the position of the manipulator as 4x4 Matrix. ", |
|---|
| 56 | ""); |
|---|
| 57 | I_Method0(osg::Matrixd, getInverseMatrix, |
|---|
| 58 | Properties::VIRTUAL, |
|---|
| 59 | __osg_Matrixd__getInverseMatrix, |
|---|
| 60 | "get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix. ", |
|---|
| 61 | ""); |
|---|
| 62 | I_Method0(osgUtil::SceneView::FusionDistanceMode, getFusionDistanceMode, |
|---|
| 63 | Properties::VIRTUAL, |
|---|
| 64 | __osgUtil_SceneView_FusionDistanceMode__getFusionDistanceMode, |
|---|
| 65 | "Get the FusionDistanceMode. ", |
|---|
| 66 | "Used by SceneView for setting up stereo convergence. "); |
|---|
| 67 | I_Method0(float, getFusionDistanceValue, |
|---|
| 68 | Properties::VIRTUAL, |
|---|
| 69 | __float__getFusionDistanceValue, |
|---|
| 70 | "Get the FusionDistanceValue. ", |
|---|
| 71 | "Used by SceneView for setting up stereo convergence. "); |
|---|
| 72 | I_Method1(void, setNode, IN, osg::Node *, x, |
|---|
| 73 | Properties::VIRTUAL, |
|---|
| 74 | __void__setNode__osg_Node_P1, |
|---|
| 75 | "Attach a node to the manipulator. ", |
|---|
| 76 | "Automatically detaches previously attached node. setNode(NULL) detaches previously nodes. Is ignored by manipulators which do not require a reference model. "); |
|---|
| 77 | I_Method0(const osg::Node *, getNode, |
|---|
| 78 | Properties::VIRTUAL, |
|---|
| 79 | __C5_osg_Node_P1__getNode, |
|---|
| 80 | "Return node if attached. ", |
|---|
| 81 | ""); |
|---|
| 82 | I_Method0(osg::Node *, getNode, |
|---|
| 83 | Properties::VIRTUAL, |
|---|
| 84 | __osg_Node_P1__getNode, |
|---|
| 85 | "Return node if attached. ", |
|---|
| 86 | ""); |
|---|
| 87 | I_Method2(void, home, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, |
|---|
| 88 | Properties::VIRTUAL, |
|---|
| 89 | __void__home__C5_GUIEventAdapter_R1__GUIActionAdapter_R1, |
|---|
| 90 | "Move the camera to the default position. ", |
|---|
| 91 | "May be ignored by manipulators if home functionality is not appropriate. "); |
|---|
| 92 | I_Method1(void, home, IN, double, x, |
|---|
| 93 | Properties::VIRTUAL, |
|---|
| 94 | __void__home__double, |
|---|
| 95 | "Move the camera to the default position. ", |
|---|
| 96 | "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. "); |
|---|
| 97 | I_Method2(void, init, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, |
|---|
| 98 | Properties::VIRTUAL, |
|---|
| 99 | __void__init__C5_GUIEventAdapter_R1__GUIActionAdapter_R1, |
|---|
| 100 | "Start/restart the manipulator. ", |
|---|
| 101 | ""); |
|---|
| 102 | I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us, |
|---|
| 103 | Properties::VIRTUAL, |
|---|
| 104 | __bool__handle__C5_GUIEventAdapter_R1__GUIActionAdapter_R1, |
|---|
| 105 | "handle events, return true if handled, false otherwise. ", |
|---|
| 106 | ""); |
|---|
| 107 | I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage, |
|---|
| 108 | Properties::VIRTUAL, |
|---|
| 109 | __void__getUsage__osg_ApplicationUsage_R1, |
|---|
| 110 | "Get the keyboard and mouse usage of this manipulator. ", |
|---|
| 111 | ""); |
|---|
| 112 | I_Method1(void, setMinimumZoomScale, IN, double, minimumZoomScale, |
|---|
| 113 | Properties::NON_VIRTUAL, |
|---|
| 114 | __void__setMinimumZoomScale__double, |
|---|
| 115 | "set the minimum distance (as ratio) the eye point can be zoomed in towards the center before the center is pushed forward. ", |
|---|
| 116 | ""); |
|---|
| 117 | I_Method0(double, getMinimumZoomScale, |
|---|
| 118 | Properties::NON_VIRTUAL, |
|---|
| 119 | __double__getMinimumZoomScale, |
|---|
| 120 | "get the minimum distance (as ratio) the eye point can be zoomed in ", |
|---|
| 121 | ""); |
|---|
| 122 | I_Method1(void, setScroolWheelZoomDelta, IN, double, zoomDelta, |
|---|
| 123 | Properties::NON_VIRTUAL, |
|---|
| 124 | __void__setScroolWheelZoomDelta__double, |
|---|
| 125 | "set the mouse scroll wheel zoom delta. ", |
|---|
| 126 | "Range -1.0 to +1.0, -ve value inverts wheel direction and zero switches off scroll wheel. "); |
|---|
| 127 | I_Method0(double, getScroolWheelZoomDelta, |
|---|
| 128 | Properties::NON_VIRTUAL, |
|---|
| 129 | __double__getScroolWheelZoomDelta, |
|---|
| 130 | "get the mouse scroll wheel zoom delta. ", |
|---|
| 131 | ""); |
|---|
| 132 | I_Method1(void, setCenter, IN, const osg::Vec3d &, center, |
|---|
| 133 | Properties::NON_VIRTUAL, |
|---|
| 134 | __void__setCenter__C5_osg_Vec3d_R1, |
|---|
| 135 | "Set the center of the trackball. ", |
|---|
| 136 | ""); |
|---|
| 137 | I_Method0(const osg::Vec3d &, getCenter, |
|---|
| 138 | Properties::NON_VIRTUAL, |
|---|
| 139 | __C5_osg_Vec3d_R1__getCenter, |
|---|
| 140 | "Get the center of the trackball. ", |
|---|
| 141 | ""); |
|---|
| 142 | I_Method1(void, setRotation, IN, const osg::Quat &, rotation, |
|---|
| 143 | Properties::NON_VIRTUAL, |
|---|
| 144 | __void__setRotation__C5_osg_Quat_R1, |
|---|
| 145 | "Set the rotation of the trackball. ", |
|---|
| 146 | ""); |
|---|
| 147 | I_Method0(const osg::Quat &, getRotation, |
|---|
| 148 | Properties::NON_VIRTUAL, |
|---|
| 149 | __C5_osg_Quat_R1__getRotation, |
|---|
| 150 | "Get the rotation of the trackball. ", |
|---|
| 151 | ""); |
|---|
| 152 | I_Method1(void, setDistance, IN, double, distance, |
|---|
| 153 | Properties::NON_VIRTUAL, |
|---|
| 154 | __void__setDistance__double, |
|---|
| 155 | "Set the distance of the trackball. ", |
|---|
| 156 | ""); |
|---|
| 157 | I_Method0(double, getDistance, |
|---|
| 158 | Properties::NON_VIRTUAL, |
|---|
| 159 | __double__getDistance, |
|---|
| 160 | "Get the distance of the trackball. ", |
|---|
| 161 | ""); |
|---|
| 162 | I_Method1(void, setTrackballSize, IN, float, size, |
|---|
| 163 | Properties::NON_VIRTUAL, |
|---|
| 164 | __void__setTrackballSize__float, |
|---|
| 165 | "Set the size of the trackball. ", |
|---|
| 166 | ""); |
|---|
| 167 | I_Method0(float, getTrackballSize, |
|---|
| 168 | Properties::NON_VIRTUAL, |
|---|
| 169 | __float__getTrackballSize, |
|---|
| 170 | "Get the size of the trackball. ", |
|---|
| 171 | ""); |
|---|
| 172 | I_ProtectedMethod0(void, flushMouseEventStack, |
|---|
| 173 | Properties::NON_VIRTUAL, |
|---|
| 174 | Properties::NON_CONST, |
|---|
| 175 | __void__flushMouseEventStack, |
|---|
| 176 | "Reset the internal GUIEvent stack. ", |
|---|
| 177 | ""); |
|---|
| 178 | I_ProtectedMethod1(void, addMouseEvent, IN, const osgGA::GUIEventAdapter &, ea, |
|---|
| 179 | Properties::NON_VIRTUAL, |
|---|
| 180 | Properties::NON_CONST, |
|---|
| 181 | __void__addMouseEvent__C5_GUIEventAdapter_R1, |
|---|
| 182 | "Add the current mouse GUIEvent to internal stack. ", |
|---|
| 183 | ""); |
|---|
| 184 | I_ProtectedMethod3(void, computePosition, IN, const osg::Vec3 &, eye, IN, const osg::Vec3 &, lv, IN, const osg::Vec3 &, up, |
|---|
| 185 | Properties::NON_VIRTUAL, |
|---|
| 186 | Properties::NON_CONST, |
|---|
| 187 | __void__computePosition__C5_osg_Vec3_R1__C5_osg_Vec3_R1__C5_osg_Vec3_R1, |
|---|
| 188 | "", |
|---|
| 189 | ""); |
|---|
| 190 | I_ProtectedMethod0(bool, calcMovement, |
|---|
| 191 | Properties::NON_VIRTUAL, |
|---|
| 192 | Properties::NON_CONST, |
|---|
| 193 | __bool__calcMovement, |
|---|
| 194 | "For the give mouse movement calculate the movement of the camera. ", |
|---|
| 195 | "Return true is camera has moved and a redraw is required. "); |
|---|
| 196 | I_ProtectedMethod6(void, trackball, IN, osg::Vec3 &, axis, IN, float &, angle, IN, float, p1x, IN, float, p1y, IN, float, p2x, IN, float, p2y, |
|---|
| 197 | Properties::NON_VIRTUAL, |
|---|
| 198 | Properties::NON_CONST, |
|---|
| 199 | __void__trackball__osg_Vec3_R1__float_R1__float__float__float__float, |
|---|
| 200 | "", |
|---|
| 201 | ""); |
|---|
| 202 | I_ProtectedMethod3(float, tb_project_to_sphere, IN, float, r, IN, float, x, IN, float, y, |
|---|
| 203 | Properties::NON_VIRTUAL, |
|---|
| 204 | Properties::NON_CONST, |
|---|
| 205 | __float__tb_project_to_sphere__float__float__float, |
|---|
| 206 | "", |
|---|
| 207 | ""); |
|---|
| 208 | I_ProtectedMethod0(bool, isMouseMoving, |
|---|
| 209 | Properties::NON_VIRTUAL, |
|---|
| 210 | Properties::NON_CONST, |
|---|
| 211 | __bool__isMouseMoving, |
|---|
| 212 | "Check the speed at which the mouse is moving. ", |
|---|
| 213 | "If speed is below a threshold then return false, otherwise return true. "); |
|---|
| 214 | I_SimpleProperty(const osg::Matrixd &, ByInverseMatrix, |
|---|
| 215 | 0, |
|---|
| 216 | __void__setByInverseMatrix__C5_osg_Matrixd_R1); |
|---|
| 217 | I_SimpleProperty(const osg::Matrixd &, ByMatrix, |
|---|
| 218 | 0, |
|---|
| 219 | __void__setByMatrix__C5_osg_Matrixd_R1); |
|---|
| 220 | I_SimpleProperty(const osg::Vec3d &, Center, |
|---|
| 221 | __C5_osg_Vec3d_R1__getCenter, |
|---|
| 222 | __void__setCenter__C5_osg_Vec3d_R1); |
|---|
| 223 | I_SimpleProperty(double, Distance, |
|---|
| 224 | __double__getDistance, |
|---|
| 225 | __void__setDistance__double); |
|---|
| 226 | I_SimpleProperty(osgUtil::SceneView::FusionDistanceMode, FusionDistanceMode, |
|---|
| 227 | __osgUtil_SceneView_FusionDistanceMode__getFusionDistanceMode, |
|---|
| 228 | 0); |
|---|
| 229 | I_SimpleProperty(float, FusionDistanceValue, |
|---|
| 230 | __float__getFusionDistanceValue, |
|---|
| 231 | 0); |
|---|
| 232 | I_SimpleProperty(osg::Matrixd, InverseMatrix, |
|---|
| 233 | __osg_Matrixd__getInverseMatrix, |
|---|
| 234 | 0); |
|---|
| 235 | I_SimpleProperty(osg::Matrixd, Matrix, |
|---|
| 236 | __osg_Matrixd__getMatrix, |
|---|
| 237 | 0); |
|---|
| 238 | I_SimpleProperty(double, MinimumZoomScale, |
|---|
| 239 | __double__getMinimumZoomScale, |
|---|
| 240 | __void__setMinimumZoomScale__double); |
|---|
| 241 | I_SimpleProperty(osg::Node *, Node, |
|---|
| 242 | __osg_Node_P1__getNode, |
|---|
| 243 | __void__setNode__osg_Node_P1); |
|---|
| 244 | I_SimpleProperty(const osg::Quat &, Rotation, |
|---|
| 245 | __C5_osg_Quat_R1__getRotation, |
|---|
| 246 | __void__setRotation__C5_osg_Quat_R1); |
|---|
| 247 | I_SimpleProperty(double, ScroolWheelZoomDelta, |
|---|
| 248 | __double__getScroolWheelZoomDelta, |
|---|
| 249 | __void__setScroolWheelZoomDelta__double); |
|---|
| 250 | I_SimpleProperty(float, TrackballSize, |
|---|
| 251 | __float__getTrackballSize, |
|---|
| 252 | __void__setTrackballSize__float); |
|---|
| 253 | END_REFLECTOR |
|---|