| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef OSGXR_SUBACTION |
| 5 |
#define OSGXR_SUBACTION 1 |
| 6 |
|
| 7 |
#include <osgXR/Subaction> |
| 8 |
|
| 9 |
#include "OpenXR/Path.h" |
| 10 |
|
| 11 |
#include <set> |
| 12 |
#include <string> |
| 13 |
|
| 14 |
namespace osgXR { |
| 15 |
|
| 16 |
class XRState; |
| 17 |
|
| 18 |
namespace OpenXR { |
| 19 |
class Instance; |
| 20 |
}; |
| 21 |
|
| 22 |
class Subaction::Private |
| 23 |
{ |
| 24 |
public: |
| 25 |
|
| 26 |
static std::shared_ptr<Private> get(Subaction *pub) |
| 27 |
{ |
| 28 |
if (pub) |
| 29 |
return pub->_private; |
| 30 |
else |
| 31 |
return nullptr; |
| 32 |
} |
| 33 |
|
| 34 |
Private(XRState *state, const std::string &path); |
| 35 |
|
| 36 |
|
| 37 |
void registerPublic(Subaction *subaction); |
| 38 |
void unregisterPublic(Subaction *subaction); |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
const std::string &getPathString() const |
| 44 |
{ |
| 45 |
return _pathString; |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
InteractionProfile *getCurrentProfile(); |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
void onInteractionProfileChanged(OpenXR::Session *session); |
| 55 |
|
| 56 |
|
| 57 |
const OpenXR::Path &setup(OpenXR::Instance *instance); |
| 58 |
|
| 59 |
void cleanupSession(); |
| 60 |
|
| 61 |
void cleanupInstance(); |
| 62 |
|
| 63 |
private: |
| 64 |
|
| 65 |
XRState *_state; |
| 66 |
std::string _pathString; |
| 67 |
std::set<Subaction *> _publics; |
| 68 |
|
| 69 |
OpenXR::Path _path; |
| 70 |
osg::ref_ptr<InteractionProfile> _currentProfile; |
| 71 |
}; |
| 72 |
|
| 73 |
} |
| 74 |
|
| 75 |
#endif |