Selection & Task Panels
Relevant source files
The following files were used as context for generating this wiki page:
The Selection and Task Panel system in Parashell provides the interactive interface through which users provide inputs, configure parameters, and manage geometric references for various modeling operations. Task panels serve as dockable dialogs within the FreeCAD-based interface, allowing users to manipulate 3D views while simultaneously configuring command-specific data.
This system is built upon a modular architecture where specific workbenches (such as Assembly, PartDesign, and FEM) implement dedicated task panels and selection widgets. These components facilitate a "live" workflow where changes in the task panel often trigger immediate visual updates in the 3D viewport.
Sources: src/Mod/Draft/drafttaskpanels/README.md, src/Mod/Assembly/Gui/Resources/translations/Assembly.ts
Task Panel Architecture and UI Management
Task panels are typically defined using Qt Designer .ui files, which separate the visual layout from the underlying C++ or Python logic. Modern implementations favor individual task panels for each tool to ensure maintainability and prevent side effects between different GUI commands.
Components and Implementation
| Component Type | Implementation Basis | Description |
|---|---|---|
| UI Files | .ui (XML-based) | Defines the layout of widgets, input fields, and buttons. |
| Logic Modules | C++ Classes / Python Scripts | Handles signals/slots, parameter validation, and object updates. |
| Selection Widgets | Specialized GUI Classes | Specialized controls for managing lists of selected faces, edges, or vertices. |
In workbenches like Assembly and PartDesign, task panels include sections for "Motions," "Limits," and "Parameters" (such as Pitch, Height, or Radius), which directly map to object properties.
Sources: src/Mod/Draft/drafttaskpanels/README.md:5-24, src/Mod/Assembly/Gui/Resources/translations/Assembly.ts:880-920
Task Panel Interaction Flow
The following diagram illustrates how a user interaction within a task panel propagates through the system to update the document model.
The task panel lifecycle involves initialization upon command activation, parameter validation during user input, and document recomputation to reflect changes.
Sources: src/Mod/PartDesign/Gui/Resources/translations/PartDesign.ts:1530-1550, src/Mod/Fem/Gui/Resources/translations/Fem_kab.ts:740-760
Selection and Reference Management
Selection widgets are critical sub-components of task panels, specifically designed to handle geometric references (Faces, Edges, Vertices, or Solids). These widgets allow users to "Add" or "Remove" items from a reference list by picking them directly from the 3D view.
Geometric Selectors
Workbenches like FEM and Assembly implement specialized selectors for different entities:
- BoundarySelector: Specifically for selecting Faces/Edges/Vertexes for constraints.
- SolidSelector: For selecting entire solid elements.
- GeometryElementsSelection: A generic selector that can be limited to specific types (e.g., only planar faces or cylindrical faces).
Sources: src/Mod/Fem/Gui/Resources/translations/Fem_kab.ts:1-25, src/Mod/Fem/Gui/Resources/translations/Fem_kab.ts:145-160
Selection Logic Sequence
Selection widgets interact with the Task Panel logic to ensure that only valid geometric types are assigned to specific object properties, such as a "Neutral Plane" or "Hole Center."
Sources: src/Mod/Fem/Gui/Resources/translations/Fem_kab.ts:800-830, src/Mod/PartDesign/Gui/Resources/translations/PartDesign.ts:1400-1420
Workbench-Specific Implementations
PartDesign Task Panels
PartDesign task panels often handle complex topological operations. They include specialized modes for extrusions (Pad/Pocket) and transformations (Linear/Polar patterns).
- Helix Parameters: Manages Pitch, Height, Turns, and Growth for helical features.
- Hole Parameters: Configures Head Type (Counterbore/Countersink), Depth Type, and Threading specifications.
Sources: src/Mod/PartDesign/Gui/Resources/translations/PartDesign.ts:1500-1600, src/Mod/PartDesign/Gui/Resources/translations/PartDesign.ts:2500-2600
Assembly Task Panels
The Assembly workbench utilizes task panels for joint creation and simulation management.
- Joint Creation: Allows isolating parts, reversing directions, and setting limits for length and angle.
- Simulation: Provides an "Animation Player" interface within the task panel to step through motion frames.
Sources: src/Mod/Assembly/Gui/Resources/translations/Assembly.ts:880-920, src/Mod/Assembly/Gui/Resources/translations/Assembly.ts:1010-1060
Technical Drawing (TechDraw) Task Panels
TechDraw utilizes task panels for 2D annotation and view management. These panels often manage visual attributes like line styles and scales.
- TaskProjGroup: Manages projection groups for 2D views.
- TaskDimension: Handles the configuration of dimensions and tolerances.
Sources: src/Mod/TechDraw/Gui/CMakeLists.txt:40-75
Conclusion
Selection and Task Panels are the primary bridge between the user and Parashell's internal parametric engine. By leveraging dockable task panels and context-sensitive selection widgets, the system enables precise geometric modeling while maintaining a responsive, non-blocking interface. The shift toward individual UI files and dedicated logic modules ensures that workbenches can scale with increasing complexity without compromising system stability.
Sources: src/Mod/Draft/drafttaskpanels/README.md, src/Mod/PartDesign/Gui/Resources/translations/PartDesign.ts