SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A group holding operations which can disconnect a pair of Component instances. More...
#include <ArcDeleter.h>
Public Member Functions | |
ArcDeleter (std::shared_ptr< smtk::operation::Manager > manager) | |
template<typename OperationType > | |
bool | registerOperation () |
Register an operation. More... | |
bool | registerOperation (Operation::Index operationIndex) |
std::set< std::string > | allArcTypes () const |
Return the set of all arc types which have operations that can perform deletion. | |
std::set< std::pair< std::string, Operation::Index > > | allArcDeleters () const |
Return the set of all arc type + operation index combinations that support deletion. | |
std::unordered_set< Operation::Index > | matchingOperations (smtk::string::Token arcType, const smtk::resource::PersistentObject &from, const smtk::resource::PersistentObject &to) const |
Given an ordered pair of objects and an arc type, return operations that can delete such an arc. | |
bool | unregisterOperation (const std::string &) |
Unregister an operation identified by its unique name. | |
bool | unregisterOperation (const Operation::Index &) |
Unregister an operation identified by its type index. | |
template<typename OperationType > | |
bool | unregisterOperation () |
Unregister an operation identified by its class type. | |
Static Public Member Functions | |
static bool | appendArc (smtk::operation::Operation &op, smtk::string::Token arcType, const std::shared_ptr< smtk::resource::PersistentObject > &from, const std::shared_ptr< smtk::resource::PersistentObject > &to) |
Given an operation (presumably from matchingOperations(…) above), configure it to delete the given arc. More... | |
Static Public Attributes | |
static constexpr const char *const | type_name = "arcDeleter" |
Protected Member Functions | |
bool | introspectArcTypes (Operation::Definition parameterDefinition, std::set< std::string > &arcTypes) |
Return all the arc types the operation with the given parameterDefinition supports. More... | |
std::pair< smtk::attribute::ConstReferenceItemDefinitionPtr, smtk::attribute::ConstReferenceItemDefinitionPtr > | endpointItemDefs (Operation::Definition parameterDefinition, smtk::string::Token arcType) const |
Given the definition for an operation's parameters and an arc type, return item-definition pointers for the "from" and "to" reference items which hold endpoints. More... | |
Protected Member Functions inherited from smtk::operation::Group | |
std::size_t | operationObjectDistance (const Operation::Index &index, const smtk::resource::PersistentObject &obj) const |
Return a "degree of fit" measure indicating how well an operation matches an object. More... | |
smtk::attribute::ConstReferenceItemDefinitionPtr | operationAssociationsRule (const Operation::Index &index) const |
A utility to fetch association rules for a given operation (used in operationObjectDistance). | |
smtk::attribute::ConstReferenceItemDefinitionPtr | operationReferenceItemRule (const Operation::Index &index, const std::string &itemName) const |
A utility to fetch reference-item rules for a given operation (used by subclasses such as ArcCreator). | |
Group (const std::string &name, std::shared_ptr< smtk::operation::Manager > manager) | |
const std::string & | name () const |
bool | registerOperation (const std::string &, std::set< std::string > values=std::set< std::string >()) |
Register an operation identified by its unique name and give it values. | |
bool | registerOperation (const Operation::Index &, std::set< std::string > values=std::set< std::string >()) |
Register an operation identified by its type index and give it values. | |
template<typename OperationType > | |
bool | registerOperation (std::set< std::string > values=std::set< std::string >()) |
Register an operation identified by its class type and give it values. | |
bool | unregisterOperation (const std::string &) |
Unregister an operation identified by its unique name. | |
bool | unregisterOperation (const Operation::Index &) |
Unregister an operation identified by its type index. | |
template<typename OperationType > | |
bool | unregisterOperation () |
Unregister an operation identified by its class type. | |
Operation::Specification | specification (const std::string &) const |
Access the specification of an operation identified by its unique name. | |
Operation::Specification | specification (const Operation::Index &) const |
Access the specification of an operation identified by its type index. | |
template<typename OperationType > | |
Operation::Specification | specification () const |
Access the specification of an operation identified by its class type. | |
bool | contains (const std::string &) const |
Check if an operation identified by it's unique name is in the group. | |
bool | contains (const Operation::Index &) const |
Check if an operation identified by its type index is in the group. | |
template<typename OperationType > | |
bool | contains () const |
Check if an operation identified by its class type is in the group. | |
std::set< std::string > | values (const std::string &) const |
Obtain values for an operation identified by it's unique name is in the group. | |
std::set< std::string > | values (const Operation::Index &) const |
Obtain values for an operation identified by its type index is in the group. | |
template<typename OperationType > | |
std::set< std::string > | values () const |
Obtain values for an operation identified by its class type is in the group. | |
std::set< Operation::Index > | operations () const |
Return a set of operation indices that belong to this group. | |
std::set< std::string > | operationNames () const |
Return a set of operation unique names that belong to this group. | |
std::string | operationName (const Operation::Index &) const |
Given an operation index, return the operation's name. | |
std::string | operationLabel (const Operation::Index &) const |
Given an operation index, return the operation's label. | |
Additional Inherited Members | |
Protected Types inherited from smtk::operation::Group | |
typedef GroupObserver | Observer |
typedef GroupObservers | Observers |
Protected Attributes inherited from smtk::operation::Group | |
std::weak_ptr< smtk::operation::Manager > | m_manager |
A group holding operations which can disconnect a pair of Component instances.
All operations added to this group must
Because it is possible to have many GroupItem children of "arc type" that are active for different values of "arc type," a single deletion operation can support arcs that require a variety of different endpoints to be removed.
Note that there is no way for operations in this group to handle
Note that operations should implement ableToOperate so it guarantees the operation will succeed if it is allowed to run. User interfaces exposing operations in this group should verify that all operations to remove the user-specified arcs are able to operate before launching any of the operations. This does not guarantee success (e.g., arc deletion could be contingent on the existence of other arcs scheduled for deletion by a separate operation), but handles the most common case.
|
static |
Given an operation (presumably from matchingOperations(…) above), configure it to delete the given arc.
This returns true if op was successfully modified to include the arc defined by arcType, from, and to; and false otherwise.
If op's parameters have "arc type" set to a different value (i.e., arcType is "foo" but op->findString("arc type")->value()
returns "bar"), this method will return false; an operation should only delete arcs of a single type at a time.
|
protected |
Given the definition for an operation's parameters and an arc type, return item-definition pointers for the "from" and "to" reference items which hold endpoints.
This is used to determine whether a pair of objects can have an arcType arc removed from between them.
|
protected |
Return all the arc types the operation with the given parameterDefinition supports.
This will return false and arcTypes will be unchanged if parameterDefinition is not of the expected form.
This will return true if at least one arc type is supported by the operation (whether the arc type was already present in arcTypes or was inserted by this method).
bool smtk::operation::ArcDeleter::registerOperation |
Register an operation.
The operation's parameters will be examined to determine the types of arcs that can be deleted.