Table of Contents

Transformer Select Panel

The Transformer Select Panel is the switchboard that picks which ITransformer occupies a transformer-valued slot and edits the one that is there. For the model behind the picker — what each transformer does to a frame — see Handle Transform Matrix by ITransformer.

Surface

The panel's principal home is the branch editor of the Equipment page's Topology column (Equipment Topology, /equipment), where the editor card of a selected branch — a machine-tool, fixture or workpiece branch, or the worktable attachment — mounts it for that branch's transformer. It mounts the embedded form through a parent-aware onCreate hook, so a kind change lands on the branch itself.

Two Transformer slots remain on Control Trees: the Tool House freeform holder's “Geom To Spindle” and “Geom To Cutter” (Freeform Holder Panel). The transform on a geometry is not one of them: the Transform picker beside a geometry chooses that transformer's kind, and the …/type/transformer row it grows under the geometry's kind node is a kind node whose panel is that kind's editor from the table below — its picker is the Transform picker, not this one.

Layout

  • Transformer Select Panel
    • Transformer Type Dropdown — one dense, outlined q-select listing the kinds this host allows. Its label is the host's label prop, falling back to Transformer type. Picking a kind commits immediately; there is no Apply button.
    • Separator — drawn only when a kind is active.
    • Active Kind's Editor — the component the kind maps to in TRANSFORMER_EDITORS, bound to the IndexService key the picker resolved for the live transformer.

The panel takes a selectorOnly prop that drops everything below the dropdown, which gives it two forms:

Form Where it is used What renders
Embedded (default) the Topology column's branch editor (EquipmentTopologyPanel.vue); the inner-transformer card of TransformationGeomEditor.vue, reached only for a wrapper nested inside a wrapper dropdown, separator, and the active kind's editor in one column
Selector only every Control-Tree Transformer slot, through TransformerSlotPanel.vue the dropdown alone

In a Control Tree the picker and the editor sit on two different nodes. buildTransformerChildren() grows at most one child under the slot, typed with the current kind, and that child's panel is SoleEditorPanel.vue, which resolves the kind through the same TRANSFORMER_EDITORS map and binds it to the slot's own key. The builder first probes the slot's key with getIndexType and returns no child at all when that probe fails or names a type outside the seven kinds, so a slot holding nothing is a picker with nothing beneath it. Selecting the slot shows the picker; selecting the child shows the kind's editor.

Transformer Type Dropdown

The dropdown gets and sets the ITransformer behind the bound key. On mount, and again whenever that key changes, it probes the object's type with getIndexType; picking a different kind creates the replacement through POST /api/{Kind}/New unless the host supplied an onCreate hook, in which case that hook runs instead so the owning domain object is rebound alongside the IndexService entry.

Which kinds it offers is the allowedKinds prop, defaulting to all seven. A Control-Tree slot feeds it from the node's ctx.allowedKinds; neither Tool House holder slot sets one, so all seven appear there. The Topology column passes no restriction either — an axis role's transformer requirement is enforced by the server, which answers AxisTransformerMismatch to a kind the role cannot take.

When the probed kind falls outside allowedKinds, both the active and the selected kind reset to empty: the dropdown blanks, and the embedded form prints No transformer attached. in place of an editor. The out-of-list transformer is not rendered.

Transformer Kinds

The web client offers seven kinds, one editor each.

Kind Editor What the editor holds
StaticTranslation StaticTranslationEditor.vue one Vec3 input, the constant offset
StaticRotation StaticRotationEditor.vue axis Vec3 input (with Normalize), angle in degrees, pivot Vec3 input
StaticFreeform StaticFreeformEditor.vue a 4×4 matrix grid with Identity and Invert (stored column-major, displayed row-major)
DynamicTranslation DynamicTranslationEditor.vue axis Vec3 input (with Normalize) and a step in mm
DynamicRotation DynamicRotationEditor.vue axis Vec3 input (with Normalize), angle in degrees, pivot Vec3 input
GeneralTransform GeneralTransformEditor.vue a scale field over two embedded sub-transformer cards
NoTransform NoTransformEditor.vue an identity-transform notice; no controls

