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 a Transformer slot of the General Setup page's Control Tree (/general-setup). Four slots on that tree are Transformer slots:

  • equipment/fixture/geom-to-workpiece — “Geom To Workpiece”
  • equipment/fixture/geom-to-table — “Geom To Table”
  • equipment/workpiece/anchor/geom-to-fixture — “Geom To Fixture”
  • equipment/workpiece/anchor/geom-to-program-zero — “Geom To Program Zero”

A fifth shape appears wherever a TransformationGeom is grown as a tree node: its .../inner-transformer child is a Transformer slot too.

Two surfaces embed the panel outside any tree — the Mechanism Builder Page (/util/mech-builder), for the selected branch's transformer, and the inner-transformer card of TransformationGeom Editor.

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; the inner-transformer card labels it Inner transformer. 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) Mechanism Builder page; the inner-transformer card of TransformationGeomEditor.vue 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; none of the four General Setup slots narrows it, so all seven appear there.

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 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.tsTRANSFORMER_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/pages/MechBuilderPage.vue — embeds the panel for the selected branch.
  • wwwroot-src/src/components/geom/TransformationGeomEditor.vue — embeds it for the inner transformer.

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 and Index* call.
  • 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.csNew and Get; there is nothing on a NoTransform to update.

See Also