Debian Codegraph @

3rdparty/osgXR/src/InteractionProfile.h

raw symbols SCIP
1 // SPDX-License-Identifier: LGPL-2.1-only
2 // Copyright (C) 2021 James Hogan <[email protected]>
3
4 #ifndef OSGXR_INTERACTION_PROFILE
5 #define OSGXR_INTERACTION_PROFILE 1
6
7 #include <osgXR/InteractionProfile>
8
9 #include <osg/observer_ptr>
10 #include <osg/ref_ptr>
11
12 #include <list>
13 #include <string>
14
15 namespace osgXR {
16
17 class XRState;
18
19 namespace OpenXR {
20 class InteractionProfile;
21 class Path;
22 class Session;
23 };
24
25 class InteractionProfile::Private
26 {
27 public:
28
29 static Private *get(InteractionProfile *pub)
30 {
31 return pub->_private.get();
32 }
33
34 Private(InteractionProfile *pub,
35 XRState *newState,
36 const std::string &newVendor,
37 const std::string &newType);
38 ~Private();
39
40 void suggestBinding(Action *action, const std::string &binding);
41
42 bool getUpdated() const
43 {
44 return _updated;
45 }
46
47 /// Setup bindings with an OpenXR instance
48 bool setup(OpenXR::Instance *instance);
49 /// Clean up bindings before an OpenXR instance is destroyed
50 void cleanupInstance();
51
52 // Accessors
53
54 /// Get the public object.
55 InteractionProfile *getPublic()
56 {
57 return _pub;
58 }
59
60 /// Get the vendor segment of the OpenXR interaction profile path.
61 const std::string &getVendor() const
62 {
63 return _vendor;
64 }
65
66 /// Get the type segment of the OpenXR interaction profile path.
67 const std::string &getType() const
68 {
69 return _type;
70 }
71
72 OpenXR::Path getPath() const;
73
74 private:
75
76 InteractionProfile *_pub;
77 osg::observer_ptr<XRState> _state;
78 std::string _vendor;
79 std::string _type;
80
81 struct Binding {
82 osg::ref_ptr<Action> action;
83 std::string binding;
84 };
85 std::list<Binding> _bindings;
86
87 bool _updated;
88 osg::ref_ptr<OpenXR::InteractionProfile> _profile;
89 };
90
91 } // osgXR
92
93 #endif