Views for task interaction

Component and Resource Visibility

One thing that has come up in task-based workflows is the need for users to control visibility of components and resources during specific tasks. We are considering creating a qtBaseView subclass that displays controls for relevant objects based on the current task. For example, an OpenFoam workflow might have a task for importing model geometry, a task for specifying a background mesh, and another task for specifying an overset mesh (a refinement region that moves with the model geometry).

When working on the background mesh, users may need to control the visibility of the model geometry. When working on the overset mesh, users may need to control the model geometry and background mesh visibility. This might be accomplished by providing a view configuration that refers to data on ports of the active task.

<View Type="TaskControl" Name="OversetMeshViewControl">

  <!-- Create a button to toggle visibility of the
       attribute resource's renderable geometry
       which appears on the active task's input port. -->
  <ObjectControl Name="MeshPreview" Label="Show mesh">
    <ActiveTaskObjects Port="input" Role="problem setup">
      <Resource Type="smtk::attribute::Resource"/>
    </ActiveTaskObjects>
    <Control Type="Visibility"/>
  </ObjectControl>

  <!-- Create a single button to toggle visibility of the
       model resource components listed on the input
       port of the active task. Provide an opacity slider
       as well for the same components. -->
  <ObjectControl Name="Model" Label="Show model">
    <ActiveTaskObjects Port="input" Role="model geometry">
      <Component Type="smtk::markup::Resource" Filter="smtk::markup::UnstructuredData"/>
    </ActiveTaskObjects>
    <Control Type="Visibility"/>
    <Control Type="Opacity"/>
  </ObjectControl>

</View>

As you can see, the view would create simple buttons and sliders that control the ParaView representations related to data (resources and/or components) on either input or output ports of the active task in particular roles. These objects may be subsetted by the type of resource and generic filter-query strings for components.

Screenshot From 2025-01-21 16-03-19

Task interaction

Because users/applications may tab the attribute panel and diagram panels together (so that only one or the other is visible at the same time), it is also useful to consider some attribute-panel sub-views that show and edit the current task’s state.

<View Type="TaskControl" Name="OversetMeshViewControl">
  <ActiveTaskStatus ShowCompletion="true" ReturnToDiagram="true"/>
  <ActiveTaskDescription/>
</View>

The XML above might add a swatch showing the active task’s status; the option to mark the task completed (if completable) or incomplete (if completed); and the option to return to the workflow diagram panel. You might also opt to display instructions provided by the task.

Screenshot From 2025-01-21 15-47-35

One-click Operations

You might also wish to provide users the option to run a pre-configured operation by associating port-connected objects to it. For the example above, this might include a button to fill the bounds of model geometry on the input port (in the role of “model geometry”) into the overset mesh attribute.

<View Type="TaskControl" Name="OversetMeshViewControl">
  <OperationControl Label="Adjust to padded model">
    <Operation Type="smtk::markup::CopyBoundsToAttribute">
      <Association Source="ActiveTaskPort" Port="input" Role="model geometry">
        <Component Source="smtk::markup::Resource" Filter="smtk::markup::UnstructuredData"/>
      </Association>
    </Operation>
  </OperationControl>
</View>

Putting all of the above together into one visual example:

Screenshot From 2025-01-21 15-59-32