OpenCOVER
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
26namespace opencover
27{
28
29class COVEREXPORT Person
30{
31 friend class Input;
32
33public:
34 std::string name() const;
35
36 bool hasMouse() const;
37 bool hasHead() const;
38 bool isHeadValid() const;
39 bool hasHand(size_t num) const;
40 bool isHandValid(size_t idx) const;
41 bool isVarying() const;
42 bool hasRelative() const;
43 bool isRelativeValid() const;
44
47 TrackingBody *getHand(size_t num) const;
49
50 const osg::Matrix &getMouseMat() const;
51 const osg::Matrix &getHeadMat() const;
52 const osg::Matrix &getHandMat(size_t num) const;
53 const osg::Matrix &getRelativeMat() const;
54
55 unsigned int getMouseButtonState(size_t num) const;
56 unsigned int getButtonState(size_t num) const;
57 unsigned int getRelativeButtonState(size_t num) const;
58 double getValuatorValue(size_t idx) const;
59
60 float eyeDistance() const;
61 void setEyeDistance(float dist);
62
63 bool activateOnAction() const;
64 void setActivateOnAction(bool enable);
65
66private:
67 Person(const std::string &name);
68 void addHand(TrackingBody *hand);
69 void addValuator(Valuator *val);
70
71 std::string m_name;
72 TrackingBody *m_mouse = nullptr;
73 TrackingBody *m_head = nullptr;
74 TrackingBody *m_relative = nullptr;
75 std::vector<TrackingBody *> m_hands;
76 ButtonDevice *m_mousebuttondev = nullptr;
77 ButtonDevice *m_buttondev = nullptr;
78 ButtonDevice *m_relativebuttondev = nullptr;
79 std::vector<Valuator *> m_valuators;
80 float m_eyeDistance = 0.f;
81 bool m_activateOnAction = false;
82
83 static const osg::Matrix s_identity;
84};
85}
86#endif /* PERSON_H_ */
Definition: ARToolKit.h:33
Definition: buttondevice.h:28
The Input class.
Definition: input.h:40
Definition: person.h:30
double getValuatorValue(size_t idx) const
std::string name() const
unsigned int getRelativeButtonState(size_t num) const
bool hasMouse() const
bool activateOnAction() const
TrackingBody * getRelative() const
void setActivateOnAction(bool enable)
const osg::Matrix & getRelativeMat() const
float eyeDistance() const
TrackingBody * getHand(size_t num) const
bool isHeadValid() const
void setEyeDistance(float dist)
const osg::Matrix & getMouseMat() const
bool isRelativeValid() const
bool isVarying() const
unsigned int getButtonState(size_t num) const
bool hasRelative() const
unsigned int getMouseButtonState(size_t num) const
bool isHandValid(size_t idx) const
bool hasHead() const
const osg::Matrix & getHandMat(size_t num) const
TrackingBody * getMouse() const
bool hasHand(size_t num) const
TrackingBody * getHead() const
const osg::Matrix & getHeadMat() const
Definition: trackingbody.h:29
Definition: valuator.h:28