Actin®  Version 5.2.0
Software for Robotics Simulation and Control
exampleGUIPlugin Class Reference

A Qt-based GUI plugin example for creating code that will interface with Energid's viewer. More...

#include <exampleGUIPlugin.h>

Inheritance diagram for exampleGUIPlugin:
Ec::PluginGUI Ec::Plugin

Protected Slots

void onActionButtonPressed (bool checked)
 

Protected Member Functions

 exampleGUIPlugin ()
 Constructor.
 
 ~exampleGUIPlugin ()
 Destructor.
 
EcBoolean init () EC_OVERRIDE
 
- Protected Member Functions inherited from Ec::PluginGUI
 PluginGUI ()
 Constructor. Disallow public construction. Use PluginManager::loadPlugin() instead. More...
 
virtual ~PluginGUI ()
 
EcBoolean addDockWidget (Qt::DockWidgetArea area, QDockWidget *pWidget)
 
EcBoolean removeDockWidget (QDockWidget *pWidget)
 
EcBoolean addCustomDockWidget (Qt::DockWidgetArea area, EcDockWidget *pWidget)
 
EcBoolean removeCustomDockWidget (EcDockWidget *pWidget)
 
EcBoolean addToolBar (QToolBar *toolbar, const QString &beforeTB="")
 
EcBoolean addToolBar (Qt::ToolBarArea toolbarArea, QToolBar *toolbar)
 
EcBoolean removeToolBar (QToolBar *toolbar)
 
EcBoolean addToToolBar (QAction *action, const QString &toolbar="miscellaneousToolBar")
 Adds an action to the specified toolbar. More...
 
QAction * addWidgetToToolBar (QWidget *pWidget, Qt::ToolBarArea toolbarArea=Qt::TopToolBarArea, const QString &toolbarName="miscellaneousToolBar")
 Adds the widget to the specified toolbar.
 
EcBoolean addToStatusBar (QWidget *widget, const EcBoolean isPermanent=EcFalse)
 
virtual EcBoolean addTab (QWidget *pWidget, const QString &displayName, const QString &before="")
 
QMenu * getOrAddMenu (const QString &name, const QString &beforeName="")
 
void insertActionInSubMenu (const QString &menuName, const QString &beforeMenuName, QAction *action, const QString &subMenuName)
 Convenience method to add a action in a sub menu under a main menu, If the submenu does not exist, it creates and adds the action. More...
 
QAction * insertActionBefore (const QString &menuName, const QString &beforeMenuName, const QString &actionName, const QString &beforeActionName)
 
QMenu * insertSubMenuBefore (const QString &menuName, const QString &beforeMenuName, const QString &subMenuToInsert, const QString &beforeActionName)
 
- Protected Member Functions inherited from Ec::Plugin
EC_PLUGIN_DECL_SPEC Plugin ()
 Constructor. Disallow public construction. Use PluginManager::loadPlugin() instead.
 
virtual EC_PLUGIN_DECL_SPEC ~Plugin ()
 
virtual void threadingStarted (EcIODataBroker *dataBroker)
 
virtual void threadsStopping (EcIODataBroker *dataBroker)
 
virtual EC_PLUGIN_DECL_SPEC EcString pluginID ()
 

Additional Inherited Members

- Public Types inherited from Ec::PluginGUI
typedef boost::shared_ptr< EcBaseViewerMainWidgetViewerPtr
 Provide a convenient way for plugins to get a shared handle.
 
typedef boost::shared_ptr< const EcBaseViewerMainWidgetConstViewerPtr
 
typedef boost::weak_ptr< EcBaseViewerMainWidgetWeakViewerPtr
 
- Public Types inherited from Ec::Plugin
enum  PluginTraitsEnum {
  TraitDefault = 0x00,
  TraitHardware = 0x01,
  TraitGUI = 0x02,
  TraitRemoteHardware = 0x04,
  TraitPermanent = 0x10,
  TraitWinPermanent = 0x20,
  TraitNoThread = 0x40,
  TraitGUIThread = 0x80,
  TraitCopySystem = 0x100,
  TraitMask = 0x1ff
}
 
typedef EcU32 PluginTraits
 
- Public Slots inherited from Ec::PluginGUI
void setSimulationModified (EcBoolean modified)
 Enables confirm on close.
 
void onSensorInput (EcSG3DInputData *)
 Input device data.
 
virtual void translateUI ()
 
- Public Member Functions inherited from Ec::PluginGUI
EcBoolean initGUI (QMainWindow *pWin, simulationPlugin *pSim)
 
ViewerPtr viewerPtr ()
 
ConstViewerPtr viewerPtr () const
 
virtual void update (const EcReal time) EC_OVERRIDE
 
virtual EcBoolean addMenuToolBarEntry ()
 All the menu actions, toolbar actions for the ui plugin can be added here.
 
template<typename T >
EC_GUICOMMON_VIEWERCORE_DECL T * getPtr (const QString &name="")
 
osg::ref_ptr< osg::Group > getNode (const EcU32 manIndex=-1, const EcU32 linkIndex=-1, const EcBoolean getPrimaryFrame=EcFalse, const EcString &namedFrame="")
 
template<GuiParamTypeEnum prm>
EC_GUICOMMON_VIEWERCORE_DECL EcBoolean connectSignal (const char *value, QObject *owner=NULL)
 
template<GuiParamTypeEnum prm>
EC_GUICOMMON_VIEWERCORE_DECL EcBoolean disconnectSignal (QObject *owner, const char *value)
 
