# UI (view) for GatherResources task

**URL:** https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044
**Category:** Simulation Modeling Toolkit (SMTK)
**Created:** [June 9, 2023, 9:18pm UTC](https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044 "2023-06-09T21:18:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![johnt](https://discourse.kitware.com/user_avatar/discourse.kitware.com/johnt/32/147_2.png) [@johnt](https://discourse.kitware.com/u/johnt)
#### Post date: [June 9, 2023, 9:18pm UTC](https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044/1 "2023-06-09T21:18:32Z")

</div>

I’ve got a couple candidate mockups for the GatherResource task UI, and would appreciate opinions/feedback on preference for either option, suggested changes, or alternative designs. I’m currently leaning toward the second option (single column).

## Two Column View

Mimics the look of the two-column attribute association widget.

- The “Assigned” panel on the left lists the resources assigned to the role selected in the combo box above the list.
- The “Available” panel on the right lists the unassigned resources matching the type specified for the currently selected role.
- Below the “Available” list are buttons to import resources from the file system and remove them from the unassigned list.
- The left arrow is disabled when the “Assigned” list has reached the max for that role.

 ![Gather Resource](https://discourse.kitware.com/uploads/default/original/1X/b9d4066abd791c64646a8f08bdc2e228d4a30eee.png)

## One Column View

A version using less horizontal space could put all of the resources in a single list with a checkbox next to each item indicating assignment to the currently-selected role.

- The combo box for the role might also include “all” and “unassigned” options for convenience (maybe both views should). When either of those are selected the checkboxes are disabled.

 ![Gather Resource 1 Column](https://discourse.kitware.com/uploads/default/original/1X/b51f8f1bc0e4a150eeef5c41b655328710e25e47.png)

---

<div class="post-metadata">

### Author: ![johnt](https://discourse.kitware.com/user_avatar/discourse.kitware.com/johnt/32/147_2.png) [@johnt](https://discourse.kitware.com/u/johnt)
#### Post date: [June 9, 2023, 9:21pm UTC](https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044/2 "2023-06-09T21:21:39Z")

</div>

FYI: @Bob_Obara @dcthomp @aron.helser @justin.2.wilson @rohith @Aaron

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [June 11, 2023, 5:42am UTC](https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044/3 "2023-06-11T05:42:57Z")

</div>

@johnt The prototypes look good but

1. I might add a search bar to either/both prototypes.
2. Neither prototype tells the user how many resource(s) to select in a given role (or how many more are required, etc.).
3. Instead of fixed “Import” and “Remove” buttons, you might have the `smtk::view::Configuration` object accept something to specify actions so that applications can provide their own buttons (e.g., the wind-tunnel might provide “Create an enclosure”). This would require some logic to allow plugins to register button-like actions.

---

<div class="post-metadata">

### Author: ![johnt](https://discourse.kitware.com/user_avatar/discourse.kitware.com/johnt/32/147_2.png) [@johnt](https://discourse.kitware.com/u/johnt)
#### Post date: [June 11, 2023, 3:13pm UTC](https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044/4 "2023-06-11T15:13:11Z")

</div>

A couple questions about where this new view fits in smtk:

- Should this UI element be a subclass of `smtk::extension::qtBaseView`?
- Does this view belong in a different/new dock widget? Is it time to implement a dock widget for the active task’s UI?

---

<div class="post-metadata">

### Author: ![johnt](https://discourse.kitware.com/user_avatar/discourse.kitware.com/johnt/32/147_2.png) [@johnt](https://discourse.kitware.com/u/johnt)
#### Post date: [June 12, 2023, 12:22pm UTC](https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044/5 "2023-06-12T12:22:16Z")

</div>

A bit more:

- I’ll paste a first UI prototype below (generated by Qt Designer). Not very aesthetic but I’m hoping it’s good enough for our initial functionality.
- Given the short timeframe (this week), optional features like highlighting, sorting, search box, and customized buttons are deferred to future updates.

 ![gather-resources-01](https://discourse.kitware.com/uploads/default/original/1X/786eb1628993050387f70a0c0e7f48cd5889bd8d.png)

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [June 12, 2023, 12:46pm UTC](https://discourse.kitware.com/t/ui-view-for-gatherresources-task/1044/6 "2023-06-12T12:46:34Z")

</div>

@johnt That looks like a start, though if the fields aren’t editable (like `Type`, `Min`, and `Max`), they should probably be labels.
