Analysis: Adding Arrows to Physical Links
Phil Weinstein, CADSWES
The user should be able to show/hide arrow heads for a bunch of links. We should propose the direction based on flow path if available. The user could override it and either not show or reverse the direction.
A link should only show one arrow head or none at all. (That is, not both ends)
The user should also be able to click on a link and specify to show arrow head.
This leads me to the Link Groups as that is THE only place where you specify display attributes for links.
My proposal is that in the Link Display Group Configuration we somehow show the set of links, propose the arrow head direction, and let the user configure them there. Something like:
Slot 1: SELECT Slot 2 SELECT
Res1.Outflow ----------> Reach1.Inflow Arrows (on/reverse)
Res2.Outflow ----------> Reach2.Inflow Arrows (on/reverse)
(3.1) Link Arrow support for Individual Links on Workspace
Since Link Arrows need to be able to be turned ON or OFF at the ends of an individual link, there needs to be arrow "state information" associated with each link. (Note that individual links are represented with actual Link objects, a C++ class).
Currently, the top-level context menu on links consists of the following three items, each with 2nd level submenus enumerating the list of collinear links. (See also the image below):
- Delete Link
- Link Group Membership
- Add to Link Group
One possibility is adding the following two items to the top-level context menu, with single-direction link submenus -- EITHER one for each direction -- OR only for the end of the link closest to the mouse pointer (of the initial context-menu click):
- Add Arrow >> submenu with "<Slot> --> <Slot>" items
- Remove Arrow >> submenu with <Slot> --> <Slot>" items
(3.2) Link Arrow support for Individual Links in Display Link Groups
RiverWare does not yet have a list display for the links within a Display Link Group. But one could be created using GUI provisions similar to those of the recently developed Smart Linker:
![]() |
A new "Link Display Group Link Editor" dialog would have the following provisions:
- Flat list of links. (This is instead of the two-level treeview shown in the Smart Linker, see above).
- Columns: Object 1, Slot 1, Arrow 1 / Arrow 2, Slot 2, Object 2
... (no "Link Status" central column. All items in the list represent links).- Sortable by column.
- Arrow 1 and Arrow 2 columns would show an Arrow Icon: "<" or ">".
... clicking on these icons could toggle them.Multiple rows (links) would be selectable. Operations on all selected links would be provided:
- Add Arrows (Left)
- Add Arrows (Right)
- Remove Arrows (Left)
- Remove Arrows (Right)
If Arrows on the two sides of a Link are mutually exclusive as David suggests, then turning on Arrows on a particular side of the link would automatically turn them off on the other side.
(3.3) Alternative-1: Link Arrow support for Individual Links in a Full Link List Display
The sort of list display described in the prior section could just be presented for ALL of the physical links it the model.
Column sorting (using the columns above, possibly with the addition of Object Type icon columns) might be sufficient for isolating the links of interest. Or we could consider adding various filtering options (TBD).
Some heuristics could be used to determine the assignment of the two sides of each link to the two sides of the display list. For example:
- the LEFT side would be favored for slots with "output" semantics.
- the RIGHT side would be favored for slots with "input" semantics.
- all other links would have the slot sides assigned alphabetically (or some other criteria to provide consistency).
This dialog would be a reasonable place to deploy actions to apply "flow path" criteria (as a one-shot operation).
This alternative effectively divorces the control of link arrows from Display Link Groups.
(3.4) Alternative-2: Link Arrow support for All Links within a Display Link Group
An alternative to providing a new dialog (as described in the two prior sections) would be to just support adding and removing arrows for (one side of) an entire Link Display Group.
In the existing Link user interface, the two "sides" of a Link Group are represented by two panels at the top of the Link Display Group (see image). This would be a reasonable place to place the "Add Arrows" and "Remove Arrows" operations.
The following operations would be provided for each side of a Link Group:
- Add Arrows
- Remove Arrows
Indications of "None" or "Some" or "All" could be shown here, indicating the Link Arrow state of the respective Side of the member links. (Such indications should probably indicated the pre-Applied states; this would at least provide feedback for performing the "Add Arrows" and "Remove Arrows" operations).
Complication: "Add to Link Group" context menu operation on Links:
A given link is a member of a Link Display Group if one of its slots is in one of the Group's slot lists, and the other slot is in the other slot list. The "Add to Link Group" operation uses some heuristics to decide which of a link's slots should go in which of the Link Group's slot lists. (Specifically, if one of the slots is already in one of the slot lists, that association is used, and the other slot is placed in the other slot list. This is not relevant for "single slot list" Link Display Groups because if either of the slots is already in that single list, then the link in question is already in the group).
This slot list assignment issue places more significance to the substantially arbitrary assignment of a link's slots to a Link Display Group's slot lists for future applications of the "Add Arrows" and "Remove Arrows" operations performed at the Link Group level.
(3.5) Rendering Challenge: Link with Arrow can't be drawn to SimObj center
![]() |
Currently (with RiverWare 6.4) physical link lines are drawn to the CENTER of each linked simulation object's icon, UNDER (obscured by) that icon. With this current implementation, Arrowheads will generally be obscured by the object icon.
For showing an arrow at one of the ends of a link, a reasonable solution is to draw the link line ONLY UP TO the edge of the bounding square region of the object icon. (Note that simulation object icons are 40x40 pixels). The arrow head would be drawn "touching" that square region. This more complicated drawing algorithm will need to be applied to physical links -- note that it is already done for Supplies (links between Accounts). I propose that this drawing change be made only where an arrow is being shown.
(3.6) Elephant in the living room: Use of RootSelections to define the contents of Display Groups
(This is not actually related to introduction of the Link Arrows feature, as such).
There may be a consensus forming that defining a Display Group's contents WITH RootSelections was a mistake. Examining and editing the contents of a Display Group as a RootSelection is extremely fragile. These should probably be just lists of objects (SimObjs, Accounts, Slots, Supplies), to which elements can be adding USING GUS object selector (i.e. on a temporary RootSelection).
If a new "Link Display Group Link Editor" dialog is provided (see section 3.2), that would also be a place where the composition of a Display Link Group could be edited. We could either do this for only Link Display Groups, or provide a similar list dialog for the other types of Display Groups.
---