Go to the documentation of this file.
54 #ifndef vtkOpenVRRenderWindow_h
55 #define vtkOpenVRRenderWindow_h
57 #include "vtkRenderingOpenVRModule.h"
88 vr::IVRSystem *
GetHMD() {
return this->HMD; };
115 {
return this->LeftEyeDesc.m_nRenderFramebufferId; };
117 {
return this->LeftEyeDesc.m_nResolveFramebufferId; };
119 {
return this->RightEyeDesc.m_nRenderFramebufferId; };
121 {
return this->RightEyeDesc.m_nResolveFramebufferId; };
124 width = this->Size[0];
134 return this->TrackedDeviceToRenderModel[idx]; };
140 return this->OpenVRRenderModels; };
152 return this->TrackedDevicePose[idx]; };
175 vtkGetVector3Macro(PhysicalViewDirection,
double);
189 vtkGetVector3Macro(PhysicalViewUp,
double);
203 vtkGetVector3Macro(PhysicalTranslation,
double);
217 vtkGetMacro(PhysicalScale,
double);
237 vtkSetMacro(TrackHMD,
bool);
238 vtkGetMacro(TrackHMD,
bool);
410 vr::TrackedDeviceIndex_t unDevice,
411 vr::TrackedDeviceProperty prop,
412 vr::TrackedPropertyError *peError =
nullptr );
420 vr::TrackedDevicePose_t TrackedDevicePose[ vr::k_unMaxTrackedDeviceCount ];
425 double PhysicalViewDirection[3];
427 double PhysicalViewUp[3];
429 double PhysicalTranslation[3];
virtual void Finalize(void)
Finalize the rendering window.
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
virtual void SetPhysicalViewUp(double, double, double)
Set/get physical coordinate system in world coordinate system.
void GetRenderBufferSize(int &width, int &height)
virtual void StereoRenderComplete()
Handles work required once both views have been rendered when using stereo rendering.
void SetSize(int a[2]) override
Set the size of the window in screen coordinates in pixels.
virtual void DestroyWindow()
Destroy a not-off-screen window.
virtual void StereoUpdate()
Update the system, if needed, due to stereo rendering.
GLuint GetLeftResolveBufferId()
vtkOpenGLRenderWindow * HelperWindow
void SetParentInfo(const char *)
vr::IVRRenderModels * GetOpenVRRenderModels()
Get the openVR Render Models.
virtual void Initialize(void)
Initialize the rendering window.
vtkOpenVRModel * GetTrackedDeviceModel(vr::TrackedDeviceIndex_t idx)
void SetNextWindowInfo(const char *)
void MakeCurrent()
Make this windows OpenGL context the current context.
void GetTrackedDevicePose(vtkEventDataDevice idx, vr::TrackedDevicePose_t **pose)
Get the most recent pose corresponding to the tracked device.
virtual void * GetGenericParentId()
GLuint m_nRenderFramebufferId
virtual void SetPhysicalViewUp(double[3])
void GetPhysicalToWorldMatrix(vtkMatrix4x4 *matrix)
Get physical to world transform matrix.
const char * ReportCapabilities()
Get report of capabilities for the render window.
virtual bool IsCurrent()
Tells if this window is the current OpenGL context for the calling thread.
vtkTransform * HMDTransform
virtual void SetPhysicalScale(double)
Set/get physical coordinate system in world coordinate system.
vr::TrackedDeviceIndex_t GetTrackedDeviceIndexForDevice(vtkEventDataDevice dev)
Get the index corresponding to the tracked device.
virtual void ReleaseGraphicsResources(vtkRenderWindow *)
Free up any graphics resources associated with this window a value of nullptr means the context may a...
void SetPhysicalToWorldMatrix(vtkMatrix4x4 *matrix)
Set physical to world transform matrix.
GLuint m_nRenderTextureId
void Frame(void)
End the rendering process and display the image.
std::vector< vtkOpenVRModel * > VTKRenderModels
virtual void SetPosition(int, int)
Set the position of the window.
virtual void SetPhysicalTranslation(double[3])
virtual void Start(void)
Begin the rendering process.
void SetDashboardOverlay(vtkOpenVROverlay *)
bool CreateFrameBuffer(int nWidth, int nHeight, FramebufferDesc &framebufferDesc)
void RenderOverlay()
Draw the overlay.
void SetWindowInfo(const char *)
std::string GetTrackedDeviceString(vr::IVRSystem *pHmd, vr::TrackedDeviceIndex_t unDevice, vr::TrackedDeviceProperty prop, vr::TrackedPropertyError *peError=nullptr)
vr::TrackedDevicePose_t & GetTrackedDevicePose(vr::TrackedDeviceIndex_t idx)
virtual void SetSize(int a[2])
Set the size of the window in screen coordinates in pixels.
FramebufferDesc LeftEyeDesc
virtual void * GetGenericDrawable()
GLuint GetRightRenderBufferId()
GLuint GetLeftRenderBufferId()
Get the frame buffers used for rendering.
void Render()
Overridden to not release resources that would interfere with an external application's rendering.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetDisplayId(void *)
Dummy stubs for vtkWindow API.
virtual void * GetGenericContext()
virtual void SetPhysicalTranslation(double, double, double)
Set/get physical coordinate system in world coordinate system.
int IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.
GLuint GetRightResolveBufferId()
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
virtual void * GetGenericDisplayId()
a virtual camera for 3D rendering
virtual void SetPosition(int a[2])
void SetHelperWindow(vtkOpenGLRenderWindow *val)
virtual void * GetGenericWindowId()
double PhysicalScale
Scale of the Physical to World matrix.
vr::IVRSystem * GetHMD()
Get the system pointer.
vtkOpenVRModel * FindOrLoadRenderModel(const char *modelName)
virtual void SetNextWindowId(void *)
vr::IVRRenderModels * OpenVRRenderModels
vtkEventDataDevice
platform-independent event data structures
vtkOpenVROverlay * DashboardOverlay
virtual void CreateAWindow()
Create a not-off-screen window.
virtual void StereoMidpoint()
Intermediate method performs operations required between the rendering of the left and right eye.
virtual int GetEventPending()
Check to see if a mouse button has been pressed or mouse wheel activated.
virtual void AddRenderer(vtkRenderer *) override
Add a renderer to the list of renderers.
static vtkOpenVRRenderWindow * New()
abstract specification for renderers
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
virtual void WindowRemap(void)
Remap the rendering window.
void InitializeViewFromCamera(vtkCamera *cam)
Initialize the HMD to World setting and camera settings so that the VR world view most closely matche...
virtual void SetPhysicalViewDirection(double[3])
void UpdateHMDMatrixPose()
Update the HMD pose based on hardware pose and physical to world transform.
create a window for renderers to draw into
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
vtkOpenGLState * GetState() override
virtual void SetPosition(int, int)
virtual void SetSize(int, int)
Set the size of the window in pixels.
void HideCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
vtkOpenVRModel * GetTrackedDeviceModel(vtkEventDataDevice idx)
Get the VRModel corresponding to the tracked device.
GLuint m_nResolveTextureId
FramebufferDesc RightEyeDesc
virtual void SetPhysicalViewDirection(double, double, double)
Set/get physical coordinate system in world coordinate system.
GLuint m_nResolveFramebufferId