iMSTK
Interactive Medical Simulation Toolkit
Public Member Functions | Protected Attributes | List of all members
imstk::KeyboardSceneControl Class Reference

This implements keyboard controls to control a scene manager and viewer it may operate with both sceneManager and viewer, or only one or the other. warning: This control may pause a thread. Thus it is a bad idea to process it on the thread you're pausing, as you then could not resume. More...

#include <imstkKeyboardSceneControl.h>

Inheritance diagram for imstk::KeyboardSceneControl:
Inheritance graph
[legend]
Collaboration diagram for imstk::KeyboardSceneControl:
Collaboration graph
[legend]

Public Member Functions

 KeyboardSceneControl (const std::string &name="KeyboardSceneControl")
 
void setModuleDriver (std::weak_ptr< ModuleDriver > driver)
 The driver is used to stop the simulation.
 
void setSceneManager (std::weak_ptr< SceneManager > sceneManager)
 Set the scene manager whose fps we should track.
 
void setSceneControlText (std::shared_ptr< SceneControlText > sceneControlText)
 
void printControls () override
 Prints the controls.
 
void OnKeyPress (const char key) override
 
- Public Member Functions inherited from imstk::KeyboardControl
 KeyboardControl (const std::string &name="KeyboardControl")
 
void setDevice (std::shared_ptr< DeviceClient > device) override
 
virtual void OnKeyPress (const char imstkNotUsed(key))
 
virtual void OnKeyRelease (const char imstkNotUsed(key))
 
virtual void keyPressEvent (KeyEvent *e)
 Recieves key press event.
 
virtual void keyReleaseEvent (KeyEvent *e)
 Recieves key release event.
 
- Public Member Functions inherited from imstk::DeviceControl
 SIGNAL (DeviceControl, modified)
 
std::shared_ptr< DeviceClientgetDevice () const
 Set/Get the device client used in the control.
 
- Public Member Functions inherited from imstk::Behaviour< UpdateInfo >
virtual void update (const UpdateInfo &imstkNotUsed(updateData))
 
virtual void visualUpdate (const UpdateInfo &imstkNotUsed(updateData))
 
void initTaskGraphEdges ()
 Setup the edges/connections of the TaskGraph.
 
std::shared_ptr< TaskGraphgetTaskGraph () const
 
- Public Member Functions inherited from imstk::Component
const std::string & getName () const
 
void setName (const std::string &name)
 
std::weak_ptr< EntitygetEntity () const
 Get parent entity.
 
void initialize ()
 Initialize the component, called at a later time after all component construction is complete.
 
- Public Member Functions inherited from imstk::EventObject
template<typename T >
void postEvent (const T &e)
 Emits the event Direct observers will be immediately called, in sync Queued observers will receive the Command in their queue for later execution, reciever must implement doEvent.
 
template<typename T >
void queueEvent (const T &e)
 Queues event directly to this.
 
void doEvent ()
 Do an event, if none exists return.
 
void doAllEvents ()
 Do all the events in the event queue.
 
void foreachEvent (std::function< void(Command cmd)> func)
 Thread safe loop over all event commands, one can implement a custom handler.
 
void rforeachEvent (std::function< void(Command cmd)> func)
 thread safe reverse loop over all event commands, one can implement a custom handler
 
void clearEvents ()
 Removes all events from queue cleans up copies of the event.
 

Protected Attributes

std::weak_ptr< ModuleDriverm_driver
 
std::weak_ptr< SceneManagerm_sceneManager
 
std::shared_ptr< SceneControlTextm_sceneControlText
 
- Protected Attributes inherited from imstk::DeviceControl
std::shared_ptr< DeviceClientm_deviceClient
 
- Protected Attributes inherited from imstk::Behaviour< UpdateInfo >
std::shared_ptr< TaskGraphm_taskGraph = nullptr
 
- Protected Attributes inherited from imstk::Component
std::string m_name
 
std::weak_ptr< Entitym_entity
 Parent entity this component exists on.
 
- Protected Attributes inherited from imstk::EventObject
ParallelUtils::SpinLock eventQueueLock
 
std::deque< CommandeventQueue
 
std::vector< std::pair< std::string, std::vector< Observer > > > queuedObservers
 
std::vector< std::pair< std::string, std::vector< Observer > > > directObservers
 

Additional Inherited Members

- Public Types inherited from imstk::EventObject
using Observer = std::tuple< bool, std::weak_ptr< EventObject >, std::function< void(Event *)> >
 
- Protected Member Functions inherited from imstk::DeviceControl
 DeviceControl (const std::string &name="DeviceControl")
 
- Protected Member Functions inherited from imstk::Behaviour< UpdateInfo >
 Behaviour (const std::string &name="Behaviour")
 
 Behaviour (const bool useTaskGraph, const std::string &name="Behaviour")
 
virtual void initGraphEdges (std::shared_ptr< TaskNode > imstkNotUsed(source), std::shared_ptr< TaskNode > imstkNotUsed(sink))
 Setup the edges/connections of the TaskGraph. More...
 
- Protected Member Functions inherited from imstk::Component
 Component (const std::string &name="Component")
 
virtual void init ()
 Initialize the component, called at a later time after all component construction is complete.
 

Detailed Description

This implements keyboard controls to control a scene manager and viewer it may operate with both sceneManager and viewer, or only one or the other. warning: This control may pause a thread. Thus it is a bad idea to process it on the thread you're pausing, as you then could not resume.

Todo:
: Thread affinity

Definition at line 26 of file imstkKeyboardSceneControl.h.


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