The PluginExample class shows the structure of a RoboDK plugin. A RoboDK plugin must implement the IAppRoboDK and the QObject class. More...
#include <pluginexample.h>
Public Slots | |
void | callback_information () |
Called when the information button/action is selected. More... | |
void | callback_robotpilot () |
Called when the robot pilot button/action is selected. More... | |
void | callback_robotpilot_closed () |
Called when the robot pilot window is closed (event triggered by the dock window) More... | |
void | callback_help () |
Called when the user select the button/action for help. More... | |
Public Attributes | |
QMainWindow * | MainWindow |
RoboDK's main window pointer. More... | |
QStatusBar * | StatusBar |
RoboDK's main status bar pointer. More... | |
RoboDK * | RDK |
Pointer to the RoboDK API interface. More... | |
Private Member Functions | |
virtual Q_PLUGIN_METADATA(IID "RoboDK.IAppRoboDK") public QString | PluginLoad (QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, RoboDK *rdk, const QString &settings="") override |
Load the plugin. This function is called only once when the plugin is loaded (or RoboDK is started with the plugin). More... | |
virtual void | PluginUnload () override |
This function is called once only when the plugin is being unloaded. More... | |
virtual void | PluginLoadToolbar (QMainWindow *mw, int icon_size) override |
This function is called every time the toolbar is set up. This function is called at least once right after PluginLoad and it can be called when the user changes the view settings (such as changing from cinema to normal mode) or changes the default toolbar layout (in Tools-Toolbar Layout) More... | |
virtual bool | PluginItemClick (Item item, QMenu *menu, TypeClick click_type) override |
This function is called every time a new context menu is created for an item. More... | |
virtual QString | PluginCommand (const QString &command, const QString &value) override |
Specific commands can be passed from the RoboDK API. For example, a parent application can rely on a plugin for certain operations (for example, to create native windows within RoboDK application or take advantage of the RoboDK API speed within the plugin). Use the RoboDK API (PluginCommand(plugin_name, command, value) to send specific commands to your plugin from an external application. More... | |
virtual void | PluginEvent (TypeEvent event_type) override |
This function is called every time there is a new RoboDK event such as rendering the screen, adding/removing items or changing the active station. If event_type is EventRender you can render your own graphics here using IRoboDK::DrawGeometry. More... | |
Private Member Functions inherited from IAppRoboDK | |
virtual QString | PluginName ()=0 |
Return the plugin name. Try to be creative and make sure the name is unique. | |
virtual bool | PluginItemClickMulti (QList< Item > &item_list, QMenu *menu, TypeClick click_type) |
This function is called every time a new context menu is created for a list of items. More... | |
Private Attributes | |
QToolBar * | toolbar1 |
Pointer to the customized toolbar. More... | |
QMenu * | menu1 |
Pointer to the customized menu. More... | |
QAction * | action_information |
Information action. callback_information is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks. More... | |
QAction * | action_robotpilot |
Open robot pilot form action. callback_robotpilot is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks. More... | |
QAction * | action_help |
Open help action. callback_help is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks. More... | |
QDockWidget * | dock_robotpilot |
Pointer to the docked window. More... | |
FormRobotPilot * | form_robotpilot |
Pointer to the robot pilot form. More... | |
Additional Inherited Members | |
Private Types inherited from IAppRoboDK | |
enum | TypeClick { ClickNone =-1 , ClickLeft =0 , ClickCtrlLeft =1 , ClickRight =2 , ClickDouble =3 } |
Types of clicks for PluginItemClick function. More... | |
enum | TypeEvent { EventRender =1 , EventMoved =2 , EventChanged =3 , EventChangedStation =4 , EventAbout2Save =5 , EventAbout2ChangeStation =6 , EventAbout2CloseStation =7 , EventTrajectoryStep =8 } |
Event types for PluginEvent function. More... | |
The PluginExample class shows the structure of a RoboDK plugin. A RoboDK plugin must implement the IAppRoboDK and the QObject class.
Definition at line 26 of file pluginexample.h.
|
slot |
Called when the user select the button/action for help.
Definition at line 283 of file pluginexample.cpp.
|
slot |
Called when the information button/action is selected.
Definition at line 186 of file pluginexample.cpp.
|
slot |
Called when the robot pilot button/action is selected.
Definition at line 266 of file pluginexample.cpp.
|
slot |
Called when the robot pilot window is closed (event triggered by the dock window)
Definition at line 277 of file pluginexample.cpp.
|
overrideprivatevirtual |
Specific commands can be passed from the RoboDK API. For example, a parent application can rely on a plugin for certain operations (for example, to create native windows within RoboDK application or take advantage of the RoboDK API speed within the plugin). Use the RoboDK API (PluginCommand(plugin_name, command, value) to send specific commands to your plugin from an external application.
command | |
value |
Reimplemented from IAppRoboDK.
Definition at line 119 of file pluginexample.cpp.
|
overrideprivatevirtual |
This function is called every time there is a new RoboDK event such as rendering the screen, adding/removing items or changing the active station. If event_type is EventRender you can render your own graphics here using IRoboDK::DrawGeometry.
event_type | type of event (EventRender, EventMoved, EventChanged) |
Display/Render the 3D scene. At this moment we can call RDK->DrawGeometry to customize the displayed scene
qDebug() << "Something has moved, such as a robot, reference frame, object or tool. It is very likely that an EventRender will be triggered immediately after this event qDebug() << "==== EventMoved ===="; qDebug() << "An item has been added or deleted. Current station: " << RDK->getActiveStation()->Name(); If we added a new item (for example, a reference frame) it is very likely that an EventMoved will follow with the updated position of the newly added item(s) This event is also triggered when we change the active station and a new station gains focus. Example to check if the station changed and to load settings The user requested to save the project and the RDK file will be saved to disk. It is recommended to save all station-specific settings at this moment. For example, you can use RDK.setParam("ParameterName", "ParameterValue") or RDK.setData("ParameterName", bytearray)
The user requested to open a new RoboDK station (RDK file) or the user is navigating among different stations. This event is triggered before the current station looses focus.
The user requested to close the currently open RoboDK station (RDK file). The RDK file may be saved if the user and the corresponding event will be triggered.
Reimplemented from IAppRoboDK.
Definition at line 132 of file pluginexample.cpp.
This function is called every time a new context menu is created for an item.
item | The Item (IItem) clicked |
menu | Pointer to the context menu |
click_type | Click type (usually left click) |
Reimplemented from IAppRoboDK.
Definition at line 102 of file pluginexample.cpp.
|
overrideprivatevirtual |
Load the plugin. This function is called only once when the plugin is loaded (or RoboDK is started with the plugin).
mw | RoboDK's QMainwindow. Use this object to add menus in the main window. |
menubar | Pointer to RoboDK's main menu bar |
statusbar | Pointer to RoboDK's main status bar |
statusbar | Pointer RoboDK's interface (implementation of the RoboDK API): IRoboDK and IItem |
settings | Additional settings (reserved for future compatibility) |
Reimplemented from IAppRoboDK.
Definition at line 27 of file pluginexample.cpp.
|
overrideprivatevirtual |
This function is called every time the toolbar is set up. This function is called at least once right after PluginLoad and it can be called when the user changes the view settings (such as changing from cinema to normal mode) or changes the default toolbar layout (in Tools-Toolbar Layout)
mw | Pointer to RoboDK's main window. |
iconsize | Size of the toolbar icons. The size may differ depending on the screen's DPI. It can also be set in Tools-Options-Display menu. |
Reimplemented from IAppRoboDK.
Definition at line 87 of file pluginexample.cpp.
|
overrideprivatevirtual |
This function is called once only when the plugin is being unloaded.
Reimplemented from IAppRoboDK.
Definition at line 66 of file pluginexample.cpp.
|
private |
Open help action. callback_help is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.
Definition at line 86 of file pluginexample.h.
|
private |
Information action. callback_information is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.
Definition at line 80 of file pluginexample.h.
|
private |
Open robot pilot form action. callback_robotpilot is triggered with this action. Actions are required to populate toolbars and menus and allows getting callbacks.
Definition at line 83 of file pluginexample.h.
|
private |
Pointer to the docked window.
Definition at line 89 of file pluginexample.h.
|
private |
Pointer to the robot pilot form.
Definition at line 92 of file pluginexample.h.
QMainWindow* MainWindow |
RoboDK's main window pointer.
Definition at line 48 of file pluginexample.h.
|
private |
Pointer to the customized menu.
Definition at line 77 of file pluginexample.h.
RoboDK* RDK |
Pointer to the RoboDK API interface.
Definition at line 54 of file pluginexample.h.
QStatusBar* StatusBar |
RoboDK's main status bar pointer.
Definition at line 51 of file pluginexample.h.
|
private |
Pointer to the customized toolbar.
Definition at line 74 of file pluginexample.h.