vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ToolBrush.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "DATool.h"
4 #include "PoA.h"
5 #include "SimpleBox.h"
6 #include "Brush.h"
7 
8 namespace APDYNAMICART
9 {
10 
12 
13 typedef osg::ref_ptr<SimpleBox> ref_ptr_SimpleBox;
14 
16 
19 class ToolBrush : public DATool
20 {
21 public:
22 
23  ToolBrush();
24  ~ToolBrush();
25 
26  void activate();
27  void deactivate();
28 
29  void CreateMenuAbilities();
30 
31  std::string createMenuStructure();
32 
33 
34  void initialize( int newSensorNumber, BrushPtr brush, osg::Vec4 color );
35 
37 
41  void menuSliderChanged(const char* sliderID, float sliderPos);
42 
43  inline void setSensorNumber( const int sensorNum ) { _sensorNumber = sensorNum; }
44 
45  void storeSample( osg::Vec3 position, osg::Quat orientation);
46 
47  void turnOn();
48 
49  void turnOff();
50 
51  void update();
52 
53 
54 protected:
55 
57 
58  osg::ref_ptr<Brush> _brush;
59 
60  osg::Vec3 _DAAposition;
61  osg::Quat _DAAOrientation;
62  osg::Vec3 _DAAScale;
63  osg::Vec3 _lastValidPosition;
64 
67 
68  osg::Timer_t _strokeStartTime;
69 
71 
74  void guiItemClicked(const char* itemID);
75 
76 
77  DECLARE_INPUT(GUIItemClicked, MessageString);
78  DECLARE_INPUT(CreateMenuStructure, MessageInt);
79  DECLARE_INPUT(HidingMenu, MessageBool);
80  DECLARE_OUTPUT(MenuStructure, MessageString);
81 
82  DECLARE_REQUEST_OUTPUT(SensorTransformation, MessageInt, MessageSensorTransformation);
83 
84 };
85 
86 
87 typedef osg::ref_ptr<ToolBrush> ref_ptr_ToolBrush;
88 
89 }