iMSTK
Interactive Medical Simulation Toolkit
imstkVTKOpenVRViewer.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkAbstractVTKViewer.h"
10 #include "imstkMacros.h"
11 
12 #include <vtkSmartPointer.h>
13 #include <list>
14 
15 class vtkRenderWindow;
16 
17 namespace imstk
18 {
19 class OpenVRDeviceClient;
20 
29 {
30 public:
31  VTKOpenVRViewer(std::string name = "VTKOpenVRViewer");
32  ~VTKOpenVRViewer() override = default;
33 
34  IMSTK_TYPE_NAME(VTKOpenVRViewer)
35 
36  void setRenderingMode(const Renderer::Mode mode) override;
37 
41  void setActiveScene(std::shared_ptr<Scene> scene) override;
42 
49  void setPhysicalToWorldTransform(const Mat4d& physicalToWorldMatrix);
51 
55  std::shared_ptr<OpenVRDeviceClient> getVRDeviceClient(int deviceType);
56 
60  const std::list<std::shared_ptr<OpenVRDeviceClient>>& getVRDeviceClients() const { return m_vrDeviceClients; }
61 
66  void processEvents() override;
67 
68 protected:
69  bool initModule() override;
70 
71  void updateModule() override;
72 
74  std::list<std::shared_ptr<OpenVRDeviceClient>> m_vrDeviceClients;
75 };
76 } // imstk
Mat4d getPhysicalToWorldTransform()
Get/Set Transform to physical space This would be useful if you needed a permanant space transformati...
std::shared_ptr< OpenVRDeviceClient > getVRDeviceClient(int deviceType)
Get one of the device clients for VR.
Compound Geometry.
void setRenderingMode(const Renderer::Mode mode) override
Setup the current renderer to render what&#39;s needed based on the mode chosen.
const std::list< std::shared_ptr< OpenVRDeviceClient > > & getVRDeviceClients() const
Acquire the full list of VR devices tied to this viewer.
Mode
Enumerations for the render mode.
Definition: imstkRenderer.h:47
void updateModule() override
The VR controllers are tied to the view.
Subclasses viewer for the VTK rendering back-end.
void processEvents() override
VTKOpenVRViewer overrides to provide a non-rendering event processing loop (to deal with vsync blocka...
void setActiveScene(std::shared_ptr< Scene > scene) override
Set scene to be rendered.