SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
smtk::view::OperationDecorator Class Reference

Decorate operations that should be presented to the user. More...

#include <OperationDecorator.h>

Collaboration diagram for smtk::view::OperationDecorator:
[legend]

Classes

class  Entry
 An entry indicating how to present an operation to users. More...
 

Public Types

using Override = std::pair< bool, std::reference_wrapper< const Entry > >
 

Public Member Functions

 OperationDecorator (std::initializer_list< Entry > entries)
 
 OperationDecorator (const std::shared_ptr< smtk::operation::Manager > &manager, const Configuration::Component &config)
 
void dump () const
 Print debug info.
 
int insert (const Entry &entry)
 Add an entry for an operation.
 
template<typename OperationType >
Override at () const
 Return the entry for an operation.
 
Override at (smtk::operation::Operation::Index index) const
 Return the entry for an operation.
 
std::size_t size () const
 Return the number of operation entries.
 

Static Public Member Functions

static Override none ()
 

Protected Attributes

std::set< Entrym_entries
 

Detailed Description

Decorate operations that should be presented to the user.

This class should be used to whitelist, decorate, group, and/or sort sets of operations that will be presented to users.

You may construct an operation decorator in three ways:

  1. from an smtk::view::Configuration::Component as described below;
  2. from an initializer list of OperationDecorator::Entry objects; or
  3. with no arguments (allowing programmatic configuration).

If you choose to configure an operation decorator using view configuration information, it should follow the example below

<OperationDecorator>
<!-- Include operations explicitly -->
<Operation TypeRegex="smtk::model.*"/>
<Operation TypeRegex="smtk::attribute.*"/>
<!-- Overrides are allowed for operations like so: -->
<Operation Type="smtk::geometry::MeshInspector"/>
<Operation Type="smtk::geometry::ImageInspector"/>
<Operation Type="smtk::model::AssignColors">
<Overrides>
<Label>choose a color</Label>
<ButtonLabel>choose\ncolor</Label>
<Tooltip>Choose colors for parts.</Tooltip>
<!-- Icon overrides are not implemented yet, but should include: -->
<Icon Source="inline">(insert svg here)</Icon>
<Icon Source="qrc">:/path/to/icon</Icon>
<Icon Source="factory" Arguments="iconName">functorName</Icon>
</Overrides>
</Operation>
</OperationDecorator>

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