QVR 4.1.0
A library to build Virtual Reality applications
Loading...
Searching...
No Matches
QVRManager Class Reference

Manager of the QVR application's control flow and its processes and windows. More...

#include <manager.hpp>

Inherits QObject.

Static Public Member Functions

Configuration access.

This is only guaranteed to work after a successfull call to init(). See isInitialized().

static QVRLogLevel logLevel ()
 Return the log level.
 
static const QVRConfigconfig ()
 Return the active configuration.
 
static int deviceCount ()
 Return the number of devices in the configuration.
 
static const QVRDeviceConfigdeviceConfig (int deviceIndex)
 Return the configuration of the device with index deviceIndex.
 
static int observerCount ()
 Return the number of observers in the configuration.
 
static const QVRObserverConfigobserverConfig (int observerIndex)
 Return the configuration of the observer with index observerIndex.
 
static int processCount ()
 Return the number of processes in the configuration.
 
static int processIndex ()
 Return the index of the running process. The process with index 0 is the main process.
 
static const QVRProcessConfigprocessConfig (int pi=processIndex())
 Return the configuration of the process with the index pi.
 
static int windowCount (int pi=processIndex())
 Return the number of windows in the configuration of the process with index pi.
 
static const QVRWindowConfigwindowConfig (int processIndex, int windowIndex)
 Return the configuration of the window with the index windowIndex on the process with index processIndex.
 
Object access
static const QVRDevicedevice (int deviceIndex)
 Return the device with index deviceIndex. See deviceCount().
 
static const QVRObserverobserver (int observerIndex)
 Return the observer with index observerIndex. See observerCount().
 
static const QVRProcessprocess ()
 Return the process. Only the running process is accessible in this way. See processIndex().
 
static const QVRWindowwindow (int windowIndex)
 Return the window with the given index in the running process.
 
Renderable device models

See the documentation of QVRDevice for information on how to use this model data to render representations of interaction devices into the virtual world.

The data returned by these functions does not change, so you can upload it once to the GPU and reuse it.

static int deviceModelVertexDataCount ()
 Return the number of vertex data blocks.
 
static int deviceModelVertexCount (int vertexDataIndex)
 Return the number of vertices in vertex data block vertexDataIndex.
 
static const float * deviceModelVertexPositions (int vertexDataIndex)
 Return the vertex positions in vertex data block vertexDataIndex. Each position consists of three values (x, y, z).
 
static const float * deviceModelVertexNormals (int vertexDataIndex)
 Return the vertex normals in vertex data block vertexDataIndex. Each normal consists of three values (nx, ny, nz).
 
static const float * deviceModelVertexTexCoords (int vertexDataIndex)
 Return the vertex texture coordinates in vertex data block vertexDataIndex. Each texture coordinate consists of two values (u, v).
 
static int deviceModelVertexIndexCount (int vertexDataIndex)
 Return the number of vertex indices in vertex data block vertexDataIndex.
 
static const unsigned short * deviceModelVertexIndices (int vertexDataIndex)
 Return the vertex indices in vertex data block vertexDataIndex.
 
static int deviceModelTextureCount ()
 Return the number of textures.
 
static const QImage & deviceModelTexture (int textureIndex)
 Return the texture textureIndex.
 

Friends

void QVRMsg (QVRLogLevel level, const char *s)
 

Constructor, Destructor, Initialization

 QVRManager (int &argc, char *argv[])
 This constructor creates the manager object.
 
 ~QVRManager ()
 Destructor.
 
bool init (QVRApp *app, bool preferCustomNavigation=false)
 Initialize the QVR application.
 
static QVRManagerinstance ()
 Return the QVR manager instance.
 
static bool isInitialized ()
 Returns whether the manager was successfully initialized.
 

Detailed Description

Manager of the QVR application's control flow and its processes and windows.

The QVRManager object is typically created right after the QApplication object. Afterwards, the application typically sets its preferred OpenGL context properties, and then initializes the QVRManager object:

QApplication app(argc, argv);
QVRManager manager(argc, argv);
// Set OpenGL context properties:
QSurfaceFormat format;
format.setProfile(QSurfaceFormat::CoreProfile);
format.setVersion(3, 3);
QSurfaceFormat::setDefaultFormat(format);
// Start the QVR application
MyQVRApp myqvrapp;
if (!manager.init(&myqvrapp))
return 1;
return app.exec();
Manager of the QVR application's control flow and its processes and windows.
Definition manager.hpp:256

Constructor & Destructor Documentation

◆ QVRManager()

QVRManager::QVRManager ( int & argc,
char * argv[] )

This constructor creates the manager object.

The following command line options are intereted by the QVR manager and removed from argc and argv:

  • --qvr-config=<config.qvr>
    Specify a QVR configuration file.
  • --qvr-timeout=<msecs>
    Set a timeout value in milliseconds for all interprocess communication. The default is -1, which means to never timeout.
  • --qvr-log-level=<level>
    See QVRLogLevel.
  • --qvr-log-file=<filename>
    Write all log messages to the given file instead of the standard error stream.
  • --qvr-sync-to-vblank=<0|1>
    Disable (0) or enable (1) sync-to-vblank. This overrides the per-process setting in the configuration file.
  • --qvr-fps=<n>
    Make QVR report frames per second measurements every n milliseconds.
  • --qvr-autodetect=<list>
    Comma-separated list of VR hardware that QVR should attempt to detect automatically. Currently supported keywords are 'all' for all hardware, 'oculus' for Oculus Rift, 'openvr' for OpenVR hardware, 'googlevr' for Google VR hardware, 'gamepads' for gamepads. Each entry can be preceded with '~' to negate it. For example, use '--qvr-autodetect=all,~oculus' to try autodetection for all hardware except Oculus Rift. This option only takes effect if no --qvr-config option was given.

