RoboDK Plug-In Interface
Loading...
Searching...
No Matches
iapprobodk.h
1
170#ifndef IAPPROBODK_H
171#define IAPPROBODK_H
172
173#include <QtPlugin>
174#include <QString>
175#include <QList>
176
177#include "iitem.h"
178
179class QMainWindow;
180class QMenuBar;
181class QStatusBar;
182class QToolBar;
183class QTreeWidgetItem;
184class QMenu;
185class IRoboDK;
186
187
191{
192public:
193
196
199
202
205
208
210 ClickDouble = 3
211 };
212
250
252 EVENT_SELECTIONTREE_CHANGED = 1,
253
256
257 EVENT_REFERENCE_PICKED = 3,
258 EVENT_REFERENCE_RELEASED = 4,
259 EVENT_TOOL_MODIFIED = 5,
260 EVENT_CREATED_ISOCUBE = 6,
261 EVENT_SELECTION3D_CHANGED = 7,
262 EVENT_VIEWPOSE_CHANGED = 8,
263 EVENT_ROBOT_MOVED = 9,
264 EVENT_KEY = 10,
265 EVENT_ITEM_MOVED_POSE = 11,
266 EVENT_COLLISIONMAP_RESET = 12,
267 EVENT_COLLISIONMAP_TOO_LARGE = 13,
268 EVENT_CALIB_MEASUREMENT = 14,
269
272
276
279
282
285
288
291 };
292
293
294 virtual ~IAppRoboDK() {}
295
297 virtual QString PluginName()=0;
298
305 virtual QString PluginLoad(QMainWindow *mw, QMenuBar *menubar, QStatusBar *statusbar, IRoboDK *rdk, const QString &settings="")
306 {
307 Q_UNUSED(mw)
308 Q_UNUSED(menubar)
309 Q_UNUSED(statusbar)
310 Q_UNUSED(rdk)
311 Q_UNUSED(settings)
312 return QString();
313 };
314
316 // It is recommended to remove the toolbar and menus that were added by the plugin. It will help during de debugging process.
317 virtual void PluginUnload(){}
318
323 virtual void PluginLoadToolbar(QMainWindow *mw, int iconsize)
324 {
325 Q_UNUSED(mw)
326 Q_UNUSED(iconsize)
327 }
328
335 virtual bool PluginItemClick(Item item, QMenu *menu, TypeClick click_type)
336 {
337 Q_UNUSED(item)
338 Q_UNUSED(menu)
339 Q_UNUSED(click_type)
340 return false;
341 }
342
349 virtual QString PluginCommand(const QString &command, const QString &value)
350 {
351 Q_UNUSED(command)
352 Q_UNUSED(value)
353 return QString();
354 };
355
359 // Make sure to make this code as fast as possible to not provoke render lags
361 virtual void PluginEvent(TypeEvent event_type)
362 {
363 Q_UNUSED(event_type)
364 };
365
371 virtual bool PluginItemClickMulti(QList<Item> &item_list, QMenu *menu, TypeClick click_type)
372 {
373 Q_UNUSED(item_list)
374 Q_UNUSED(menu)
375 Q_UNUSED(click_type)
376 return false;
377 }
378
379};
380
381
382QT_BEGIN_NAMESPACE
383Q_DECLARE_INTERFACE(IAppRoboDK, "RoboDK.IAppRoboDK")
384QT_END_NAMESPACE
385
386
387
388
389
390#endif // IAPPROBODK_H
Interface to RoboDK. Each plugin must implement this class to establish the interface to RoboDK....
Definition iapprobodk.h:191
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.
Definition iapprobodk.h:371
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.
Definition iapprobodk.h:335
@ EVENT_PROGSLIDER_CHANGED
A program slider was opened, changed, or closed (RoboDK 5.6.4 required).
Definition iapprobodk.h:287
@ EVENT_ITEM_MOVED
Obsolete after RoboDK 4.2.0. Use EVENT_ITEM_MOVED_POSE instead.
Definition iapprobodk.h:255
@ EVENT_PROGSLIDER_SET
The index of a program slider changed (RoboDK 5.6.4 required).
Definition iapprobodk.h:290
@ EVENT_RENAME
The name of an item changed (RoboDK 5.6.3 required).
Definition iapprobodk.h:278
@ EVENT_STATIONCHANGED
A new robodk station was loaded (RoboDK 5.6.3 required).
Definition iapprobodk.h:284
@ EVENT_SETVISIBLE
The visibility state of an item changed (RoboDK 5.6.3 required).
Definition iapprobodk.h:281
@ EVENT_SELECTION3D_CLICK
An object in the 3D view was clicked on (right click, left click or double click),...
Definition iapprobodk.h:271
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 wi...
Definition iapprobodk.h:305
virtual void PluginUnload()
This function is called once only when the plugin is being unloaded.
Definition iapprobodk.h:317
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...
Definition iapprobodk.h:323
TypeEvent
Event types for PluginEvent function.
Definition iapprobodk.h:214
@ EventAbout2ChangeStation
The current RoboDK station is about to loose focus because the user requested to open a new station (...
Definition iapprobodk.h:235
@ EventAbout2CloseStation
Definition iapprobodk.h:239
@ EventTrajectoryStep
Definition iapprobodk.h:243
@ EventChangedStation
This event is triggered when we change the active station and a new station gains focus (IRoboDK::get...
Definition iapprobodk.h:228
@ EventMoved
Moved event: Something has moved, such as a robot, reference frame, object or tool....
Definition iapprobodk.h:221
virtual void PluginEvent(TypeEvent event_type)
This function is called every time there is a new RoboDK event such as rendering the screen,...
Definition iapprobodk.h:361
virtual QString PluginName()=0
Return the plugin name. Try to be creative and make sure the name is unique.
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 ...
Definition iapprobodk.h:349
TypeClick
Types of clicks for PluginItemClick function.
Definition iapprobodk.h:195
@ ClickRight
Right click.
Definition iapprobodk.h:207
@ ClickCtrlLeft
Ctrl Left click.
Definition iapprobodk.h:204
@ ClickDouble
Double click.
Definition iapprobodk.h:210
@ ClickLeft
Left click.
Definition iapprobodk.h:201
@ ClickNone
No click.
Definition iapprobodk.h:198
The Item class represents an item in RoboDK station. An item can be a robot, a frame,...
Definition iitem.h:14
This class is the iterface to the RoboDK API. With the RoboDK API you can automate certain tasks and ...
Definition irobodk.h:14