iMSTK
Interactive Medical Simulation Toolkit
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
vtkOpenVRRenderWindowInteractorImstk Class Reference
Inheritance diagram for vtkOpenVRRenderWindowInteractorImstk:
Inheritance graph
[legend]
Collaboration diagram for vtkOpenVRRenderWindowInteractorImstk:
Collaboration graph
[legend]

Classes

class  ActionData
 
struct  TrackerActions
 

Public Member Functions

 vtkTypeMacro (vtkOpenVRRenderWindowInteractorImstk, vtkRenderWindowInteractor3D)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void Initialize ()
 
virtual void ExitCallback ()
 
void ProcessEvents () override
 
virtual void DoOneEvent (vtkOpenVRRenderWindow *renWin, vtkRenderer *ren, bool doRender)
 
vtkEventDataDevice GetPointerDevice ()
 
void ConvertOpenVRPoseToMatrices (const vr::TrackedDevicePose_t &tdPose, vtkMatrix4x4 *poseMatrixWorld, vtkMatrix4x4 *poseMatrixPhysical=nullptr)
 
void ConvertPoseToWorldCoordinates (const vr::TrackedDevicePose_t &tdPose, double pos[3], double wxyz[4], double ppos[3], double wdir[3])
 
void ConvertPoseMatrixToWorldCoordinates (const float poseMatrix[3][4], double pos[3], double wxyz[4], double ppos[3], double wdir[3])
 
void GetStartingPhysicalToWorldMatrix (vtkMatrix4x4 *startingPhysicalToWorldMatrix)
 
virtual void SetPhysicalTranslation (vtkCamera *, double, double, double)
 
virtual double * GetPhysicalTranslation (vtkCamera *)
 
virtual void SetPhysicalScale (double)
 
virtual double GetPhysicalScale ()
 
void AddAction (std::string path, vtkCommand::EventIds, bool isAnalog)
 
void AddAction (std::string path, bool isAnalog, std::function< void(vtkEventData *)>)
 
 vtkGetMacro (ActionManifestFileName, std::string)
 
 vtkSetMacro (ActionManifestFileName, std::string)
 
 vtkGetMacro (ActionSetName, std::string)
 
 vtkSetMacro (ActionSetName, std::string)
 

Static Public Member Functions

static vtkOpenVRRenderWindowInteractorImstkNew ()
 
static void SetClassExitMethod (void(*f)(void *), void *arg)
 
static void SetClassExitMethodArgDelete (void(*f)(void *))
 

Protected Types

enum  TrackerEnum { LeftHand = 0, RightHand, Head, NumberOfTrackers }
 

Protected Member Functions

virtual void StartEventLoop ()
 
virtual void RecognizeComplexGesture (vtkEventDataDevice3D *edata)
 
void HandleGripEvents (vtkEventData *ed)
 
virtual int InternalCreateTimer (int timerId, int timerType, unsigned long duration)
 
virtual int InternalDestroyTimer (int platformTimerId)
 

Protected Attributes

int DeviceInputDownCount [vtkEventDataNumberOfDevices]
 
vtkNew< vtkMatrix4x4 > StartingPhysicalToWorldMatrix
 
std::map< std::string, ActionDataActionMap
 
std::string ActionManifestFileName
 
std::string ActionSetName
 
vr::VRActionSetHandle_t ActionsetVTK = vr::k_ulInvalidActionSetHandle
 
TrackerActions Trackers [NumberOfTrackers]
 

Static Protected Attributes

static void(* ClassExitMethod )(void *) = (void (*)(void*))nullptr
 
static void(* ClassExitMethodArgDelete )(void *) = (void (*)(void*))nullptr
 
static void * ClassExitMethodArg = (void*)nullptr
 

Detailed Description

Definition at line 25 of file imstkVtkOpenVRRenderWindowInteractorImstk.h.

Member Function Documentation

◆ AddAction()

void vtkOpenVRRenderWindowInteractorImstk::AddAction ( std::string  path,
vtkCommand::EventIds  eid,
bool  isAnalog 
)

Assign an event or std::function to an event path

Definition at line 738 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

Here is the caller graph for this function:

◆ DoOneEvent()

void vtkOpenVRRenderWindowInteractorImstk::DoOneEvent ( vtkOpenVRRenderWindow *  renWin,
vtkRenderer *  ren,
bool  doRender 
)
virtual

