iMSTK
Interactive Medical Simulation Toolkit
imstkKeyboardSceneControl.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 "imstkKeyboardControl.h"
10 
11 namespace imstk
12 {
13 class ModuleDriver;
14 class SceneControlText;
15 class SceneManager;
16 
27 {
28 public:
29  KeyboardSceneControl(const std::string& name = "KeyboardSceneControl") : KeyboardControl(name) { }
30  ~KeyboardSceneControl() override = default;
31 
35  void setModuleDriver(std::weak_ptr<ModuleDriver> driver) { m_driver = driver; }
36 
40  void setSceneManager(std::weak_ptr<SceneManager> sceneManager) { m_sceneManager = sceneManager; }
41 
42  void setSceneControlText(std::shared_ptr<SceneControlText> sceneControlText) { m_sceneControlText = sceneControlText; }
43 
44  void printControls() override;
45 
46  void OnKeyPress(const char key) override;
47 
48 protected:
49  std::weak_ptr<ModuleDriver> m_driver;
50  std::weak_ptr<SceneManager> m_sceneManager;
51  std::shared_ptr<SceneControlText> m_sceneControlText;
52 };
53 } // namespace imstk
void printControls() override
Prints the controls.
Compound Geometry.
void setSceneManager(std::weak_ptr< SceneManager > sceneManager)
Set the scene manager whose fps we should track.
void setModuleDriver(std::weak_ptr< ModuleDriver > driver)
The driver is used to stop the simulation.
This implements keyboard controls to control a scene manager and viewer it may operate with both scen...