RoboDK Plug-In Interface
IAppRoboDK Class Referenceabstract

Interface to RoboDK. Each plugin must implement this class to establish the interface to RoboDK. More information in the RoboDK Plug-In Structure section. An example PluginExample is available to show how to implement this class. More...

#include <iapprobodk.h>

Inheritance diagram for IAppRoboDK:
PluginExample

Public Types

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...
 

Public Member Functions

virtual QString PluginName ()=0
 Return the plugin name. Try to be creative and make sure the name is unique.
 
virtual QString PluginLoad (QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, IRoboDK *rdk, const QString &settings="")
 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 ()
 This function is called once only when the plugin is being unloaded. More...
 
virtual void PluginLoadToolbar (QMainWindow *mw, int iconsize)
 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)
 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)
 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)
 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...
 
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...
 

Detailed Description

Interface to RoboDK. Each plugin must implement this class to establish the interface to RoboDK. More information in the RoboDK Plug-In Structure section. An example PluginExample is available to show how to implement this class.

Definition at line 188 of file iapprobodk.h.

Member Enumeration Documentation

◆ TypeClick

enum TypeClick

Types of clicks for PluginItemClick function.

Enumerator
ClickNone 

No click.

ClickLeft 

Left click.

ClickCtrlLeft 

Ctrl Left click.

ClickRight 

Right click.

ClickDouble 

Double click.

Definition at line 193 of file iapprobodk.h.

◆ TypeEvent

enum TypeEvent

Event types for PluginEvent function.

Enumerator
EventRender 

Render event: The RoboDK screen is re-drawn, including the tree and the 3D environment. This function is called with the main OpenGL context active. At this moment you can call IRoboDK::DrawGeometry to customize the displayed scene

EventMoved 

Moved event: 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.

EventChanged 

An item has been added or deleted in the station or the active station has changed. This event is usually followed by a EventMoved and EventRender event. 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)

EventChangedStation 

This event is triggered when we change the active station and a new station gains focus (IRoboDK::getActiveStation returns the station that was just opened). In this case we can load station-specific settings using IRoboDK::getParam or IRoboDK::getData.

EventAbout2Save 

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. At this momment you can save station-specific parameters using IRoboDK::setParam or IRoboDK::setData

EventAbout2ChangeStation 

The current RoboDK station is about to loose focus because the user requested to open a new station (or just changed the open station). It is recommended to save session/station-specific settings at this moment, if any.

EventAbout2CloseStation 

The current RoboDK station (RDK file) is about to be closed. Items in the tree will be deleted and become invalid pointers shortly after this event. The RDK file may be saved if the user accepted to save changes and the corresponding EventAbout2Save event will be triggered.

EventTrajectoryStep 

A new simulation move event completed for one or more robots or mechanisms. This event is usually triggered after one or more EventMoved to signal the completition of moves. This event is usually followed by a Render event after a few ms. Tip: Use the command TrajectoryTime to retrieve accurate timing according to moving objects (time_sec = RDK->Command("TrajectoryTime").toDouble())

Definition at line 212 of file iapprobodk.h.

Constructor & Destructor Documentation

◆ ~IAppRoboDK()

virtual ~IAppRoboDK ( )
inlinevirtual

Definition at line 245 of file iapprobodk.h.

Member Function Documentation

◆ PluginCommand()

virtual QString PluginCommand ( const QString &  command,
const QString &  value 
)
inlinevirtual

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.

Parameters
command
value
Returns

Reimplemented in PluginExample.

Definition at line 282 of file iapprobodk.h.

◆ PluginEvent()

virtual void PluginEvent ( TypeEvent  event_type)
inlinevirtual

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.

Parameters
event_typetype of event (EventRender, EventMoved, EventChanged)

Reimplemented in PluginExample.

Definition at line 289 of file iapprobodk.h.

◆ PluginItemClick()

virtual bool PluginItemClick ( Item  item,
QMenu *  menu,
TypeClick  click_type 
)
inlinevirtual

This function is called every time a new context menu is created for an item.

Parameters
itemThe Item (IItem) clicked
menuPointer to the context menu
click_typeClick type (usually left click)
Returns

Reimplemented in PluginExample.

Definition at line 274 of file iapprobodk.h.

◆ PluginItemClickMulti()

virtual bool PluginItemClickMulti ( QList< Item > &  item_list,
QMenu *  menu,
TypeClick  click_type 
)
inlinevirtual

This function is called every time a new context menu is created for a list of items.

Parameters
itemThe List of Items (IItem) clicked
menuPointer to the context menu
click_typeClick type (usually left click)
Returns

Definition at line 296 of file iapprobodk.h.

◆ PluginLoad()

virtual QString PluginLoad ( QMainWindow *  mw,
QMenuBar *  menubar,
QStatusBar *  statusbar,
IRoboDK rdk,
const QString &  settings = "" 
)
inlinevirtual

Load the plugin. This function is called only once when the plugin is loaded (or RoboDK is started with the plugin).

Parameters
mwRoboDK's QMainwindow. Use this object to add menus in the main window.
menubarPointer to RoboDK's main menu bar
statusbarPointer to RoboDK's main status bar
statusbarPointer RoboDK's interface (implementation of the RoboDK API): IRoboDK and IItem
settingsAdditional settings (reserved for future compatibility)

Reimplemented in PluginExample.

Definition at line 256 of file iapprobodk.h.

◆ PluginLoadToolbar()

virtual void PluginLoadToolbar ( QMainWindow *  mw,
int  iconsize 
)
inlinevirtual

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)

Parameters
mwPointer to RoboDK's main window.
iconsizeSize 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 in PluginExample.

Definition at line 266 of file iapprobodk.h.

◆ PluginUnload()

virtual void PluginUnload ( )
inlinevirtual

This function is called once only when the plugin is being unloaded.

Reimplemented in PluginExample.

Definition at line 260 of file iapprobodk.h.


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