evan 2026.1.4
Evan
Loading...
Searching...
No Matches
evan::InteractionProfile Class Reference

A utility class for managing OpenXR interaction profiles, including retrieving runtime and system information, converting between strings and paths, and enumerating bound sources for actions. More...

#include <headers/evan/openxr/InteractionProfile.hpp>

Inheritance diagram for evan::InteractionProfile:
Collaboration diagram for evan::InteractionProfile:

Public Member Functions

 InteractionProfile ()
 Deleted default constructor to prevent instantiation of this utility class.
 

Static Public Member Functions

static std::string getRuntimeName (XrInstance instance)
 Retrieves the name of the OpenXR runtime in use.
 
static std::string getSystemName (XrInstance instance, XrSystemId systemId)
 Retrieves the name of the OpenXR system.
 
static XrPath stringToPath (XrInstance instance, const std::string &pathString)
 Converts a string to an OpenXR path.
 
static std::string pathToString (XrInstance instance, XrPath path)
 Converts an OpenXR path to a string.
 
static std::string getCurrentInteractionProfilePath (XrInstance instance, XrSession session, const std::string &userPathString)
 Retrieves the current interaction profile path for a given user path.
 
static std::vector< XrPath > enumerateBoundSourcesForAction (XrInstance instance, XrSession session, XrAction action)
 Enumerates the bound source paths for a given action.
 
static std::vector< std::string > enumerateBoundSourcePathStringsForAction (XrInstance instance, XrSession session, XrAction action)
 Enumerates the bound source path strings for a given action.
 
static const std::vector< std::string > & getDefaultProfileCandidates ()
 Retrieves the default interaction profile candidates.
 
static std::string getPreferredInteractionProfilePath (XrInstance instance, const std::vector< std::string > &candidateProfiles, const std::string &fallbackProfile)
 Selects the preferred interaction profile path.
 

Detailed Description

A utility class for managing OpenXR interaction profiles, including retrieving runtime and system information, converting between strings and paths, and enumerating bound sources for actions.

Definition at line 27 of file InteractionProfile.hpp.

Constructor & Destructor Documentation

◆ InteractionProfile()

evan::InteractionProfile::InteractionProfile ( )

Deleted default constructor to prevent instantiation of this utility class.

Definition at line 14 of file InteractionProfile.cpp.

Member Function Documentation

◆ enumerateBoundSourcePathStringsForAction()

std::vector< std::string > evan::InteractionProfile::enumerateBoundSourcePathStringsForAction ( XrInstance  instance,
XrSession  session,
XrAction  action 
)
static

Enumerates the bound source path strings for a given action.

Parameters
instanceThe OpenXR instance handle.
sessionThe OpenXR session handle.
actionThe OpenXR action handle.
Returns
A vector of strings representing the bound source paths for the action.

Definition at line 139 of file InteractionProfile.cpp.

◆ enumerateBoundSourcesForAction()

std::vector< XrPath > evan::InteractionProfile::enumerateBoundSourcesForAction ( XrInstance  instance,
XrSession  session,
XrAction  action 
)
static

Enumerates the bound source paths for a given action.

Parameters
instanceThe OpenXR instance handle.
sessionThe OpenXR session handle.
actionThe OpenXR action handle.
Returns
A vector of OpenXR paths representing the bound sources for the action.

Definition at line 107 of file InteractionProfile.cpp.

◆ getCurrentInteractionProfilePath()

std::string evan::InteractionProfile::getCurrentInteractionProfilePath ( XrInstance  instance,
XrSession  session,
const std::string &  userPathString 
)
static

Retrieves the current interaction profile path for a given user path.

Parameters
instanceThe OpenXR instance handle.
sessionThe OpenXR session handle.
userPathStringThe string representation of the user path (e.g., "/user/hand/left").
Returns
The string representation of the current interaction profile path, or an empty string on failure.

Definition at line 83 of file InteractionProfile.cpp.

◆ getDefaultProfileCandidates()

const std::vector< std::string > & evan::InteractionProfile::getDefaultProfileCandidates ( )
static

Retrieves the default interaction profile candidates.

Profiles are listed in preference order. The first candidate reported as supported by the active runtime should be used to suggest action bindings.

Returns
A const reference to the default candidate profile list.

Definition at line 154 of file InteractionProfile.cpp.

◆ getPreferredInteractionProfilePath()

std::string evan::InteractionProfile::getPreferredInteractionProfilePath ( XrInstance  instance,
const std::vector< std::string > &  candidateProfiles,
const std::string &  fallbackProfile 
)
static

Selects the preferred interaction profile path.

Returns the first candidate profile supported by the runtime. If no candidate is supported (or the instance is null), the fallback profile is returned.

Parameters
instanceThe OpenXR instance handle.
candidateProfilesThe candidate profile paths to try, in preference order.
fallbackProfileThe profile path to return when no candidate is supported.
Returns
The preferred interaction profile path.

Definition at line 166 of file InteractionProfile.cpp.

◆ getRuntimeName()

std::string evan::InteractionProfile::getRuntimeName ( XrInstance  instance)
static

Retrieves the name of the OpenXR runtime in use.

Parameters
instanceThe OpenXR instance handle.
Returns
The name of the OpenXR runtime, or an empty string on failure.

Definition at line 20 of file InteractionProfile.cpp.

◆ getSystemName()

std::string evan::InteractionProfile::getSystemName ( XrInstance  instance,
XrSystemId  systemId 
)
static

Retrieves the name of the OpenXR system.

Parameters
instanceThe OpenXR instance handle.
systemIdThe OpenXR system ID.
Returns
The name of the OpenXR system, or an empty string on failure.

Definition at line 31 of file InteractionProfile.cpp.

◆ pathToString()

std::string evan::InteractionProfile::pathToString ( XrInstance  instance,
XrPath  path 
)
static

Converts an OpenXR path to a string.

Parameters
instanceThe OpenXR instance handle.
pathThe OpenXR path to convert.
Returns
The string representation of the OpenXR path, or an empty string on failure.

Definition at line 56 of file InteractionProfile.cpp.

◆ stringToPath()

XrPath evan::InteractionProfile::stringToPath ( XrInstance  instance,
const std::string &  pathString 
)
static

Converts a string to an OpenXR path.

Parameters
instanceThe OpenXR instance handle.
pathStringThe string representation of the path.
Returns
The corresponding OpenXR path, or XR_NULL_PATH on failure.

Definition at line 44 of file InteractionProfile.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: