3 * Copyright (C) 2013 James Turner
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 #ifndef SG_SCENE_PICK_ANIMATION_HXX
23 #define SG_SCENE_PICK_ANIMATION_HXX
25 #include <simgear/scene/model/animation.hxx>
26 #include <simgear/misc/strutils.hxx>
30 class SGSceneUserData;
32 //////////////////////////////////////////////////////////////////////
34 //////////////////////////////////////////////////////////////////////
36 class SGPickAnimation : public SGAnimation {
38 SGPickAnimation(const SGPropertyNode* configNode,
39 SGPropertyNode* modelRoot);
41 // override so we can treat object-name specially
42 virtual void apply(osg::Group& group);
44 void apply(osg::Node* node);
48 virtual osg::Group* createMainGroup(osg::Group* pr);
50 virtual void setupCallbacks(SGSceneUserData* ud, osg::Group* parent);
55 string_list _proxyNames;
59 class SGKnobAnimation : public SGPickAnimation
62 SGKnobAnimation(const SGPropertyNode* configNode,
63 SGPropertyNode* modelRoot);
66 * by default mouse wheel up corresponds to increment (CW)
67 * and mouse-wheel down corresponds to decrement (CCW).
68 * Since no one can agree on that, make it a global toggle.
70 static void setAlternateMouseWheelDirection(bool aToggle);
73 * by default mouse is dragged left-right to change knobs.
74 * set this to true to default to up-down. Individual knobs
77 static void setAlternateDragAxis(bool aToggle);
81 * Scale the drag sensitivity. This provides a global hook for
82 * the user to scale the senstivity of dragging according to
83 * personal preference.
85 static void setDragSensitivity(double aFactor);
89 virtual osg::Group* createMainGroup(osg::Group* pr);
91 virtual void setupCallbacks(SGSceneUserData* ud, osg::Group* parent);
98 SGSharedPtr<SGExpressiond const> _animationValue;
101 class SGSliderAnimation : public SGPickAnimation
104 SGSliderAnimation(const SGPropertyNode* configNode,
105 SGPropertyNode* modelRoot);
109 virtual osg::Group* createMainGroup(osg::Group* pr);
111 virtual void setupCallbacks(SGSceneUserData* ud, osg::Group* parent);
114 class UpdateCallback;
117 SGSharedPtr<SGExpressiond const> _animationValue;
120 #endif // of SG_SCENE_PICK_ANIMATION_HXX