vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProxiSphere.h
Go to the documentation of this file.
1 #include <vrecko/Ability.h>
2 #include <vreckoDP/base/PHANToM.h>
3 #include <osg/Vec4>
4 #include <osg/Geode>
5 #include <osg/MatrixTransform>
6 #include <osg/Group>
7 
8 
9 using namespace vrecko;
10 using namespace vreckoDP_base;
11 namespace VirtualFixture{
12 
13 class ProxiSphere: public Ability {
14  public:
15  ProxiSphere();
17 
19  void processEvent(const std::string &input_name, void *value);
20 
21  void preInitialize(void);
22  void postInitialize(void);
23  void update(void);
24  void display(void); //show/hide object
25 
26  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
27  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
28 
29  protected:
30  PHANToM *PHANToMDevice;
31  bool all_on;
32  bool active; //if true, attractive field will be active
33 
34  bool visible; //if geometric representation will be visible
35  osg::MatrixTransform *tnode; //transform node pointer
36  osg::Group *gnode; //group pointer
37  osg::Geode *node; //geometry node pointer (for bouning cylinder)
38  osg::Vec4 color; //color of border sphere (radius)
39  float transparency; //border sphere transparency
40 
41  osg::Vec3 position; //position of centre (the point where PHANToM will be attracted to)
42  float radius; //radius of attractive field
43 
44  bool once; //if true then if sphere is entered, one signal is send till sphere is not leaved and reentered (then send next signal)
45  bool justonce; //send only one signal when entered at first ...reentering doesn't reset it, it send just one signal at all
46  bool sendflag; //set true if signal was send
47 };
48 
49 };