Class interactor#
Defined in File interactor.h
Class Documentation#
-
class interactor#
Class used to control interaction and animation.
A class to control interaction with the window as well as animation. It also provide a timer callback if needed and can record/play interaction file.
Animation
-
virtual void toggleAnimation() = 0#
Control the animation.
-
virtual void startAnimation() = 0#
Control the animation.
-
virtual void stopAnimation() = 0#
Control the animation.
-
virtual bool isPlayingAnimation() = 0#
Control the animation.
Movement
-
virtual void enableCameraMovement() = 0#
Control if camera movements are enabled, which they are by default.
-
virtual void disableCameraMovement() = 0#
Control if camera movements are enabled, which they are by default.
Public Functions
-
virtual interactor &setKeyPressCallBack(std::function<bool(int, std::string)> callBack) = 0#
Use this method to specify your own keypress callback, with the expected API:
keyCode being the pressed key, eg:bool callBack(int keyCode, std::string keySym)
C
and keySym the key symbol for keys which do not have codes, eg: Left, Right, Up, Down, Space, Enter. Your callBack should return true if the key was handled, false if you want standard interactor behavior instead.
-
virtual interactor &setDropFilesCallBack(std::function<bool(std::vector<std::string>)> callBack) = 0#
Use this method to specify your own drop files callback, with the expected API:
files being a vector of string containing paths to dropped files. Your callBack should return true if the event was handled, false if you want standard interactor behavior instead.bool callBack(std::vector<std::string> files)
-
virtual unsigned long createTimerCallBack(double time, std::function<void()> callBack) = 0#
Use this method to create your own timer callback. You callback will be called once every time ms. Return an id to use in removeTimeCallBack.
-
virtual void removeTimerCallBack(unsigned long id) = 0#
Remove a previously created timer callback using the id.
-
virtual bool playInteraction(const std::string &file) = 0#
Play a VTK interaction file.
-
virtual bool recordInteraction(const std::string &file) = 0#
Start interaction and record it all in a VTK interaction file.
-
virtual void start() = 0#
Start the interactor.
-
virtual void stop() = 0#
Stop the interactor.
Public Static Functions
-
static const std::vector<std::pair<std::string, std::string>> &getDefaultInteractionsInfo()#
Get a structure of strings describing default interactions.
-
virtual void toggleAnimation() = 0#