5 #include "pybind11/operators.h"
6 #include "pybind11/pybind11.h"
7 #include "pybind11/stl.h"
8 #include "pybind11/stl_bind.h"
10 namespace py = pybind11;
18 #ifdef PYBIND11_MODULE
19 PYBIND11_MODULE(dot_viewer, m)
21 m.doc() =
"Plugin to visualize .dot graphs within the HAL GUI.";
25 py::module m(
"dot_viewer",
"Plugin to visualize .dot graphs within the HAL GUI.");
28 py::class_<DotViewerPlugin, RawPtrWrapper<DotViewerPlugin>,
BasePluginInterface> py_dotviewer_plugin(
29 m,
"DotViewerPlugin", R
"(This class provides an interface to integrate a ``.dot`` viewer as a plugin within the HAL framework.)");
32 The name of the plugin.
38 Get the name of the plugin.
40 :returns: The name of the plugin.
45 The version of the plugin.
51 Get the version of the plugin.
53 :returns: The version of the plugin.
58 The description of the plugin.
64 Get the description of the plugin.
66 :returns: The description of the plugin.
71 A set of plugin names that this plugin depends on.
77 Get a set of plugin names that this plugin depends on.
79 :returns: A set of plugin names that this plugin depends on.
85 [](
const std::filesystem::path& path,
const std::string& creator_plugin =
"") ->
bool {
95 log_error(
"python_context",
"Cannot find dot viewer instance.");
100 py::arg(
"creator_plugin") = std::string(),
102 Loads a dot file in the graphic viewer provided by dot_viewer plugin.
104 :param pathlib.Path path: The path to the ``.dot`` file.
105 :param str creator_plugin: The name of plugin that created the ``.dot`` file. Will try to detect from content or query by popup if empty.
106 :returns: ``True`` on success, ``False`` otherwise.
110 #ifndef PYBIND11_MODULE
static DotViewer * getDotviewerInstance()
bool loadDotFile(const QString &fileName, const QString &creator=QString())
std::string get_description() const override
Get a short description of the plugin.
std::string get_name() const override
Get the name of the plugin.
std::string get_version() const override
Get the version of the plugin.
std::set< std::string > get_dependencies() const override
Get the plugin dependencies.
#define log_error(channel,...)
const Module * module(const Gate *g, const NodeBoxes &boxes)
QString fromStdString(const std::string &str)