◆ ~QVRManager()

QVRManager::~QVRManager ( )

Destructor.

Member Function Documentation

◆ config()

static const QVRConfig & QVRManager::config ( )
static

Return the active configuration.

◆ device()

static const QVRDevice & QVRManager::device ( int deviceIndex)
static

Return the device with index deviceIndex. See deviceCount().

◆ deviceConfig()

static const QVRDeviceConfig & QVRManager::deviceConfig ( int deviceIndex)
inlinestatic

Return the configuration of the device with index deviceIndex.

This is a convenience function, you can also get this information from config().

◆ deviceCount()

static int QVRManager::deviceCount ( )
inlinestatic

Return the number of devices in the configuration.

This is a convenience function, you can also get this information from config().

◆ deviceModelTexture()

static const QImage & QVRManager::deviceModelTexture ( int textureIndex)
static

Return the texture textureIndex.

◆ deviceModelTextureCount()

static int QVRManager::deviceModelTextureCount ( )
static

Return the number of textures.

◆ deviceModelVertexCount()

static int QVRManager::deviceModelVertexCount ( int vertexDataIndex)
static

Return the number of vertices in vertex data block vertexDataIndex.

◆ deviceModelVertexDataCount()

static int QVRManager::deviceModelVertexDataCount ( )
static

Return the number of vertex data blocks.

◆ deviceModelVertexIndexCount()

static int QVRManager::deviceModelVertexIndexCount ( int vertexDataIndex)
static

Return the number of vertex indices in vertex data block vertexDataIndex.

◆ deviceModelVertexIndices()

static const unsigned short * QVRManager::deviceModelVertexIndices ( int vertexDataIndex)
static

Return the vertex indices in vertex data block vertexDataIndex.

◆ deviceModelVertexNormals()

static const float * QVRManager::deviceModelVertexNormals ( int vertexDataIndex)
static

Return the vertex normals in vertex data block vertexDataIndex. Each normal consists of three values (nx, ny, nz).

◆ deviceModelVertexPositions()

static const float * QVRManager::deviceModelVertexPositions ( int vertexDataIndex)
static

Return the vertex positions in vertex data block vertexDataIndex. Each position consists of three values (x, y, z).

◆ deviceModelVertexTexCoords()

static const float * QVRManager::deviceModelVertexTexCoords ( int vertexDataIndex)
static

Return the vertex texture coordinates in vertex data block vertexDataIndex. Each texture coordinate consists of two values (u, v).

◆ init()

bool QVRManager::init ( QVRApp * app,
bool preferCustomNavigation = false )

Initialize the QVR application.

Parameters
appThe QVR application.
preferCustomNavigationWhether the application prefers its own navigation methods.
Returns
False on failure.

This function will create all child processes and all windows, depending on the QVR configuration, and it will call the initialization functions of app.

Applications that implement their own navigation methods in QVRApp::update() should set the preferCustomNavigation flag.

◆ instance()

static QVRManager * QVRManager::instance ( )
static

Return the QVR manager instance.

There can be only one instance of QVRManager. This function returns it.

◆ isInitialized()

static bool QVRManager::isInitialized ( )
static

Returns whether the manager was successfully initialized.

◆ logLevel()

static QVRLogLevel QVRManager::logLevel ( )
static

Return the log level.

◆ observer()

static const QVRObserver & QVRManager::observer ( int observerIndex)
static

Return the observer with index observerIndex. See observerCount().

◆ observerConfig()

static const QVRObserverConfig & QVRManager::observerConfig ( int observerIndex)
inlinestatic

Return the configuration of the observer with index observerIndex.

This is a convenience function, you can also get this information from config().

◆ observerCount()

static int QVRManager::observerCount ( )
inlinestatic

Return the number of observers in the configuration.

This is a convenience function, you can also get this information from config().

◆ process()

static const QVRProcess & QVRManager::process ( )
static

Return the process. Only the running process is accessible in this way. See processIndex().

◆ processConfig()

static const QVRProcessConfig & QVRManager::processConfig ( int pi = processIndex())
inlinestatic

Return the configuration of the process with the index pi.

This is a convenience function, you can also get this information from config().

◆ processCount()

static int QVRManager::processCount ( )
inlinestatic

Return the number of processes in the configuration.

This is a convenience function, you can also get this information from config().

◆ processIndex()

static int QVRManager::processIndex ( )
static

Return the index of the running process. The process with index 0 is the main process.

◆ window()

static const QVRWindow & QVRManager::window ( int windowIndex)
static

Return the window with the given index in the running process.

◆ windowConfig()

static const QVRWindowConfig & QVRManager::windowConfig ( int processIndex,
int windowIndex )
inlinestatic

Return the configuration of the window with the index windowIndex on the process with index processIndex.

This is a convenience function, you can also get this information from config().

◆ windowCount()

static int QVRManager::windowCount ( int pi = processIndex())
inlinestatic

Return the number of windows in the configuration of the process with index pi.

This is a convenience function, you can also get this information from config().

Friends And Related Symbol Documentation

◆ QVRMsg

void QVRMsg ( QVRLogLevel level,
const char * s )
friend

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