![]() |
RobWorkProject
25.2.11-
|
main robwork studio class More...
#include <RobWorkStudio.hpp>
Inherits QMainWindow.
Public Types | |
typedef rw::core::Ptr< RobWorkStudio > | Ptr |
typedef boost::function< void(const rw::kinematics::State &)> | StateChangedListener |
Defines a state changed listener. More... | |
typedef rw::core::Event< StateChangedListener, const rw::kinematics::State & > | StateChangedEvent |
Defines event for state changes. More... | |
typedef boost::function< void(rw::kinematics::Frame *)> | FrameSelectedListener |
Defines a frame selected listener. More... | |
typedef rw::core::Event< FrameSelectedListener, rw::kinematics::Frame * > | FrameSelectedEvent |
Defines event for frame selection. More... | |
typedef boost::function< void(const std::string &)> | GenericEventListener |
Defines a generic event listener. More... | |
typedef rw::core::Event< GenericEventListener, const std::string & > | GenericEvent |
Defines event for generic user events. | |
typedef boost::function< void(const std::string &, boost::any)> | GenericAnyEventListener |
Defines a generic event listener with data. More... | |
typedef rw::core::Event< GenericAnyEventListener, const std::string &, boost::any > | GenericAnyEvent |
Defines event for generic user events. | |
typedef boost::function< void(int, Qt::KeyboardModifiers)> | KeyEventListener |
Defines a key pressed event listener. More... | |
typedef rw::core::Event< KeyEventListener, int, Qt::KeyboardModifiers > | KeyEvent |
Defines event for key pressed events. | |
typedef boost::function< void(QMouseEvent *)> | MousePressedEventListener |
Defines a Mouse pressed event Listeners are called when someone fires a MousePressed event. MousePressedEventListener defines the signature of a callback method. Example usage in a plugin: See RobWorkStudio::StateChangedListener. | |
typedef rw::core::Event< MousePressedEventListener, QMouseEvent * > | MousePressedEvent |
Defines event for mouse pressed events. | |
typedef boost::function< void(const rw::trajectory::TimedStatePath &)> | StateTrajectoryChangedListener |
Defines a StateTrajectory changed event Listeners are called when someone fires a stateTrajectoryChanged event. StateTrajectoryListener defines the signature of a callback method. Example usage in a plugin: See RobWorkStudio::StateChangedListener. | |
typedef rw::core::Event< StateTrajectoryChangedListener, const rw::trajectory::TimedStatePath & > | StateTrajectoryChangedEvent |
Defines event for key pressed events. | |
typedef boost::function< void(const rw::trajectory::TimedStatePath::Ptr)> | StateTrajectoryPtrChangedListener |
Defines a StateTrajectory changed event Listeners are called when someone fires a stateTrajectoryChanged event. StateTrajectoryListener defines the signature of a callback method. Example usage in a plugin: See RobWorkStudio::StateChangedListener. | |
typedef rw::core::Event< StateTrajectoryPtrChangedListener, const rw::trajectory::TimedStatePath::Ptr > | StateTrajectoryPtrChangedEvent |
Defines event for key pressed events. | |
typedef boost::function< void(const rw::math::Vector3D<> &)> | PositionSelectedListener |
Defines a listener for position change events. More... | |
typedef rw::core::Event< PositionSelectedListener, const rw::math::Vector3D<> & > | PositionSelectedEvent |
Defines event for PositionChanged. | |
Public Slots | |
void | setTStatePath (rw::trajectory::TimedStatePath path) |
Slot for changing the common timed state path. More... | |
Public Member Functions | |
RobWorkStudio (const rw::core::PropertyMap &map) | |
RobWorkStudio object with a number of plugins loaded elsewhere. | |
~RobWorkStudio () | |
destructor More... | |
void | openFile (const std::string &filename) |
Opens either a workcell file, device file or a CAD file. Supported formats are STL, STLA, STLB, 3DS, AC, AC3D, TRI, OBJ, WU, WC, DEV, XML. More... | |
rw::core::PropertyMap & | getPropertyMap () |
returns the property map of this instance of robwork studio More... | |
void | setWorkcell (rw::models::WorkCell::Ptr workcell) |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed. More... | |
void | setWorkCell (rw::models::WorkCell::Ptr workcell) |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed. More... | |
void | setWorkcell (std::string workcell_file) |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed. More... | |
void | setWorkCell (std::string workcell_file) |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed. More... | |
void | closeWorkCell () |
close the workcell | |
void | postWorkCell (rw::models::WorkCell::Ptr workcell) |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed. More... | |
void | postOpenWorkCell (const std::string &string) |
Request loading of a new workcell. Use this if request comes from non-GUI thread. More... | |
void | postCloseWorkCell () |
Request closing a workcell. Use this if request comes from non-GUI thread. | |
rw::models::WorkCell::Ptr | getWorkcell () |
Returns the workcell opened in RobWorkStudio. More... | |
rw::models::WorkCell::Ptr | getWorkCell () |
Returns the workcell opened in RobWorkStudio. More... | |
rw::proximity::CollisionDetector::Ptr | getCollisionDetector () |
Returns the collision detector used in the user interface. More... | |
rw::graphics::WorkCellScene::Ptr | getWorkCellScene () |
Returns the component controlling the drawing. More... | |
const rw::trajectory::TimedStatePath & | getTimedStatePath () |
Returns reference to the common TimedStatePath. More... | |
const rw::core::Ptr< rw::trajectory::TimedStatePath > | getTimedStatePathPtr () |
Returns pointer to the common TimedStatePath. More... | |
void | setTimedStatePath (const rw::trajectory::TimedStatePath &path) |
Sets the common TimedStatePath. More... | |
void | setTimedStatePath (const rw::trajectory::TimedStatePath::Ptr path) |
Sets the common TimedStatePath. More... | |
void | postTimedStatePath (const rw::trajectory::TimedStatePath &path) |
Sets the common TimedStatePath. More... | |
void | postTimedStatePath (const rw::trajectory::TimedStatePath::Ptr &path) |
Sets the common TimedStatePath. More... | |
void | postExit () |
Request program termination. | |
void | setState (const rw::kinematics::State &state) |
Sets the current state of for RobWorkStudio. More... | |
void | postState (const rw::kinematics::State &state) |
Sets the current state of for RobWorkStudio. More... | |
void | postUpdateAndRepaint () |
a method for updating the opengl graphics output More... | |
void | postSaveViewGL (const std::string &str) |
Saves the current opengl view. More... | |
void | postGenericEvent (const std::string &id) |
Post a generic event. More... | |
void | postGenericAnyEvent (const std::string &id, boost::any data) |
Post a generic event. More... | |
const rw::kinematics::State & | getState () |
Returns the current state. More... | |
rw::core::Log & | log () |
the log of RobWorkStudio. More... | |
rw::core::Log::Ptr | logPtr () |
the log of RobWorkStudio. More... | |
bool | event (QEvent *event) |
Handle an event. More... | |
StateChangedEvent & | stateChangedEvent () |
Returns StateChangeEvent needed for subscribing and firing the event. More... | |
FrameSelectedEvent & | frameSelectedEvent () |
Returns FrameSelectedEvent needed for subscription and firing of events. More... | |
GenericEvent & | genericEvent () |
Returns GenericEvent needed for subscription and firing of events. More... | |
GenericAnyEvent & | genericAnyEvent () |
a generic event like GenericEvent but with the possibility of attaching any data to the event message. More... | |
boost::any | waitForAnyEvent (const std::string &id, double timeout=-1.0) |
this will block until an anyevent with id id is emitted or timeout is reached. More... | |
KeyEvent & | keyEvent () |
Returns KeyEvent needed for subscription and firing of events. More... | |
MousePressedEvent & | mousePressedEvent () |
Returns MousePressedEvent needed for subscription and firing of events. More... | |
StateTrajectoryChangedEvent & | stateTrajectoryChangedEvent () |
Returns stateTrajectoryChangedEvent needed for subscription and firing of event. More... | |
StateTrajectoryPtrChangedEvent & | stateTrajectoryPtrChangedEvent () |
Returns stateTrajectoryChangedEvent needed for subscription and firing of event. More... | |
PositionSelectedEvent & | positionSelectedEvent () |
Returns PositionChangedEvent object needed for subscription to and firing of event. More... | |
void | saveViewGL (const QString &filename) |
Saves the current opengl view. More... | |
void | updateAndRepaint () |
a method for updating the opengl graphics output | |
RWStudioView3D::Ptr | getView () |
Returns the instance of the ViewGL class. | |
rw::math::Transform3D | getViewTransform () |
Returns the current view transform. More... | |
void | setViewTransform (rw::math::Transform3D<> nviewT3D) |
Sets current view transform. More... | |
void | keyPressEvent (QKeyEvent *e) |
Handles a Qt key event. More... | |
AboutBox * | getAboutBox () |
void | propertyChangedListener (rw::core::PropertyBase *base) |
Handles changed properties. More... | |
void | addPlugin (RobWorkStudioPlugin *plugin, bool visible, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea) |
Add a plugin. More... | |
const std::vector< RobWorkStudioPlugin * > & | getPlugins () const |
Get the list of currently loaded plugins. More... | |
void | loadSettingsSetupPlugins (const std::string &file) |
Restore the RobWorkStudio settings from a file. More... | |
void | loadPlugin (std::string pluginFile, bool visible=false, int dock=1) |
Load a plugin file. More... | |
bool | unloadPlugin (RobWorkStudioPlugin *pl) |
Unload the plugin from RobWorkStudio. More... | |
std::string | loadSettingsWorkcell (const std::string &file) |
Load Workcell into RobWork Studio based on settings file. More... | |
rw::core::PropertyMap & | getSettings () |
Get the current RobWorkStudio settings. More... | |
Protected Member Functions | |
void | closeEvent (QCloseEvent *e) |
Close Event inherited from QT. | |
main robwork studio class
Defines event for frame selection.
The selected rw::kinematics::Frame* is provided as an argument
typedef boost::function<void(rw::kinematics::Frame*)> FrameSelectedListener |
Defines a frame selected listener.
Listeners to this event is calls when a frame is selected.
FrameSelectedListener describes the signature of the callback method.
Example usage in a plugin, see RobWorkStudio::StateChangedListener
typedef boost::function<void(const std::string&, boost::any)> GenericAnyEventListener |
Defines a generic event listener with data.
Listeners to this event is called when someone fires a generic event with data.
GenericAnyEventListener describes the signature of a callback method, used for generic (user defined) event containing a string message and data.
typedef boost::function<void(const std::string&)> GenericEventListener |
Defines a generic event listener.
Listeners to this event is called when someone fires a generic event.
GenericEventListener describes the signature of a callback method, used for generic (user defined) event containing a string message.
Example usage in a plugin, see RobWorkStudio::StateChangedListener
typedef boost::function<void(int, Qt::KeyboardModifiers)> KeyEventListener |
Defines a key pressed event listener.
Listeners are called when someone fires keyEvent. By default the View component fires out all key events it receives from QT.
KeyEventListener describes the signature of a callback method.
Example usage in a plugin:
typedef boost::function<void(const rw::math::Vector3D<>&)> PositionSelectedListener |
Defines a listener for position change events.
These listeners are called when user has selected a point in the 3D view.
To send an event double clicking left mouse button on the point of interest while pressing shift.
Example use in a plugin: See RobWorkStudio::StateChangedListener
typedef rw::core::Event<StateChangedListener, const rw::kinematics::State&> StateChangedEvent |
Defines event for state changes.
This event is fired when setState is called, or when a user (plugin) manually calls fire.
typedef boost::function<void(const rw::kinematics::State&)> StateChangedListener |
Defines a state changed listener.
Listeners to this event is called when a change of the state occurs.
StateChangedListener describes the signature of a callback method.
Example usage in a plugin:
~RobWorkStudio | ( | ) |
destructor
void addPlugin | ( | RobWorkStudioPlugin * | plugin, |
bool | visible, | ||
Qt::DockWidgetArea | area = Qt::LeftDockWidgetArea |
||
) |
Add a plugin.
plugin | [in/out] the plugin. |
visible | [in] true if the plugin should be visible. |
area | [in] the area for the widget. |
bool event | ( | QEvent * | event | ) |
Handle an event.
event | [in] the Qt event. |
|
inline |
Returns FrameSelectedEvent needed for subscription and firing of events.
|
inline |
a generic event like GenericEvent but with the possibility of attaching any data to the event message.
|
inline |
Returns GenericEvent needed for subscription and firing of events.
|
inline |
Plugins can add their own tab to the about box.
|
inline |
Returns the collision detector used in the user interface.
The method provides a pointer to the collision checker used in the user interface.
|
inline |
Get the list of currently loaded plugins.
|
inline |
returns the property map of this instance of robwork studio
|
inline |
Get the current RobWorkStudio settings.
|
inline |
Returns the current state.
Returns the current state of the workcell
|
inline |
Returns reference to the common TimedStatePath.
The TimedStatePath can be used to represent a trajectory represented by full workcell states
|
inline |
Returns pointer to the common TimedStatePath.
The TimedStatePath can be used to represent a trajectory represented by full workcell states
|
inline |
Returns the current view transform.
Convenience function.
rw::models::WorkCell::Ptr getWorkcell | ( | ) |
Returns the workcell opened in RobWorkStudio.
|
inline |
Returns the workcell opened in RobWorkStudio.
|
inline |
Returns the component controlling the drawing.
Through the WorkCellGLDrawer the user can control the geometry associated to frames.
|
inline |
Returns KeyEvent needed for subscription and firing of events.
void keyPressEvent | ( | QKeyEvent * | e | ) |
Handles a Qt key event.
e | [in] the event. |
void loadPlugin | ( | std::string | pluginFile, |
bool | visible = false , |
||
int | dock = 1 |
||
) |
Load a plugin file.
pluginFile | [in] The absolute path to the shared library file contaning the object |
visible | [in] Sets wether the plugin is UI is opened upon load |
dock | [in] The area where the uis will be placed |
void loadSettingsSetupPlugins | ( | const std::string & | file | ) |
Restore the RobWorkStudio settings from a file.
file | [in] the filename. |
std::string loadSettingsWorkcell | ( | const std::string & | file | ) |
Load Workcell into RobWork Studio based on settings file.
file | [in] the filename. |
rw::core::Log& log | ( | ) |
the log of RobWorkStudio.
rw::core::Log::Ptr logPtr | ( | ) |
the log of RobWorkStudio.
|
inline |
Returns MousePressedEvent needed for subscription and firing of events.
void openFile | ( | const std::string & | filename | ) |
Opens either a workcell file, device file or a CAD file. Supported formats are STL, STLA, STLB, 3DS, AC, AC3D, TRI, OBJ, WU, WC, DEV, XML.
filename | [in] name of file |
|
inline |
Returns PositionChangedEvent object needed for subscription to and firing of event.
void postGenericAnyEvent | ( | const std::string & | id, |
boost::any | data | ||
) |
Post a generic event.
id | [in] identifier for the event. |
data | [in] the data for the event. |
void postGenericEvent | ( | const std::string & | id | ) |
Post a generic event.
id | [in] identifier for the event. |
void postOpenWorkCell | ( | const std::string & | string | ) |
Request loading of a new workcell. Use this if request comes from non-GUI thread.
string | [in] the filename. |
void postSaveViewGL | ( | const std::string & | str | ) |
Saves the current opengl view.
The filename should end with either ".png", ".jpg" or ".bmp" to specify the format used to save the file.
This function can be called from other threads.
void postState | ( | const rw::kinematics::State & | state | ) |
Sets the current state of for RobWorkStudio.
Sets the current state and calls all StateChanged listeners
state | [in] The new state |
This function can be called from other threads.
void postTimedStatePath | ( | const rw::trajectory::TimedStatePath & | path | ) |
Sets the common TimedStatePath.
Use the common TimedStatePath to set at trajectory, which plugins, e.g. PlayBack should have access to.
path | [in] The new TimedStatePath |
Use this version if request comes from non-GUI thread.
void postTimedStatePath | ( | const rw::trajectory::TimedStatePath::Ptr & | path | ) |
Sets the common TimedStatePath.
Use the common TimedStatePath to set at trajectory, which plugins, e.g. PlayBack should have access to.
path | [in] The new TimedStatePath |
Use this version if request comes from non-GUI thread.
void postUpdateAndRepaint | ( | ) |
a method for updating the opengl graphics output
This function can be called from other threads.
void postWorkCell | ( | rw::models::WorkCell::Ptr | workcell | ) |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed.
workcell | [in] the workcell |
Use this if request comes from non-GUI thread.
void propertyChangedListener | ( | rw::core::PropertyBase * | base | ) |
Handles changed properties.
base | [in] the changed property. |
void saveViewGL | ( | const QString & | filename | ) |
Saves the current opengl view.
The filename should end with either ".png", ".jpg" or ".bmp" to specify the format used to save the file.
void setState | ( | const rw::kinematics::State & | state | ) |
Sets the current state of for RobWorkStudio.
Sets the current state and calls all StateChanged listeners
state | [in] The new state |
void setTimedStatePath | ( | const rw::trajectory::TimedStatePath & | path | ) |
Sets the common TimedStatePath.
Use the common TimedStatePath to set at trajectory, which plugins, e.g. PlayBack should have access to.
path | [in] The new TimedStatePath |
void setTimedStatePath | ( | const rw::trajectory::TimedStatePath::Ptr | path | ) |
Sets the common TimedStatePath.
Use the common TimedStatePath to set at trajectory, which plugins, e.g. PlayBack should have access to.
path | [in] The new TimedStatePath |
|
slot |
Slot for changing the common timed state path.
path | [in] the path. |
|
inline |
Sets current view transform.
Convenience function. Performs update & repaint as well.
void setWorkcell | ( | rw::models::WorkCell::Ptr | workcell | ) |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed.
workcell | [in] the workcell |
|
inline |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed.
workcell | [in] the workcell |
|
inline |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed.
workcell_file | [in] the filename of the workcell |
|
inline |
sets the workcell of robwork studio. If another workcell is currently loaded it will be closed.
workcell_file | [in] the filename of the workcell |
|
inline |
Returns StateChangeEvent needed for subscribing and firing the event.
|
inline |
Returns stateTrajectoryChangedEvent needed for subscription and firing of event.
|
inline |
Returns stateTrajectoryChangedEvent needed for subscription and firing of event.
bool unloadPlugin | ( | RobWorkStudioPlugin * | pl | ) |
Unload the plugin from RobWorkStudio.
pl | [in] the plugin to be unloaded |
boost::any waitForAnyEvent | ( | const std::string & | id, |
double | timeout = -1.0 |
||
) |
this will block until an anyevent with id id is emitted or timeout is reached.
id | [in] string id of the event that is expected |
timeout | [in] timeout in seconds |