 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
33 Q_PLUGIN_METADATA(IID
"ecvcorp.cloudviewer.plugin.PythonRuntime" FILE
"../info.json")
55 void finalizeInterpreter();
57 void showEditor()
const;
58 void showAboutDialog()
const;
59 void showFileRunner()
const;
60 void showPackageManager();
61 void showPythonActionLauncher()
const;
62 void showSettings()
const;
63 static void showDocumentation();
66 void addScriptAction();
67 void addScript(QString
path);
68 void executeScript(QString
path);
69 void removeScript(QString
name, QAction *
self);
71 void populatePluginSubMenu();
73 void handlePluginActionClicked(
bool checked);
74 void handlePythonExecutionStarted();
75 void handlePythonExecutionFinished();
89 QAction *m_showEditor{
nullptr};
90 QAction *m_showRepl{
nullptr};
91 QAction *m_showDoc{
nullptr};
92 QAction *m_showFileRunner{
nullptr};
93 QAction *m_showAboutDialog{
nullptr};
94 QAction *m_showPackageManager{
nullptr};
95 QAction *m_showActionLauncher{
nullptr};
96 QAction *m_showSettings{
nullptr};
99 QMenu *m_drawScriptRegister{
nullptr};
100 QMenu *m_pluginsMenu{
nullptr};
103 std::map<const QAction *, const Runtime::RegisteredPlugin::Action *> m_pluginActions;
106 QAction *m_addScript{
nullptr};
107 QMenu *m_removeScript{
nullptr};
108 std::map<QString, QAction *> m_scriptList;
109 QStringList m_savedPath;
110 QString m_saveFilePath;
Definition: PythonRuntimeSettings.h:16
void * bytes
Definition: TriangleMeshBuffers.cpp:159
QList< QAction * > getActions() override
Get a list of actions for this plugin.
Definition: PythonPlugin.cpp:136
#define PACKAGE_MANAGER_ICON_PATH
Definition: Resources.h:19
void loadPluginsFrom(const QStringList &paths)
Definition: PythonPluginManager.cpp:117
#define SETTINGS_ICON_PATH
Definition: Resources.h:23
Definition: FileRunner.h:22
std::vector< wchar_t * > pythonArgv
Definition: PythonPlugin.cpp:466
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:181
#define PYPLUGIN_ICON_PATH
Definition: Resources.h:24
virtual QMainWindow * getMainWindow()=0
Returns main window.
PluginLogger< CVLog::LOG_ERROR > plgError
Definition: Utilities.h:103
virtual bool error(const QString &message) const =0
Type type() const
Definition: PythonConfig.h:84
wchar_t * QStringToWcharArray(const QString &string)
Returns a newly allocated wchar_t array (null terminated) from a QString.
Definition: Utilities.h:106
bool process(ccCommandLineInterface &cmd) override
Main process.
Definition: PythonPlugin.cpp:440
void loadPluginsFromEntryPoints()
Definition: PythonPluginManager.cpp:21
const std::vector< Runtime::RegisteredPlugin > & plugins() const
Returns the currently loaded plugins.
Definition: PythonPluginManager.cpp:16
virtual void setMainAppInterface(ecvMainAppInterface *app)
Sets application entry point.
Definition: ecvStdPluginInterface.h:46
void finalize()
Definition: PythonInterpreter.cpp:298
#define REPL_ICON_PATH
Definition: Resources.h:15
void initBundled()
Definition: PythonConfig.cpp:202
void stop() override
Stops the plugin.
Definition: PythonPlugin.cpp:128
PythonPlugin & operator=(const PythonPlugin &)=delete
static std::unique_ptr< QSettings > LoadSettings()
Definition: PythonPlugin.cpp:121
void unsetMainAppInterfaceInstance() noexcept
Unsets the app interface pointer.
Definition: Runtime.cpp:90
#define ACTION_LAUNCHER_ICON_PATH
Definition: Resources.h:21
int size
Definition: FileIOFactory.cpp:130
void setMainAppInterfaceInstance(ecvMainAppInterface *appInterface) noexcept(false)
Definition: Runtime.cpp:82
#define ABOUT_ICON_PATH
Definition: Resources.h:13
Definition: PythonInterpreter.h:32
Main application interface (for plugins)
Definition: ecvMainAppInterface.h:24
Definition: PackageManager.h:22
Definition: AboutDialog.h:14
QString name
Name to be displayed in the UI.
Definition: Runtime.h:32
bool isDefaultPythonEnv() const
Definition: PythonRuntimeSettings.cpp:276
static const std::string path
Definition: PointCloud.cpp:59
const double * e
Definition: essential_matrix_poly.h:10
QSharedPointer< Command > Shared
Shared type.
Definition: ecvCommandLineInterface.h:132
bool parseFrom(ccCommandLineInterface &cmd)
Definition: PythonPlugin.cpp:470
#define PYSCRIPTS_REGISTER_ICON_PATH
Definition: Resources.h:26
ecvMainAppInterface * m_app
Main application interface.
Definition: ecvStdPluginInterface.h:85
void initialize(const PythonConfig &config)
Definition: PythonInterpreter.cpp:173
static bool SetIconFromPyObject(T *iconReceiver, const py::object &pyIcon)
Definition: PythonPlugin.cpp:618
bool validateAndDisplayErrors(QWidget *parent=nullptr) const
Definition: PythonConfig.cpp:348
~PythonPlugin() noexcept override
Definition: PythonPlugin.cpp:427
void executeFunction(const pybind11::object &function)
Definition: PythonInterpreter.cpp:150
QString filepath
Definition: PythonPlugin.cpp:465
void LogPythonHome()
Logs the PYTHON_HOME the log console of ACloudViewer.
Definition: Utilities.h:140
#define DOCUMENTATION_ICON_PATH
Definition: Resources.h:16
Definition: PythonActionLauncher.h:18
Definition: PythonConfig.h:71
#define PYSCRIPT_ICON_PATH
Definition: Resources.h:32
Generic command interface.
Definition: ecvCommandLineInterface.h:130
static bool IsInsideEnvironment()
Definition: PythonConfig.cpp:380
virtual ~Args()
Definition: PythonPlugin.cpp:488
virtual QStringList & arguments()=0
Returns the list of arguments.
Definition: PythonPlugin.cpp:433
virtual void print(const QString &message) const =0
#define EDITOR_ICON_PATH
Definition: Resources.h:14
"Entry point" of the plugin
Definition: PythonPlugin.h:28
#define ADD_PYSCRIPT_ICON_PATH
Definition: Resources.h:28
void unloadPlugins()
This MUST be called before finalizing the interpreter.
Definition: PythonPluginManager.cpp:187
Command line interface.
Definition: ecvCommandLineInterface.h:112
pybind11::object icon
Optional path or (bytes, str) where str is the format.
Definition: Runtime.h:36
static PythonConfig fromContainingEnvironment()
Definition: PythonConfig.cpp:385
PythonInterpreter * interpreter
Definition: PythonPlugin.cpp:497
Standard ECV plugin interface.
Definition: ecvPluginInterface.h:33
void LogPythonPath()
Logs the PYTHON_PATH the log console of ACloudViewer.
Definition: Utilities.h:116
void unsetCmdLineInterfaceInstance() noexcept
Unsets the pointer to the cmdline app interface.
Definition: Runtime.cpp:107
PluginLogger< CVLog::LOG_STANDARD > plgPrint
Definition: Utilities.h:100
bool executeFile(const std::string &filePath)
Execution functions (and slots)
Definition: PythonInterpreter.cpp:52
Command(const QString &name, const QString &keyword)
Default constructor.
Definition: ecvCommandLineInterface.cpp:225
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
Homemade REPL (Read Print Eval Loop)
Definition: PythonRepl.h:58
Definition: PythonEditor.h:50
PythonPluginCommand(PythonInterpreter *interpreter_)
Definition: PythonPlugin.cpp:435
PluginLogger< CVLog::LOG_WARNING > plgWarning
Definition: Utilities.h:102
#define PLUGIN_INFO_PATH
Definition: Resources.h:12
static QIcon CreateQIconFromPyObject(const py::object &pyIcon)
Definition: PythonPlugin.cpp:554
void setMainAppInterface(ecvMainAppInterface *app) override
Sets application entry point.
Definition: PythonPlugin.cpp:509
#define REMOVE_PYSCRIPT_ICON_PATH
Definition: Resources.h:30
PythonPlugin(QObject *parent=nullptr)
Definition: PythonPlugin.cpp:36
static bool IsInitialized()
Definition: PythonInterpreter.cpp:293
virtual bool registerCommand(Command::Shared command)=0
Registers a new command.
QStringList pluginsPaths() const
Definition: PythonRuntimeSettings.cpp:244
Definition: PythonPluginManager.h:16
Standard ECV plugin interface.
Definition: ecvStdPluginInterface.h:31
void setCmdLineInterfaceInstance(ccCommandLineInterface *cmdLine) noexcept
Definition: Runtime.cpp:99
Definition: PythonPlugin.cpp:463
#define RUNNER_ICON_PATH
Definition: Resources.h:18
PythonConfig pythonEnvConfig() const
Definition: PythonRuntimeSettings.cpp:249
void registerCommands(ccCommandLineInterface *cmd) override
Definition: PythonPlugin.cpp:500
std::string name
Definition: FileIOFactory.cpp:129