RiverWare 6.1: "Add to Display Groups" Context Menus

Analysis: Workspace Context Menu: Add Link to Link Group
Phil Weinstein, CADSWES, edit 11-23-2010

Potential new feature: Ability to add a Link to a Link Group through a context menu operation on the Workspace.

The following image depicts the already existing context menu operations on physical Links. (The Display Group Editor is also shown here, but that is not dynamically shown as part of any of the context menu operations).

A third top level menu item, "Add to Link Group" (or "Add to Display Group") could be added. This would also have two additional submenu levels:

  1. Physical Link Enumeration (submenus) ...
  2. List of User-Defined Link Groups of which the Physical Link is not already a member.

Picking an item from the list of User-Defined Link Groups would add the respective Physical Link to the picked Link Group.

Notes:

  1. Similar "Display Group" context menu operations are implemented for Simulation Objects and Accounts (but not currently for Supplies). The operations all use the more general term "Display Group" rather than the more specific terms, e.g. "Object Group" or "Account Group". It would be more consistent to call the new function, "Add to Display Group" -- AND possibly implement this also for Simulation Objects and Accounts.
  2. When AggObjects are involved, no additional submenu "levels" are used for the Display Group context menu operations. Instead, all Element Object links are enumerated at the same level as the top-level AggObject links.

Implementation:

A dynamic menu mechanism parallel to the support for the existing menus would need to be impelemented. Some key points in code are summarized here:

void WorkspaceGfxScene::contextMenuEvent (QGraphicsSceneContextMenuEvent*);

void WorkspaceGfxScene::insertShowLinkGroupActions (
   QMenu* showLinkGroupMenu,
   const QPointF& refScenePos);

int LinkGfxItem::insertDspGroupActions (
   QMenu* dispGrpMenu,
   QSignalMapper* sigMapper);

Connected through WorkspaceGfxScene's _showLinkGroupCtxSignalMapper:
... void WorkspaceGfxScene::showLinkGroupActivated (const QString& refGroupName)

---