SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Choose how to present operations to users. More...
#include <OperationFilterSort.h>
Public Types | |
using | Index = smtk::operation::Operation::Index |
using | Data = struct { std::string name |
using | WorkingSet = std::set< Index > |
using | Output = std::vector< Index > |
using | FilterList = std::map< Index, Data > |
using | Observer = std::function< void()> |
using | Observers = smtk::common::Observers< Observer > |
Public Member Functions | |
smtkTypeMacroBase (smtk::workflow::OperationFilterSort) | |
smtkCreateMacro (OperationFilterSort) | |
FilterList & | filterList () |
const FilterList & | filterList () const |
void | apply (const WorkingSet &workingSet, Output &operationsToDisplay) |
Choose a subset of operations to present to a used from workingSet. | |
Observers & | observers () |
Return the observers associated filter sort. | |
const Observers & | observers () const |
void | triggerObservers () const |
Call all observers to indicate the filter list has possibly changed. | |
Public Attributes | |
std::string | description |
std::string | iconName |
int | precedence |
Protected Attributes | |
FilterList | m_filterList |
Observers | m_observers |
Choose how to present operations to users.
In a simulation processing workflow, it is often desirable to focus users on a particular task by reordering or eliminating operations that are not useful from the user interface. It is also important to adapt operation terminology to the domain expert rather than train the domain expert.
This class allows changes to how and when operations are made visible to users in an application. It is used by the smtk::view::AvailableOperators class (1) to choose which of the applicable operations are presented to a user, and (2) to add presentation information such as icons and labels to these operations.
This class simply holds a filter-list of operation indices it wishes to allow, but the API it presents allows other subclasses to tailor operations to a multistage workflow where operations appear/disappear as other conditions are met. Specifically, if an external condition is met, this class may signal a reconfiguration event to its observers (of which the AvailableOperations class is one).