vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ToolHook.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "DATool.h"
4 #include "PoA.h"
5 #include "Hoop.h"
6 #include "Hook.h"
7 
8 namespace APDYNAMICART
9 {
10 
12 
15 typedef std::pair<HoopPtr, osg::ref_ptr<HookObject> > Hook;
16 
17 class ToolHook : public DATool
18 {
19 public:
20  ToolHook();
21 
23  virtual void activate();
24  virtual void deactivate();
25  virtual void turnOn();
26  virtual void turnOff();
27  virtual void update();
28  virtual bool initialize(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters = NULL );
29 
31  float getRopeRadius() const { return _ropeRadius; }
32 
34  std::string createMenuStructure();
35  void guiItemClicked(const char* itemID);
36  void menuSliderChanged(const char* sliderID, float sliderPos);
37 
38 protected:
40  PoA* getSelectedPoA();
41  osg::Vec3 getCursorPosition();
42  void initMenu();
43 
44  osg::Vec3 _DAAposition;
45  osg::Quat _DAAOrientation;
46  osg::Vec3 _DAAScale;
48  osg::Vec3 _hookPosition;
49  float _ropeRadius;
50 
53  osg::Vec3 _axis;
54 
58  DECLARE_REQUEST_OUTPUT(SensorTransformation, MessageInt, MessageSensorTransformation);
59  DECLARE_REQUEST_OUTPUT(SelectedObjectID, MessageInt, MessageObjectID);
61  DECLARE_INPUT(GUIItemClicked, MessageString);
62  DECLARE_INPUT(CreateMenuStructure, MessageInt);
63  DECLARE_INPUT(HidingMenu, MessageBool);
64  DECLARE_OUTPUT(MenuStructure, MessageString);
65 };
66 
67 }