ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvPclPluginInterface.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // Qt
11 #include <QActionGroup>
12 #include <QWidget>
13 
14 // qCC_db
15 #include <ecvHObject.h>
16 
17 // qCC
19 #include "ecvMainAppInterface.h"
20 
22 
28 public:
30  ccPclPluginInterface(const QString& resourcePath = QString())
31  : ccDefaultPluginInterface(resourcePath), m_app(nullptr) {}
32 
34  virtual ~ccPclPluginInterface() = default;
35 
36  // inherited from ccPluginInterface
37  virtual CC_PLUGIN_TYPE getType() const override {
39  }
40 
42 
45  m_app = app;
46 
47  if (m_app) {
48  // we use the same 'unique ID' generator in plugins as in the main
49  // application (otherwise we'll have issues with 'unique IDs'!)
51  }
52  }
53 
55 
58 
60  virtual QVector<QList<QAction*>> getActions() = 0;
61 
62  virtual QVector<QString> getModuleNames() = 0;
63 
66 
69  virtual void onNewSelection(
71  selectedEntities) { /*ignored by default*/ }
72 
74  inline virtual void dispToConsole(
75  QString message,
78  if (m_app) {
79  m_app->dispToConsole(message, level);
80  }
81  }
82 
83 protected:
86 };
87 
89 
90 Q_DECLARE_INTERFACE(ccPclPluginInterface,
91  "edf.rd.cloudviewer.ccPclPluginInterface/1.4")
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
static void SetUniqueIDGenerator(ccUniqueIDGenerator::Shared generator)
Sets the unique ID generator.
Pcl ECV plugin interface.
virtual ~ccPclPluginInterface()=default
Destructor.
virtual void dispToConsole(QString message, ecvMainAppInterface::ConsoleMessageLevel level=ecvMainAppInterface::STD_CONSOLE_MESSAGE)
Shortcut to ecvMainAppInterface::dispToConsole.
ecvMainAppInterface * m_app
Main application interface.
virtual QVector< QString > getModuleNames()=0
virtual void onNewSelection(const ccHObject::Container &selectedEntities)
virtual CC_PLUGIN_TYPE getType() const override
Returns plugin type (standard or OpenGL filter)
virtual ecvMainAppInterface * getMainAppInterface()
A callback pointer to the main app interface for use by plugins.
virtual QVector< QList< QAction * > > getActions()=0
Get a list of actions for this plugin.
ccPclPluginInterface(const QString &resourcePath=QString())
Default constructor.
virtual void setMainAppInterface(ecvMainAppInterface *app)
Sets application entry point.
Main application interface (for plugins)
ConsoleMessageLevel
Console message level (see dispToConsole)
virtual void dispToConsole(QString message, ConsoleMessageLevel level=STD_CONSOLE_MESSAGE)=0
virtual ccUniqueIDGenerator::Shared getUniqueIDGenerator()=0
Returns the unique ID generator.
Q_DECLARE_METATYPE(ccPclPluginInterface *)
CC_PLUGIN_TYPE
Plugin type.
@ ECV_PCL_ALGORITHM_PLUGIN