vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Border.h
Go to the documentation of this file.
1 //module for PHANToM work space border signalization
2 //when border is reached, PHANToM will vibrate
3 
4 #ifndef VF_BORDER
5 #define VF_BORDER
6 
7 
8 #include <vrecko/Ability.h>
9 #include <vreckoDP/base/PHANToM.h>
10 #include <osg/Vec4>
11 #include <osg/Geode>
12 #include <osg/MatrixTransform>
13 #include <osg/Group>
14 
15 #include "Auxiliary.h"
16 
17 
18 using namespace vrecko;
19 using namespace vreckoDP_base;
20 namespace VirtualFixture{
21 
22 class Border: public PHANToMFilter {
23  public:
24  Border();
25  ~Border() {};
26 
28  void apply(PHANToM *pPHANToM, osg::Vec3 &force);
29  void processEvent(const std::string &input_name, void *value);
30 
31  void preInitialize(void);
32  void postInitialize(void);
33  void update(void);
34 
35  void display(void); //show or hide VF_cylinder object
36 
37  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
38  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
39 
40  protected:
41  PHANToM *PHANToMDevice;
42  bool all_on;
43  bool active; //VF switcher
44 
45  bool visible; //if geometric representation will be visible
46  osg::MatrixTransform *tnode; //transform node pointer
47  osg::Group *gnode; //group pointer
48  osg::Geode *node; //geometry node pointer (for bouning cylinder)
49  osg::Geode *node2; //geometry node2 pointer (for center cylinder)
50  osg::Vec4 color; //color of border sphere (radius1)
51  osg::Vec4 color2; //color of inner sphere (radius2)
52  float transparency; //border sphere transparency
53  float transparency2; //inner sphere transparency
54 
55  osg::Vec3 direction; //direction of vibration
56  float frequency; //frequency of warning vibration
57  float amplitude; //base amplitude of vibration
58 };
59 
60 };
61 #endif