| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef OSGXR_ACTION |
| 5 |
#define OSGXR_ACTION 1 |
| 6 |
|
| 7 |
#include <osgXR/Action> |
| 8 |
|
| 9 |
#include "Subaction.h" |
| 10 |
|
| 11 |
#include <osg/ref_ptr> |
| 12 |
|
| 13 |
#include <memory> |
| 14 |
#include <set> |
| 15 |
#include <string> |
| 16 |
|
| 17 |
namespace osgXR { |
| 18 |
|
| 19 |
namespace OpenXR { |
| 20 |
class Action; |
| 21 |
class Instance; |
| 22 |
}; |
| 23 |
|
| 24 |
class Action::Private |
| 25 |
{ |
| 26 |
public: |
| 27 |
|
| 28 |
static Private *get(Action *pub) |
| 29 |
{ |
| 30 |
return pub->_private.get(); |
| 31 |
} |
| 32 |
|
| 33 |
Private(ActionSet *actionSet); |
| 34 |
virtual ~Private(); |
| 35 |
|
| 36 |
void setName(const std::string &name); |
| 37 |
const std::string &getName() const; |
| 38 |
|
| 39 |
void setLocalizedName(const std::string &localizedName); |
| 40 |
const std::string &getLocalizedName() const; |
| 41 |
|
| 42 |
void addSubaction(std::shared_ptr<Subaction::Private> subaction); |
| 43 |
|
| 44 |
bool getUpdated() const |
| 45 |
{ |
| 46 |
return _updated; |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
virtual OpenXR::Action *setup(OpenXR::Instance *instance) = 0; |
| 51 |
|
| 52 |
virtual void cleanupSession() = 0; |
| 53 |
|
| 54 |
void cleanupInstance(); |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
void getBoundSources(std::vector<std::string> &sourcePaths) const; |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
void getBoundSourcesLocalizedNames(XrInputSourceLocalizedNameFlags whichComponents, |
| 68 |
std::vector<std::string> &names) const; |
| 69 |
|
| 70 |
protected: |
| 71 |
|
| 72 |
std::string _name; |
| 73 |
std::string _localizedName; |
| 74 |
|
| 75 |
osg::ref_ptr<ActionSet> _actionSet; |
| 76 |
std::set<std::shared_ptr<Subaction::Private>> _subactions; |
| 77 |
|
| 78 |
bool _updated; |
| 79 |
osg::ref_ptr<OpenXR::Action> _action; |
| 80 |
}; |
| 81 |
|
| 82 |
} |
| 83 |
|
| 84 |
#endif |