vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ToolMagicWand.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "DATool.h"
4 #include "PoA.h"
5 #include "OrdinaryAttractor.h"
6 
7 namespace APDYNAMICART
8 {
9 
10 class DAEnvironment;
11 class Controller;
12 
13 
14 class ToolMagicWand : public DATool
15 {
16 public:
17 
18  ToolMagicWand();
19 
20  virtual void activate();
21 
22  void createMenuAbilities();
23 
24  std::string createMenuStructure();
25 
27 
28  virtual void deactivate();
29  virtual bool initialize(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters = NULL);
30  virtual void turnOn();
31  virtual void turnOff();
32  virtual void update();
33 
34 
35 protected:
37  std::string PointerPosReqString;
38 
39  osg::ref_ptr<OrdinaryAttractor> attractor;
40 
41  bool dominantAxis;
42 
45 
47  osg::Vec3 newHandPosition;
48 
49  double handMoveMin;
50  double handMoveMax;
51 
52  osg::Vec3 paramRangeStart;
53  osg::Vec3 paramRangeEnd;
54  osg::Vec3 initialParamValue;
55  osg::Vec3 paramShift1;
56  osg::Vec3 paramShift2;
57  osg::Vec3 paramMult;
58 
59  int indexX;
60  int indexY;
61  int indexZ;
62 
66 
67  void changeAttractor(osg::Vec3 newHandPosition);
68  void setValuesXYZ( double newValueX, double newValueY, double newValueZ );
69 
70  //for context menu functionality
71  DECLARE_INPUT(GUIItemClicked, MessageString);
72  DECLARE_INPUT(CreateMenuStructure, MessageInt);
73  DECLARE_INPUT(HidingMenu, MessageBool);
74 
76 
79  void guiItemClicked(const char* itemID);
80 
82 
86  void menuSliderChanged(const char* sliderID, float sliderPos);
87 
88  DECLARE_OUTPUT(MenuStructure, MessageString);
89 
90  //for positition of hand
91  DECLARE_REQUEST_OUTPUT(SensorTransformation, MessageInt, MessageSensorTransformation);
92 
93 
94  DECLARE_REQUEST_OUTPUT(SelectedObjectID, MessageInt, MessageObjectID);
96  osg::Vec3 _lastHandPosition;
97 };
98 
99 }