vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Box.h
Go to the documentation of this file.
1 #ifndef VF_BOX
2 #define VF_BOX
3 
4 #include <vrecko/Ability.h>
5 #include <vreckoDP/base/PHANToM.h>
6 #include <osg/Vec4>
7 #include <osg/Geode>
8 #include <osg/MatrixTransform>
9 #include <osg/Group>
10 
11 
12 using namespace vrecko;
13 using namespace vreckoDP_base;
14 namespace VirtualFixture{
15 
16 class Box: public PHANToMFilter {
17  public:
18  Box();
19  ~Box() {};
20 
22  void apply(PHANToM *pPHANToM, osg::Vec3 &force);
23  void processEvent(const std::string &input_name, void *value);
24 
25  void preInitialize(void);
26  void postInitialize(void);
27  void update(void);
28  void display(void); //show/hide object
29 
30  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
31  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
32 
33  protected:
34  PHANToM *PHANToMDevice;
35  bool all_on;
36  bool active; //if true, attractive field will be active
37 
38  bool visible; //if geometric representation will be visible
39  osg::MatrixTransform *tnode; //transform node pointer
40  osg::Group *gnode; //group pointer
41  osg::Geode *node; //geometry node pointer (for bounding cylinder)
42  osg::Vec4 color; //color of border sphere (radius)
43  float transparency; //border sphere transparency
44 
45  osg::Vec3 position; //position of centre (the point where PHANToM will be attracted to)
46  osg::Vec3 size; //size of box (width, height, lenght), position is in center, so left,bottom, corner is in position - size/2
47  osg::Vec3 nullsize; //size of box (width, height, lenght), position is in center, so left,bottom, corner is in position - size/2 ; close to center where attractive force is NOT applied
48  float stiffness; //force divided by meter
49 };
50 
51 };
52 
53 #endif
54