Process OpenVR events such as updating poses

Parameters
renderwindow
renderer
Whetheror not to perform a render after processing VR events

Definition at line 272 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

Here is the caller graph for this function:

◆ ExitCallback()

void vtkOpenVRRenderWindowInteractorImstk::ExitCallback ( )
virtual

These methods correspond to the Exit, User and Pick callbacks. They allow for the Style to invoke them.

Definition at line 883 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

◆ GetStartingPhysicalToWorldMatrix()

void vtkOpenVRRenderWindowInteractorImstk::GetStartingPhysicalToWorldMatrix ( vtkMatrix4x4 *  startingPhysicalToWorldMatrix)

Get the latest touchpad or joystick position for a device

Definition at line 915 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

◆ Initialize()

void vtkOpenVRRenderWindowInteractorImstk::Initialize ( )
virtual

Initialize the event handler

Definition at line 769 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

Here is the call graph for this function:

◆ InternalCreateTimer()

int vtkOpenVRRenderWindowInteractorImstk::InternalCreateTimer ( int  timerId,
int  timerType,
unsigned long  duration 
)
protectedvirtual

Win32-specific internal timer methods. See the superclass for detailed documentation.

Definition at line 822 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

◆ New()

static vtkOpenVRRenderWindowInteractorImstk* vtkOpenVRRenderWindowInteractorImstk::New ( )
static

Construct object so that light follows camera motion.

◆ ProcessEvents()

void vtkOpenVRRenderWindowInteractorImstk::ProcessEvents ( )
override

Run the event loop and return. This is provided so that you can implement your own event loop but yet use the vtk event handling as well.

Definition at line 263 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetClassExitMethod()

void vtkOpenVRRenderWindowInteractorImstk::SetClassExitMethod ( void(*)(void *)  f,
void *  arg 
)
static

Methods to set the default exit method for the class. This method is only used if no instance level ExitMethod has been defined. It is provided as a means to control how an interactor is exited given the various language bindings (Win32, etc.).

Definition at line 841 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

◆ SetPhysicalTranslation()

void vtkOpenVRRenderWindowInteractorImstk::SetPhysicalTranslation ( vtkCamera *  ,
double  t1,
double  t2,
double  t3 
)
virtual

Set/Get the optional translation to map world coordinates into the 3D physical space (meters, 0,0,0).

Definition at line 73 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

◆ StartEventLoop()

void vtkOpenVRRenderWindowInteractorImstk::StartEventLoop ( )
protectedvirtual

This will start up the event loop and never return. If you call this method it will loop processing events until the application is exited.

Definition at line 247 of file imstkVtkOpenVRRenderWindowInteractorImstk.cpp.

Here is the call graph for this function:

◆ vtkGetMacro() [1/2]

vtkOpenVRRenderWindowInteractorImstk::vtkGetMacro ( ActionManifestFileName  ,
std::string   
)

Set/Get the json file describing action bindings for events See https://github.com/ValveSoftware/openvr/wiki/Action-manifest

◆ vtkGetMacro() [2/2]

vtkOpenVRRenderWindowInteractorImstk::vtkGetMacro ( ActionSetName  ,
std::string   
)

Set/Get the json file describing action set to use

Member Data Documentation

◆ ClassExitMethod

void(* vtkOpenVRRenderWindowInteractorImstk::ClassExitMethod)(void *) = (void (*)(void*))nullptr
staticprotected

Class variables so an exit method can be defined for this class (used to set different exit methods for various language bindings, i.e. java, Win32)

Definition at line 157 of file imstkVtkOpenVRRenderWindowInteractorImstk.h.

◆ DeviceInputDownCount

int vtkOpenVRRenderWindowInteractorImstk::DeviceInputDownCount[vtkEventDataNumberOfDevices]
protected

Handle multitouch events. Multitouch events recognition starts when both controllers the trigger pressed.

Definition at line 182 of file imstkVtkOpenVRRenderWindowInteractorImstk.h.

◆ StartingPhysicalToWorldMatrix

vtkNew<vtkMatrix4x4> vtkOpenVRRenderWindowInteractorImstk::StartingPhysicalToWorldMatrix
protected

Store physical to world matrix at the start of a multi-touch gesture

Definition at line 188 of file imstkVtkOpenVRRenderWindowInteractorImstk.h.


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