OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
person.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 /*
9  * person.h
10  *
11  * Created on: Dec 5, 2014
12  * Author: svnvlad
13  */
14 
15 #ifndef __PERSON_H_
16 #define __PERSON_H_
17 
18 #include <osg/Matrix>
19 #include <vector>
20 
21 #include "trackingbody.h"
22 #include "buttondevice.h"
23 #include "valuator.h"
24 #include <util/coExport.h>
25 
26 namespace opencover
27 {
28 
29 class COVEREXPORT Person
30 {
31  friend class Input;
32 
33 public:
34  std::string name() const;
35 
36  bool hasHead() const;
37  bool isHeadValid() const;
38  bool hasHand(size_t num) const;
39  bool isHandValid(size_t idx) const;
40  bool isVarying() const;
41  bool hasRelative() const;
42  bool isRelativeValid() const;
43 
44  TrackingBody *getHead() const;
45  TrackingBody *getHand(size_t num) const;
46  TrackingBody *getRelative() const;
47 
48  const osg::Matrix &getHeadMat() const;
49  const osg::Matrix &getHandMat(size_t num) const;
50  const osg::Matrix &getRelativeMat() const;
51 
52  unsigned int getButtonState(size_t num) const;
53  unsigned int getRelativeButtonState(size_t num) const;
54  double getValuatorValue(size_t idx) const;
55 
56  float eyeDistance() const;
57  void setEyeDistance(float dist);
58 
59  bool activateOnAction() const;
60  void setActivateOnAction(bool enable);
61 
62 private:
63  Person(const std::string &name);
64  void addHand(TrackingBody *hand);
65  void addValuator(Valuator *val);
66 
67  std::string m_name;
68  TrackingBody *m_head = nullptr;
69  TrackingBody *m_relative = nullptr;
70  std::vector<TrackingBody *> m_hands;
71  ButtonDevice *m_buttondev = nullptr;
72  ButtonDevice *m_relativebuttondev = nullptr;
73  std::vector<Valuator *> m_valuators;
74  float m_eyeDistance = 0.f;
75  bool m_activateOnAction = false;
76 
77  static const osg::Matrix s_identity;
78 };
79 }
80 #endif /* PERSON_H_ */
Definition: buttondevice.h:27
Definition: trackingbody.h:28
The Input class.
Definition: input.h:38
Definition: valuator.h:27
Definition: person.h:29