EcBoolean enableWithFile (QObject *obj)
 
EcBoolean disableForReader (QObject *obj)
 
EcBoolean disableOnSimulation (QObject *obj)
 
QWidget * setCentralWidget (QWidget *widget)
 
void addAutoCleanup (QObject *obj)
 
void removeAutoCleanup (QObject *obj)
 Remove the Qt-based object from the auto-cleanup list. More...
 
void addAutoCleanup (osg::Referenced *ref)
 
void addAutoCleanup (osgGA::GUIEventHandler *handler)
 
const QRect screenGeometry () const
 Returns the center of the screen on which the plugin (i.e. Viewer) is displayed.
 
void cleanupOsgObjects ()
 
virtual EcBoolean save (EcBoolean toSave)
 
virtual EcBoolean hasUnsavedData ()
 This API can be used to identify any unsaved data in a plugin.
 
- Public Member Functions inherited from Ec::Plugin
virtual const EcStringpluginName () const
 Retrieve the name of this plugin.
 
virtual PluginTraits traits () const
 Retrieve the type and version number for this plugin.
 
virtual void setConfigurationString (const EcString &str)
 
virtual EcString getConfigurationString () const
 
virtual EcBoolean readConfigurationString (EcXmlReader &stream)
 
virtual EcBoolean writeConfigurationString (EcXmlWriter &stream) const
 
virtual EcBoolean initState ()
 
virtual EcBoolean reset ()
 
virtual EcBoolean shutdown ()
 
EcU32 updatePeriodInMs () const
 
EcBoolean initialized () const
 
void setExtrapolationTime (const EcReal time)
 
EcReal extrapolationTime () const
 
AsyncThreadgetThread ()
 Get a pointer to the Ec::AsyncThread class for real time manipulation.
 
virtual void setIOBuffer (IOBuffer *pBuffer)
 Set a pointer to the IO buffer.
 
virtual IOBuffergetIOBuffer ()
 Get pointer to the IO buffer.
 
virtual const IOBuffergetIOBuffer () const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean setParam (const EcU32 manIndex, const EcU32 subIndex, const EcU32 subSubIndex, const ParamType &value)
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean setParam (const EcU32 manIndex, const EcU32 subIndex, const EcString &key, const ParamType &value)
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean setParam (const EcU32 manIndex, const EcU32 subIndex, const ParamType &value)
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean setParam (const EcU32U32PairVector &manipLinkIndexVector, const ParamType &value)
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean setParam (const EcU32 manIndex, const ParamType &value)
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean setParam (const EcString &key, const ParamType &value)
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean setParam (const ParamType &value)
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean getParam (const EcU32 manIndex, const EcU32 subIndex, const EcU32 subSubIndex, ParamType &value) const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean getParam (const EcU32 manIndex, const EcU32 subIndex, const EcString &key, ParamType &value) const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean getParam (const EcU32 manIndex, const EcU32 subIndex, ParamType &value) const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean getParam (const EcU32U32PairVector &manipLinkIndexVector, ParamType &value) const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean getParam (const EcU32 manIndex, ParamType &value) const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean getParam (const EcString &key, ParamType &value) const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC EcBoolean getParam (ParamType &value) const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC const ParamType param () const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC const ParamType * paramPtr () const
 
template<EcU32 prm, typename ParamType >
EC_PLUGIN_DECL_SPEC boost::shared_ptr< const ParamType > paramScopedPtr () const
 
- Static Public Member Functions inherited from Ec::Plugin
static EC_PLUGIN_DECL_SPEC PlugingetPlugin (const EcString &pluginName)
 
static EC_PLUGIN_DECL_SPEC PluginfindPlugin (const EcString &pluginName)
 
- Static Public Attributes inherited from Ec::Plugin
static const EcU8 currentVersion = EC_VERSION_MAJOR
 
- Protected Attributes inherited from Ec::Plugin
EcString m_Name
 Name of the plugin.
 
PluginTraits m_PluginTraits
 Describes the capabilities of this plugin.
 
EcU32 m_UpdatePeriodInMs
 Dictates how often this plugin gets updates.
 
EcStringVector m_RequiredPlugins
 List of plugins that this plugin depends on.
 
EcBoolean m_Initialized
 Whether the plugin initialized properly.
 
IOBufferm_pBuffer
 Internal data caching mechanism.
 
EcU32 m_StatedSystemCopyIndex
 Index of the copy of the stated system used.
 
EcReal m_ExtrapolationTime
 The delta time used for joint position extrapolation.
 
AsyncThreadm_pAsyncThread
 Asynchronous base thread.
 

Detailed Description

A Qt-based GUI plugin example for creating code that will interface with Energid's viewer.

This plugin is mostly an output plugin, but it does set an initial state on startup to initialize the joint angles.

It utilizes the Qt windowing toolkit for the UI controls. Since most Qt window-specific calls need to be issued in the main application thread, a separate process is not spawned by default. Actions are typically handled through Qt's signal/slot mechanism.

Examples:
exampleGUIPlugin.cpp.

Definition at line 24 of file exampleGUIPlugin.h.

Member Function Documentation

EcBoolean exampleGUIPlugin::init ( )
protectedvirtual

Initialize plugin. Called before first use.

Returns
EcBoolean Success or failure of reset command.

Reimplemented from Ec::Plugin.

Examples:
exampleGUIPlugin.cpp.

The documentation for this class was generated from the following file:
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.