VTK
vtkOpenVRRenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenVRRenderWindowInteractor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkOpenVRRenderWindowInteractor_h
27 #define vtkOpenVRRenderWindowInteractor_h
28 
29 #include "vtkRenderingOpenVRModule.h" // For export macro
31 
32 #include "vtkOpenVRRenderWindow.h" // ivars
33 #include "vtkNew.h" // ivars
34 #include "vtkTransform.h" // ivars
35 
36 class VTKRENDERINGOPENVR_EXPORT vtkOpenVRRenderWindowInteractor : public vtkRenderWindowInteractor3D
37 {
38 public:
43 
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
50  virtual void Initialize();
51 
57  void TerminateApp(void);
58 
60 
66  static void SetClassExitMethod(void (*f)(void *), void *arg);
67  static void SetClassExitMethodArgDelete(void (*f)(void *));
69 
74  virtual void ExitCallback();
75 
77 
81  virtual void SetPhysicalTranslation(vtkCamera *, double, double, double);
82  virtual double *GetPhysicalTranslation(vtkCamera *);
84 
85  virtual void DoOneEvent(vtkOpenVRRenderWindow *renWin, vtkRenderer *ren);
86 
87 protected:
90 
91  void UpdateTouchPadPosition(vr::IVRSystem *pHMD,
92  vr::TrackedDeviceIndex_t tdi);
93 
95 
100  static void (*ClassExitMethod)(void *);
101  static void (*ClassExitMethodArgDelete)(void *);
102  static void *ClassExitMethodArg;
104 
106 
110  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
111  virtual int InternalDestroyTimer(int platformTimerId);
113 
119  virtual void StartEventLoop();
120 
121 
123 
124  // converts a device pose to a world coordinate
125  // position and orientation
126  void ConvertPoseToWorldCoordinates(
127  vtkRenderer *ren,
128  vr::TrackedDevicePose_t &tdPose,
129  double pos[3],
130  double wxyz[4]);
131 
132 private:
134  void operator=(const vtkOpenVRRenderWindowInteractor&); // Not implemented.
135 };
136 
137 #endif
vtkRenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkOpenVRRenderWindow.h
vtkRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
Definition: vtkRenderWindowInteractor.h:891
vtkRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkRenderWindowInteractor3D
adds support for 3D events to vtkRenderWindowInteractor.
Definition: vtkRenderWindowInteractor3D.h:37
vtkOpenVRRenderWindowInteractor::PoseTransform
vtkNew< vtkTransform > PoseTransform
Definition: vtkOpenVRRenderWindowInteractor.h:122
vtkRenderWindowInteractor3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkOpenVRRenderWindow
OpenVR rendering window.
Definition: vtkOpenVRRenderWindow.h:59
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
vtkNew< vtkTransform >
vtkRenderWindowInteractor3D.h
vtkRenderWindowInteractor3D::SetPhysicalTranslation
virtual void SetPhysicalTranslation(vtkCamera *, double, double, double)
Set/Get the optional translation to map world coordinates into the 3D physical space (meters,...
Definition: vtkRenderWindowInteractor3D.h:239
vtkRenderWindowInteractor::ExitCallback
virtual void ExitCallback()
These methods correspond to the the Exit, User and Pick callbacks.
vtkNew.h
vtkRenderWindowInteractor3D::GetPhysicalTranslation
virtual double * GetPhysicalTranslation(vtkCamera *)
Definition: vtkRenderWindowInteractor3D.h:240
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkRenderWindowInteractor::Initialize
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
vtkOpenVRRenderWindowInteractor
implements OpenVR specific functions required by vtkRenderWindowInteractor.
Definition: vtkOpenVRRenderWindowInteractor.h:36
vtkTransform.h
vtkRenderWindowInteractor3D::TerminateApp
void TerminateApp(void)
OpenVR specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to termina...
vtkOpenVRRenderWindowInteractor::ClassExitMethodArg
static void * ClassExitMethodArg
Definition: vtkOpenVRRenderWindowInteractor.h:102
vtkRenderWindowInteractor3D::New
static vtkRenderWindowInteractor3D * New()
Construct object so that light follows camera motion.