The picker offers no null entry: identity is expressed by choosing NoTransform.

Note

The GeneralTransform editor is a composition, not a flat form: a scale field, then the StaticRotation and StaticTranslation editors embedded in their own bordered cards, titled Rotation sub-transformer and Translation sub-transformer. It keys the two sub-editors off POST /api/GeneralTransform/IndexRotation and /IndexTranslation, edits the scale itself, and owns no vector widget — every vec3d_t field on it comes from the nested editors. The effective transform is T × R × scale × I.

Key Model

Source Code Path

See HiNC App Anatomy for git repository links.

The switchboard and its editors:

  • wwwroot-src/src/components/topo/TransformerSelectPanel.vue — the picker, the create call and the optional inline editor; props modelKey / label / allowedKinds / onCreate / selectorOnly, events changed / typeChanged / error.
  • wwwroot-src/src/components/topo/transformerEditors.ts — TRANSFORMER_EDITORS, the single kind → editor map, plus isTransformerKind() and humanizeTransformerKind().
  • wwwroot-src/src/components/topo/StaticTranslationEditor.vue
  • wwwroot-src/src/components/topo/StaticRotationEditor.vue
  • wwwroot-src/src/components/topo/StaticFreeformEditor.vue
  • wwwroot-src/src/components/topo/DynamicTranslationEditor.vue
  • wwwroot-src/src/components/topo/DynamicRotationEditor.vue
  • wwwroot-src/src/components/topo/GeneralTransformEditor.vue
  • wwwroot-src/src/components/topo/NoTransformEditor.vue

The Control-Tree glue and the two direct embedders:

  • wwwroot-src/src/components/controlTree/TransformerSlotPanel.vue — the slot's panel: this switchboard in selector-only mode, fed allowedKinds and onCreate from the node context.
  • wwwroot-src/src/components/controlTree/SoleEditorPanel.vue — the kind node's panel.
  • wwwroot-src/src/components/controlTree/itemTypes.ts — registers Transformer as a slot type with buildTransformerChildren, and each of the seven kinds against SoleEditorPanel.
  • wwwroot-src/src/components/controlTree/toolHouseItemTypes.ts — mints the freeform holder's two Transformer slots.
  • wwwroot-src/src/components/mech/EquipmentTopologyPanel.vue — embeds the panel for the selected branch of the authored equipment; its onCreate posts the candidate to {owner}/branch/{id}/update-transformer under api/mech/equipment-topology.
  • wwwroot-src/src/components/geom/TransformationGeomEditor.vue — embeds it for the inner transformer of a wrapper nested inside a wrapper (older data); a slot's own transform is chosen with wwwroot-src/src/components/geom/GeometryTransformSelect.vue instead.

The transport and the strings:

  • wwwroot-src/src/api/transformer.ts — the TransformerKind union, the per-kind /api/{Kind}/New create endpoints, and the typed wrappers for every update call, including the per-owner vector writes (UpdateTrans, UpdateAxis, UpdatePivot) and the three NormalizeAxis calls.
  • wwwroot-src/src/i18n/en/topo.ts — every string on these panels, including topo.select.noTransformer. Transformer type names are identity and stay verbatim.

The REST controllers, one per kind:

  • Mech/Topo/StaticTranslationController.cs
  • Mech/Topo/StaticRotationController.cs
  • Mech/Topo/StaticFreeformController.cs
  • Mech/Topo/DynamicTranslationController.cs
  • Mech/Topo/DynamicRotationController.cs
  • Mech/Topo/GeneralTransformController.cs — also serves IndexRotation and IndexTranslation.
  • Mech/Topo/NoTransformController.cs — New and Get; there is nothing on a NoTransform to update.

See Also

  • Equipment Topology — the Equipment page's Topology column, whose branch editor mounts this switchboard for the authored equipment's branches
  • Fixture Page — the part whose two placing branches are edited through this switchboard in the Topology column
  • Freeform Holder Panel — the Tool House's two remaining Control-Tree Transformer slots
  • Transform Picker — the picker that puts one of these kinds, less NoTransform, on a geometry; the transformer row it grows resolves through this panel's editor map