SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
10 #ifndef smtk_task_SubmitOperation_h
11 #define smtk_task_SubmitOperation_h
13 #include "smtk/operation/Manager.h"
14 #include "smtk/operation/Observer.h"
15 #include "smtk/operation/Operation.h"
16 #include "smtk/resource/Resource.h"
17 #include "smtk/task/Task.h"
32 class ConfigureOperation;
33 class ResourceAndRole;
113 const smtk::common::Managers::Ptr& managers =
nullptr);
118 const smtk::common::Managers::Ptr& managers =
nullptr);
127 bool markCompleted(
bool completed)
override;
145 ParameterSpec associationSpec()
const {
return m_associationSpec; }
162 bool setNeedsToRun();
164 bool editableCompletion()
const override;
174 smtk::operation::Operation::Result result);
177 bool applyParameterSpecifications();
180 bool applyParameterSpecification(
181 const ParameterSpec& spec,
182 const std::shared_ptr<smtk::attribute::Item>& item);
185 State computeInternalState()
const;
187 smtk::common::Managers::Ptr m_managers;
188 smtk::operation::Observers::Key m_observer;
189 std::vector<ParameterSpec> m_parameterSpecs;
190 ParameterSpec m_associationSpec;
191 RunStyle m_runStyle{ RunStyle::Iteratively };
192 bool m_runSinceEdited{
false };
193 std::shared_ptr<smtk::operation::Operation> m_operation;
198 #endif // smtk_task_SubmitOperation_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
SubmitOperation helps users prepare and optionally run an operation.
Definition: SubmitOperation.h:42
nlohmann::json Configuration
Tasks are configured with arbitrary JSON objects, though this may change.
Definition: Task.h:89
std::function< smtk::common::Visit(ParameterSpec &)> ParameterSpecVisitor
Signatures of functors that visit resources-by-role predicates.
Definition: SubmitOperation.h:106
ItemVisibility
Specify whether an item and its children should be visible to users.
Definition: SubmitOperation.h:70
std::string m_itemPath
The path to the item to be configured.
Definition: SubmitOperation.h:81
std::set< Ptr > PassedDependencies
A task's dependencies are other tasks passed as shared pointers.
Definition: Task.h:87
A task manager is responsible for creating new tasks.
Definition: Manager.h:68
State
The set of states that a task may take on.
Definition: State.h:29
nlohmann::json m_values
Values to assign to the item (UUIDs for reference items).
Definition: SubmitOperation.h:88
#define smtkCreateMacro(...)
Add static create() methods to a class.
Definition: SharedFromThis.h:173
Visit
Return values common to most visitor methods.
Definition: Visit.h:23
smtk::operation::Operation * operation() const
Return the operation this task requires users to configure and submit.
Definition: SubmitOperation.h:130
This object provides applications a way to configure a task using information adapted from its depend...
Definition: Adaptor.h:23
Operation is a base class for all SMTK operations.
Definition: Operation.h:61
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:128
Configure a task with a resource and role given a dependent producer.
Definition: ResourceAndRole.h:24
bool runSinceEdited() const
True if the operation has successfully run since its parameters were last edited.
Definition: SubmitOperation.h:152
ParameterSpec & associationSpec()
Return the specification for the associations of the operation this task configures.
Definition: SubmitOperation.h:144
std::string m_role
If the parameter is a ReferenceItem, the role specifies objects in the project that are allowed as va...
Definition: SubmitOperation.h:86
smtk::shared_ptr< smtk::view::Configuration > ConfigurationPtr
Definition: PublicPointerDefs.h:649
@ Once
Users run the operation once (at which point the task is marked complete).
Definition: SubmitOperation.h:53
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
@ Iteratively
Users edit parameters and run the operation, possibly repeatedly.
Definition: SubmitOperation.h:52
Task is a base class for all SMTK tasks.
Definition: Task.h:73
RunStyle
Specify how users interact with the operation.
Definition: SubmitOperation.h:50
A string token identified by an integer.
Definition: Token.h:29
Per-parameter configuration of item values.
Definition: SubmitOperation.h:78
RunStyle runStyle() const
Return the manner in which this task expects users to submit the operation.
Definition: SubmitOperation.h:133
EventType
Enumerate events that an operation may encounter.
Definition: Observer.h:30
ConfiguredBy
Specify what is allowed to configure an operation parameter.
Definition: SubmitOperation.h:62