![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/DataController.h>
Specialization of the Controller interface to be used with Data instances. More...
Inheritance diagram for DataController:Specialization of the Controller interface to be used with Data instances.
A DataController is supposed to provide a GUI enabling the user to configure and control Data instances of the parent MainWindowBase. In contrast to AlgorithmControllers, a DataController should be selection-sensitive meaning that it controls the currently selected Data instance. Therefore, you can use the following callbacks from the base class:
Since a Controller has access to MainWindowBase it can also react to all kinds of events but this should be used sparingly. The main purpose of a DataController is to provide a custom GUI for Data instances. Logic regarding how to display a particular type of Data should be implemented using the DataDisplayHandler interface where possible!
DataControllers are a very powerful tool and can serve as customization point to provide an additional user interface. Assume you have a custom Data type where you would like to offer a custom GUI to change properties of the Data instance and/or launch any kind of functionality. In DataController::createCompatible() you would check for the presence of that DataComponent and create a DataController instance accordingly. In DataController::onSelectedDataChanged() you get notified about the currently selected data and can update GUI state/internal bookkeeping. In cases where the DataDisplayHandler interface is not sufficient you could implement functionality for managing custom renderers in DataController::onVisibleDataChanged().
Public Member Functions | |
| std::string | title () const override |
| Returns the shown widget title if the controller is shown in a mode that supports this (e.g. | |
| std::string | factoryName () const |
| Returns the name used to identify this DataController in the factory. | |
| void | setFactoryName (const std::string &factoryName) |
| Sets the name used to identify this DataController in the factory. | |
| std::vector< Location > | supportedLocations () const override |
| Returns the list of locations in which this controller is allowed to be placed by the parent MainWindowBase. | |
| Location | preferredLocation () const override |
| Returns the preferred location in which the parent MainWindowBase should place this controller. | |
Public Member Functions inherited from Controller | |
| void | setMainWindowBase (MainWindowBase *mw) |
Complete the initialization by providing the parent MainWindowBase instance hosting the controller by setting m_main and m_disp and eventually call init(). | |
| virtual void | onSelectedDataChanged (const DataList &) |
| Called by MainWindowBase in the case that the selection in the data model has changed. | |
| virtual void | onVisibleDataChanged (const DataList &) |
| Called by MainWindowBase in the case that the currently visible data has changed. | |
| virtual void | onLocationChanged (Location newLocation) |
| Callback function called by the parent MainWindowBase/ControllerDecorator whenever the place was changed. | |
| Location | location () const |
| Convenience function to query the current controller Location from the parent ControllerDecorator. | |
| ControllerDecorator * | getDecorator () const |
Convenience function to return m_main->getControllerDecorator(this) if m_main is set or nullptr otherwise. | |
| template<typename T> | |
| T * | getDecorator () const |
Convenience function to dynamic_cast the return value of getDecorator() to a derived type. | |
Public Member Functions inherited from Configurable | |
| virtual void | configure (const Properties *p) |
| Configure this object instance by de-serializing the given Properties. | |
| virtual void | configuration (Properties *p) const |
| Serialize the current object configuration into the given Properties object. | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Static Public Member Functions | |
| static bool | createCompatible (const DataList &, DataController **=0) |
| Factory interface for DataControllers: If data is compatible with data controller return true. | |
Protected Member Functions | |
| virtual bool | supportsToolBar () const |
| Subclasses can return true if they support showing their GUI in Location::ToolBar. | |
| void | init () override |
| Two-step initialization function to be implemented by subclasses. | |
Protected Attributes | |
| std::string | m_factoryName |
Protected Attributes inherited from Controller | |
| MainWindowBase * | m_main = nullptr |
| The parent MainWindowBase instance hosting this Controller. | |
| DisplayWidgetMulti * | m_disp = nullptr |
The main DisplayWidget instance, convenience shortcut for m_main->display(). | |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
Additional Inherited Members | |
Public Types inherited from Controller | |
| enum class | Location : int { Unknown = -1 , Naked = 0 , PrimaryDock = 1 , SecondaryDock = 2 , Detached = 3 , ToolBar = 4 , UserLocation = 100 } |
| Enumeration of possible placement/decoration options of a Controller. More... | |
Public Attributes inherited from Controller | |
| Signal | signalTitleChanged |
| Signal emitted when the title() has changed. | |
Public Attributes inherited from Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
|
inlinestatic |
Factory interface for DataControllers: If data is compatible with data controller return true.
If a is not zero, create data controller with input data.
|
overridevirtual |
Returns the shown widget title if the controller is shown in a mode that supports this (e.g.
when in dock). Unless overridden, it returns the factory name.
Implements Controller.
Reimplemented in Gated4DImageSetDisplayDataController, MeshDataController, TrackedSharedImageSetDisplayDataController, StreamDisplayDataController, SweepDisplayDataController, and VitalsDataController.
|
overridevirtual |
Returns the list of locations in which this controller is allowed to be placed by the parent MainWindowBase.
If the controller should not be placed/wrapped by the host but stand by itself you should return a list containing only Location::Naked.
Reimplemented from Controller.
Reimplemented in Gated4DImageSetDisplayDataController, TrackedSharedImageSetDisplayDataController, and VitalsDataController.
|
overridevirtual |
Returns the preferred location in which the parent MainWindowBase should place this controller.
If the controller should not be placed/wrapped by the host but stand by itself you should return Location::Naked.
Reimplemented from Controller.
Reimplemented in Gated4DImageSetDisplayDataController, TrackedSharedImageSetDisplayDataController, and VitalsDataController.
|
inlineprotectedvirtual |
Subclasses can return true if they support showing their GUI in Location::ToolBar.
This interface is used by the default implementation of supportedLocations() and preferredLocation() to decide whether to use Location::ToolBar.
Reimplemented in Gated4DImageSetDisplayDataController, MeshDataController, RGBDStreamController, StreamController, TrackedSharedImageSetDisplayDataController, StreamDisplayDataController, SweepDisplayDataController, and VitalsDataController.
|
overrideprotectedvirtual |
Two-step initialization function to be implemented by subclasses.
This function is called by setMainWindowBase() after the m_disp and m_main attributes have been set and hence a complete initialization of the controller is possible at this point.
Implements Controller.
Reimplemented in RTStructureDataController, GraphDataController, MeshDataController, RGBDStreamController, StereoImageStreamDataController, StereoSharedImageSetController, TrackedSharedImageSetDisplayDataController, RawDataController, StreamDisplayDataController, SweepDisplayDataController, and VitalsDataController.