![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Example qCC plugin. More...
#include <JsonRPCPlugin.h>


Public Slots | |
| void | triggered (bool checked) |
| JsonRPCResult | execute (QString method, QMap< QString, QVariant > params) |
Protected Attributes | |
| JsonRPCServer | rpc_server |
Protected Attributes inherited from ccStdPluginInterface | |
| ecvMainAppInterface * | m_app |
| Main application interface. More... | |
Additional Inherited Members | |
Public Types inherited from ccPluginInterface | |
| typedef QList< Contact > | ContactList |
| using | ReferenceList = QList< Reference > |
Public Member Functions inherited from ccStdPluginInterface | |
| ccStdPluginInterface (const QString &resourcePath=QString()) | |
| Default constructor. More... | |
| virtual | ~ccStdPluginInterface () override=default |
| Destructor. More... | |
| virtual CC_PLUGIN_TYPE | getType () const override |
| Returns plugin type (standard or OpenGL filter) More... | |
| virtual void | setMainAppInterface (ecvMainAppInterface *app) |
| Sets application entry point. More... | |
| virtual ecvMainAppInterface * | getMainAppInterface () |
| A callback pointer to the main app interface for use by plugins. More... | |
| virtual void | onNewSelection (const ccHObject::Container &selectedEntities) |
| virtual void | dispToConsole (QString message, ecvMainAppInterface::ConsoleMessageLevel level=ecvMainAppInterface::STD_CONSOLE_MESSAGE) |
| Shortcut to ecvMainAppInterface::dispToConsole. More... | |
Public Member Functions inherited from ccDefaultPluginInterface | |
| virtual | ~ccDefaultPluginInterface () |
| virtual bool | isCore () const override |
| Is this plugin a core plugin? More... | |
| virtual QString | getName () const override |
| Returns (short) name (for menu entry, etc.) More... | |
| virtual QString | getDescription () const override |
| Returns long name/description (for tooltip, etc.) More... | |
| virtual QIcon | getIcon () const override |
| Returns icon. More... | |
| virtual ReferenceList | getReferences () const override |
| virtual ContactList | getAuthors () const override |
| virtual ContactList | getMaintainers () const override |
Public Member Functions inherited from ccPluginInterface | |
| virtual | ~ccPluginInterface ()=default |
| Virtual destructor. More... | |
| virtual bool | start () |
| Starts the plugin. More... | |
| virtual void | stop () |
| Stops the plugin. More... | |
| virtual ccExternalFactory * | getCustomObjectsFactory () const |
| Returns the plugin's custom object factory (if any) More... | |
| virtual void | registerCommands (ccCommandLineInterface *cmd) |
| Optional: registers commands (for the command line mode) More... | |
Protected Member Functions inherited from ccDefaultPluginInterface | |
| ccDefaultPluginInterface (const QString &resourcePath=QString()) | |
Example qCC plugin.
Replace 'ExamplePlugin' by your own plugin class name throughout and then check 'ExamplePlugin.cpp' for more directions.
Each plugin requires an info.json file to provide information about itself - the name, authors, maintainers, icon, etc..
The one method you are required to implement is 'getActions'. This
should return all actions (QAction objects) for the plugin. ACloudViewer will automatically add these with their icons in the plugin toolbar and to the plugin menu. If your plugin returns several actions, CC will create a dedicated toolbar and a sub-menu for your plugin. You are responsible for connecting these actions to methods in your plugin.
Use the ccStdPluginInterface::m_app variable for access to most of the
CC components (database, 3D views, console, etc.) - see the ecvMainAppInterface class in ecvMainAppInterface.h.
Definition at line 32 of file JsonRPCPlugin.h.
|
slot |
Definition at line 62 of file JsonRPCPlugin.cpp.
References ecvMainAppInterface::addToDB(), FileIOFilter::LoadParameters::alwaysDisplayLoadDialog, ccHObject::applyGLTransformation_recursive(), CC_FERR_NO_ERROR, FileIOFilter::LoadParameters::coordinatesShift, FileIOFilter::LoadParameters::coordinatesShiftEnabled, ecvMainAppInterface::dbRootObject(), ecvGlobalShiftManager::DIALOG_IF_NECESSARY, JsonRPCResult::error(), filename, ccHObject::filterChildren(), ecvMainAppInterface::getActiveWindow(), ccHObject::getChild(), FileIOFilter::LoadFromFile(), ccStdPluginInterface::m_app, params, FileIOFilter::LoadParameters::parentWidget, CV_TYPES::POINT_CLOUD, ecvDisplayTools::RedrawDisplay(), ecvMainAppInterface::removeFromDB(), result, ccDrawableObject::setGLTransformation(), FileIOFilter::LoadParameters::shiftHandlingMode, JsonRPCResult::success(), ccGLMatrixTpl< T >::toString(), and e57::toString().
|
slot |
Definition at line 52 of file JsonRPCPlugin.cpp.
References JsonRPCServer::close(), JsonRPCServer::listen(), and rpc_server.
|
protected |
Definition at line 66 of file JsonRPCPlugin.h.
Referenced by triggered().