ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvPluginInterface.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 <QIcon>
12 #include <QList>
13 #include <QObject>
14 #include <QPair>
15 #include <QString>
16 
17 // Qt version
18 #include <qglobal.h>
19 
20 class ccExternalFactory;
22 
28 };
29 
31 
34 public:
35  // Contact represents a person and is used for authors and maintainer lists
36  struct Contact {
37  QString name;
38  QString email;
39  };
40 
41  typedef QList<Contact> ContactList;
42 
43  // Reference represents a journal article or online post about the plugin
44  // where the user can find more information.
45  struct Reference {
46  QString article;
47  QString url;
48  };
49 
50  using ReferenceList = QList<Reference>;
51 
52 public:
54  virtual ~ccPluginInterface() = default;
55 
57  virtual CC_PLUGIN_TYPE getType() const = 0;
58 
60  virtual bool isCore() const = 0;
61 
63  virtual QString getName() const = 0;
64 
66  virtual QString getDescription() const = 0;
67 
69 
71  virtual QIcon getIcon() const { return QIcon(); }
72 
77  virtual ReferenceList getReferences() const { return ReferenceList{}; }
78 
83  virtual ContactList getAuthors() const { return ContactList{}; }
84 
89  virtual ContactList getMaintainers() const { return ContactList{}; }
90 
92 
96  virtual bool start() { return true; }
97 
99 
103  virtual void stop() {}
104 
106 
112  return nullptr;
113  }
114 
116 
122  Q_UNUSED(cmd);
123  }
124 
125 protected:
126  friend class ccPluginManager;
127 
130  virtual void setIID(const QString& iid) = 0;
131 
133  virtual const QString& IID() const = 0;
134 };
135 
137 
138 Q_DECLARE_INTERFACE(ccPluginInterface,
139  "edf.rd.cloudviewer.ccPluginInterface/3.2")
Command line interface.
Standard ECV plugin interface.
virtual QString getDescription() const =0
Returns long name/description (for tooltip, etc.)
virtual bool start()
Starts the plugin.
QList< Reference > ReferenceList
virtual CC_PLUGIN_TYPE getType() const =0
Returns plugin type (standard or OpenGL filter)
virtual ContactList getAuthors() const
virtual ~ccPluginInterface()=default
Virtual destructor.
virtual const QString & IID() const =0
Get the IID of the plugin.
virtual void stop()
Stops the plugin.
virtual bool isCore() const =0
Is this plugin a core plugin?
virtual ContactList getMaintainers() const
virtual void registerCommands(ccCommandLineInterface *cmd)
Optional: registers commands (for the command line mode)
virtual ReferenceList getReferences() const
virtual QIcon getIcon() const
Returns icon.
virtual ccExternalFactory * getCustomObjectsFactory() const
Returns the plugin's custom object factory (if any)
virtual QString getName() const =0
Returns (short) name (for menu entry, etc.)
QList< Contact > ContactList
virtual void setIID(const QString &iid)=0
Q_DECLARE_METATYPE(const ccPluginInterface *)
CC_PLUGIN_TYPE
Plugin type.
@ ECV_STD_PLUGIN
@ ECV_IO_FILTER_PLUGIN
@ ECV_PCL_ALGORITHM_PLUGIN