51 #ifndef vtkOpenVRRenderWindow_h
52 #define vtkOpenVRRenderWindow_h
55 #include "vtkRenderingOpenVRModule.h"
85 vr::IVRSystem*
GetHMD() {
return this->HMD; }
121 width = this->Size[0];
131 return this->GetTrackedDeviceModel(idx, 0);
135 return this->TrackedDeviceToRenderModel[idx];
149 return this->GetTrackedDeviceIndexForDevice(dev, 0);
159 return this->GetTrackedDevicePose(idx, 0, pose);
164 return this->TrackedDevicePose[idx];
188 vtkGetVector3Macro(PhysicalViewDirection,
double);
202 vtkGetVector3Macro(PhysicalViewUp,
double);
216 vtkGetVector3Macro(PhysicalTranslation,
double);
230 vtkGetMacro(PhysicalScale,
double);
250 vtkSetMacro(TrackHMD,
bool);
251 vtkGetMacro(TrackHMD,
bool);
419 vr::TrackedDeviceProperty prop, vr::TrackedPropertyError* peError =
nullptr);
427 vr::TrackedDevicePose_t TrackedDevicePose[vr::k_unMaxTrackedDeviceCount];
432 double PhysicalViewDirection[3];
434 double PhysicalViewUp[3];
436 double PhysicalTranslation[3];
a virtual camera for 3D rendering
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
GLuint GetRightResolveBufferId()
void SetSize(int width, int height) override
Set the size of the window in screen coordinates 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...
vtkOpenGLRenderWindow * HelperWindow
virtual void SetPhysicalScale(double)
Set/get physical coordinate system in world coordinate system.
std::vector< vtkOpenVRModel * > VTKRenderModels
vr::IVRRenderModels * GetOpenVRRenderModels()
Get the openVR Render Models.
virtual bool IsCurrent()
Tells if this window is the current OpenGL context for the calling thread.
virtual void SetPhysicalTranslation(double, double, double)
Set/get physical coordinate system in world coordinate system.
void SetPhysicalToWorldMatrix(vtkMatrix4x4 *matrix)
Set physical to world transform matrix.
void SetHelperWindow(vtkOpenGLRenderWindow *val)
virtual void SetPhysicalViewUp(double, double, double)
Set/get physical coordinate system in world coordinate system.
void SetDashboardOverlay(vtkOpenVROverlay *)
vr::TrackedDeviceIndex_t GetTrackedDeviceIndexForDevice(vtkEventDataDevice dev)
Get the index corresponding to the tracked device.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void DestroyWindow()
Destroy a not-off-screen window.
bool CreateFrameBuffer(int nWidth, int nHeight, FramebufferDesc &framebufferDesc)
void GetTrackedDevicePose(vtkEventDataDevice idx, uint32_t index, vr::TrackedDevicePose_t **pose)
virtual void StereoUpdate()
Update the system, if needed, due to stereo rendering.
vr::TrackedDevicePose_t & GetTrackedDevicePose(vr::TrackedDeviceIndex_t idx)
double PhysicalScale
Scale of the Physical to World matrix.
void SetParentInfo(const char *)
virtual void CreateAWindow()
Create a not-off-screen window.
virtual void Finalize(void)
Finalize 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...
void Render()
Overridden to not release resources that would interfere with an external application's rendering.
void UpdateHMDMatrixPose()
Update the HMD pose based on hardware pose and physical to world transform.
void GetPhysicalToWorldMatrix(vtkMatrix4x4 *matrix)
Get physical to world transform matrix.
virtual void SetPhysicalViewUp(double[3])
virtual void StereoRenderComplete()
Handles work required once both views have been rendered when using stereo rendering.
vr::TrackedDeviceIndex_t GetTrackedDeviceIndexForDevice(vtkEventDataDevice dev, uint32_t index)
vtkOpenVRModel * GetTrackedDeviceModel(vtkEventDataDevice idx, uint32_t index)
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
void GetTrackedDevicePose(vtkEventDataDevice idx, vr::TrackedDevicePose_t **pose)
Get the most recent pose corresponding to the tracked device.
virtual void Start(void)
Begin the rendering process.
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
~vtkOpenVRRenderWindow() override
virtual void SetDisplayId(void *)
Dummy stubs for vtkWindow API.
FramebufferDesc RightEyeDesc
static vtkOpenVRRenderWindow * New()
virtual void StereoMidpoint()
Intermediate method performs operations required between the rendering of the left and right eye.
virtual void SetPhysicalTranslation(double[3])
virtual void WindowRemap(void)
Remap the rendering window.
uint32_t GetNumberOfTrackedDevicesForDevice(vtkEventDataDevice dev)
void SetNextWindowInfo(const char *)
virtual void * GetGenericParentId()
void ReleaseGraphicsResources(vtkWindow *) override
Free up any graphics resources associated with this window a value of nullptr means the context may a...
void SetWindowInfo(const char *)
GLuint GetLeftResolveBufferId()
Get the frame buffers used for rendering.
void RenderOverlay()
Draw the overlay.
vtkTypeBool IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.
virtual void SetNextWindowId(void *)
virtual void * GetGenericDrawable()
virtual void * GetGenericContext()
void SetSize(int a[2]) override
virtual void Initialize(void)
Initialize the rendering window.
vtkRenderWindowInteractor * MakeRenderWindowInteractor() override
Create an interactor to control renderers in this window.
vtkTransform * HMDTransform
virtual void SetPhysicalViewDirection(double[3])
void MakeCurrent()
Make this windows OpenGL context the current context.
vtkOpenVRModel * GetTrackedDeviceModel(vtkEventDataDevice idx)
Get the VRModel corresponding to the tracked device.
vtkOpenVRModel * GetTrackedDeviceModel(vr::TrackedDeviceIndex_t idx)
virtual void * GetGenericDisplayId()
const char * ReportCapabilities()
Get report of capabilities for the render window.
virtual void SetPhysicalViewDirection(double, double, double)
Set/get physical coordinate system in world coordinate system.
std::string GetTrackedDeviceString(vr::IVRSystem *pHmd, vr::TrackedDeviceIndex_t unDevice, vr::TrackedDeviceProperty prop, vr::TrackedPropertyError *peError=nullptr)
virtual vtkTypeBool GetEventPending()
Check to see if a mouse button has been pressed or mouse wheel activated.
vr::IVRSystem * GetHMD()
Get the system pointer.
vtkOpenVRModel * FindOrLoadRenderModel(const char *modelName)
virtual void AddRenderer(vtkRenderer *) override
Add a renderer to the list of renderers.
virtual void * GetGenericWindowId()
void SetPosition(int x, int y) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
void GetRenderBufferSize(int &width, int &height)
void SetPosition(int a[2]) override
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
vtkOpenVROverlay * DashboardOverlay
vtkOpenGLState * GetState() override
FramebufferDesc LeftEyeDesc
vr::IVRRenderModels * OpenVRRenderModels
platform-independent render window interaction including picking and frame rate control.
abstract specification for renderers
window superclass for vtkRenderWindow
GLuint m_nResolveTextureId
GLuint m_nResolveFramebufferId
vtkEventDataDevice
platform-independent event data structures