![]() |
Noether
0.0.0
|
The GUI package is a Qt
-based framework that allows user-developed plugins to provide UI elements for configuring the tool path planning components. This framework has hooks for displaying widgets for all available mesh modifiers, tool path planners, and tool path modifiers.
At run-time, the GUI searches for plugins that can provide the widgets to configure these tool path planning components. The GUI automatically finds plugins defined in this repository. User-developed plugins can also be found by the GUI by adding the names of the plugin libraries to the NOETHER_PLUGIN_LIBS
environment variable.
This plugin-based GUI architecture allows end-users to leverage the out-of-the-box GUI infrastructure and plugins, while still enabling private development of custom capabilities or customizations to the front-end of existing classes.
The GUI package provides the definitions of Qt
widgets that are capable of producing each type of tool path planning component. BaseWidget is the template class that defines this widget. Widget Interfaces lists the instantiations of the BaseWidget
template for each tool path planning component type (e.g., mesh modifier, tool path planner, tool path modifier). Each implementation of a tool path planning component should provide a widget capable of configuring it. This widget must inherit from the appropriate BaseWidget
template.
For example, PlaneSlicerRasterPlanner has an associated widget PlaneSlicerRasterPlannerWidget that inherits from ToolPathPlannerWidget. This widget's create method produces a configured instance of a PlaneSlicerRasterPlanner.
To allow users to develop their own private implementations of tool path planning components and have them appear in the GUI, all widgets are loaded into the GUI application at runtime via plugin. This plugin class is defined as the template WidgetPlugin. Widget Plugin Interfaces lists the instantiations of the WidgetPlugin
template for each tool path planning component type (e.g., mesh modifier, tool path planner, tool path modifier).
The GUI itself finds available widget plugins (via the NOETHER_PLUGIN_LIBS
environment variable), loads them, and uses them to produce widgets to populate the various pages of the GUI. Just as each of the tool path planning components has a corresponding BaseWidget
to configure it, each BaseWidget
should also have a corresponding WidgetPlugin
that produces the BaseWidget
to allow it to be loaded into the GUI.
Extending the example from the previous section, the plugin that creates a PlaneSlicerRasterPlannerWidget
is PlaneSlicerRasterPlannerWidgetPlugin
, defined in noether_gui/src/plugins.cpp.
Widget plugins must be exported by calling the respective macro (based on the template type of the plugin) with the plugin class type name and an arbitrary alias name for referring to the plugin:
See noether_gui/src/plugins.cpp for examples of defining and exporting GUI plugins.
NOETHER_PLUGIN_LIBS
. For example, if custom plugins were compiled in a library called libmy_noether_plugins.so
, then set the environment variable to export NOETHER_PLUGIN_LIBS=my_noether_plugins
.The image below shows the architecture of the GUI components described in the previous sections.
Custom behavior can be added by providing a class that overrides one of these defined interfaces. See the current implementations in Mesh Modifier Widgets, Tool Path Planner Widgets, and Tool Path Modifier Widgets for reference.
Modules | |
Widgets | |
Instantiations of the BaseWidget interface. | |
Widget Plugins | |
Instantiations of the WidgetPlugin interface. | |