OpenCOVER
coVRPartner.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#ifndef CO_VR_PARTNER_H
9#define CO_VR_PARTNER_H
10
11#include "ui/Owner.h"
12
13#include <util/DLinkList.h>
14#include <util/coTypes.h>
15#include <vrb/RemoteClient.h>
16
17#include <vector>
18namespace covise
19{
20class TokenBuffer;
21}
22namespace vrb {
23class SessionID;
24}
25namespace opencover
26{
27class VRAvatar;
28namespace ui
29{
30class ButtonGroup;
31class CollaborativePartner;
32}
33
34class COVEREXPORT coVRPartner: public ui::Owner, public vrb::RemoteClient
35{
36
37private:
38 ui::CollaborativePartner *m_ui = nullptr;
39 VRAvatar *m_avatar = nullptr;
40
41public:
43 coVRPartner(RemoteClient &&me);
44
45 void changeID(int id);
46 void setMaster(int clientID) override;
47 void updateUi();
48
50
51 void setFile(const char *fileName);
53 void setAvatar(VRAvatar *avatar);
54
55 virtual ~coVRPartner();
56};
57
58class COVEREXPORT coVRPartnerList: public ui::Owner
59{
60
61public:
62 typedef std::vector<std::unique_ptr<coVRPartner>> ValueType;
65 coVRPartnerList(coVRPartnerList&& other) = default;
68 coVRPartner *get(int ID);
70 void addPartner(vrb::RemoteClient &&p);
71 void removePartner(int id);
73 int numberOfPartners() const;
74 void setMaster(int id);
75 void setSessionID(int partner, const vrb::SessionID & id);
77 void receiveAvatarMessage(covise::TokenBuffer &tb);
81 void print();
82 ui::ButtonGroup *group();
84 ValueType::const_iterator begin() const;
85 ValueType::const_iterator end() const;
86
87private:
88 static coVRPartnerList *s_instance;
89 ui::ButtonGroup *m_group = nullptr;
90 ValueType partners;
91 bool m_avatarsVisible;
93 ValueType::iterator find(int id);
94};
95}
96#endif
Definition: ARToolKit.h:33
Definition: coTabletUI.h:51
Definition: coTabletUI.h:59
Definition: coVRPartner.h:35
void setAvatar(VRAvatar *avatar)
void setMaster(int clientID) override
coVRPartner(RemoteClient &&me)
void setFile(const char *fileName)
VRAvatar * getAvatar()
Definition: coVRPartner.h:59
ValueType::const_iterator begin() const
void addPartner(vrb::RemoteClient &&p)
coVRPartner * get(int ID)
void setSessionID(int partner, const vrb::SessionID &id)
static coVRPartnerList * instance()
coVRPartnerList(coVRPartnerList &other)=delete
ui::ButtonGroup * group()
ValueType::const_iterator end() const
coVRPartnerList(coVRPartnerList &&other)=default
std::vector< std::unique_ptr< coVRPartner > > ValueType
Definition: coVRPartner.h:62
coVRPartnerList & operator=(coVRPartnerList &&other)=delete
void receiveAvatarMessage(covise::TokenBuffer &tb)
coVRPartnerList & operator=(coVRPartnerList &other)=delete
Definition: VRAvatar.h:40