ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PythonInterpreter Class Referencefinal

#include <PythonInterpreter.h>

Inheritance diagram for PythonInterpreter:
[legend]
Collaboration diagram for PythonInterpreter:
[legend]

Classes

struct  State
 Variable state. More...
 

Public Slots

bool executeFile (const std::string &filePath)
 Execution functions (and slots) More...
 
void executeCode (const std::string &code, QListWidget *output)
 
void executeCodeWithState (const std::string &code, QListWidget *output, PythonInterpreter::State &state)
 
void executeStatementWithState (const std::string &code, QListWidget *output, PythonInterpreter::State &state)
 
void executeFunction (const pybind11::object &function)
 

Signals

void executionStarted ()
 
void executionFinished ()
 

Public Member Functions

 PythonInterpreter (QObject *parent=nullptr)
 
bool isExecuting () const
 
void initialize (const PythonConfig &config)
 
void finalize ()
 
const PythonConfigPaths & config () const
 

Static Public Member Functions

static bool IsInitialized ()
 

Detailed Description

PythonInterpreter.

There should be only one, and it is managed by the PythonPlugin. It centralizes the execution of python scripts.

Only one script can be executed at a time.

Classes that allow user to start the execution of a script should connect the executionStarted & executionFinished to give feedback on when a script is running and whether a new script can be ran

Constructor & Destructor Documentation

◆ PythonInterpreter()

PythonInterpreter::PythonInterpreter ( QObject *  parent = nullptr)
explicit

Member Function Documentation

◆ config()

const PythonConfigPaths & PythonInterpreter::config ( ) const

Referenced by initialize().

◆ executeCode

void PythonInterpreter::executeCode ( const std::string &  code,
QListWidget *  output 
)
slot

◆ executeCodeWithState

void PythonInterpreter::executeCodeWithState ( const std::string &  code,
QListWidget *  output,
PythonInterpreter::State &  state 
)
slot

Referenced by executeCode().

◆ executeFile

bool PythonInterpreter::executeFile ( const std::string &  filePath)
slot

Execution functions (and slots)

References CreateGlobals(), e, executionFinished(), executionStarted(), and CVLog::Warning().

Referenced by PythonPluginCommand::process().

◆ executeFunction

void PythonInterpreter::executeFunction ( const pybind11::object &  function)
slot

◆ executeStatementWithState

void PythonInterpreter::executeStatementWithState ( const std::string &  code,
QListWidget *  output,
PythonInterpreter::State &  state 
)
slot

Referenced by PythonRepl::executeCode().

◆ executionFinished

◆ executionStarted

◆ finalize()

void PythonInterpreter::finalize ( )

◆ initialize()

◆ isExecuting()

bool PythonInterpreter::isExecuting ( ) const

◆ IsInitialized()

bool PythonInterpreter::IsInitialized ( )
static

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