ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
JsonRPCPlugin Class Reference

Example qCC plugin. More...

#include <JsonRPCPlugin.h>

Inheritance diagram for JsonRPCPlugin:
Collaboration diagram for JsonRPCPlugin:

Public Slots

void triggered (bool checked)
 
JsonRPCResult execute (QString method, QMap< QString, QVariant > params)
 

Protected Attributes

JsonRPCServer rpc_server
 
- Protected Attributes inherited from ccStdPluginInterface
ecvMainAppInterfacem_app
 Main application interface. More...
 

Additional Inherited Members

- Public Types inherited from ccPluginInterface
typedef QList< ContactContactList
 
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 ecvMainAppInterfacegetMainAppInterface ()
 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 ccExternalFactorygetCustomObjectsFactory () 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())
 

Detailed Description

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.

Member Function Documentation

◆ execute

◆ triggered

void JsonRPCPlugin::triggered ( bool  checked)
slot

Definition at line 52 of file JsonRPCPlugin.cpp.

References JsonRPCServer::close(), JsonRPCServer::listen(), and rpc_server.

Member Data Documentation

◆ rpc_server

JsonRPCServer JsonRPCPlugin::rpc_server
protected

Definition at line 66 of file JsonRPCPlugin.h.

Referenced by triggered().


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