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-selectlisting the kinds this host allows. Its label is the host'slabelprop, 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.
- Transformer Type Dropdown — one dense, outlined
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
- ITransformer — the interface the slot holds and the dropdown swaps.
- StaticTranslation, StaticRotation, StaticFreeform, DynamicTranslation, DynamicRotation, GeneralTransform and NoTransform — the seven implementations the web picker lists.
- Vec3d — the axis, pivot and translation fields the static and dynamic editors bind.
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; propsmodelKey/label/allowedKinds/onCreate/selectorOnly, eventschanged/typeChanged/error.wwwroot-src/src/components/topo/transformerEditors.ts—TRANSFORMER_EDITORS, the single kind → editor map, plusisTransformerKind()andhumanizeTransformerKind().wwwroot-src/src/components/topo/StaticTranslationEditor.vuewwwroot-src/src/components/topo/StaticRotationEditor.vuewwwroot-src/src/components/topo/StaticFreeformEditor.vuewwwroot-src/src/components/topo/DynamicTranslationEditor.vuewwwroot-src/src/components/topo/DynamicRotationEditor.vuewwwroot-src/src/components/topo/GeneralTransformEditor.vuewwwroot-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, fedallowedKindsandonCreatefrom the node context.wwwroot-src/src/components/controlTree/SoleEditorPanel.vue— the kind node's panel.wwwroot-src/src/components/controlTree/itemTypes.ts— registersTransformeras a slot type withbuildTransformerChildren, and each of the seven kinds againstSoleEditorPanel.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— theTransformerKindunion, the per-kind/api/{Kind}/Newcreate endpoints, and the typed wrappers for every update andIndex*call.wwwroot-src/src/i18n/en/topo.ts— every string on these panels, includingtopo.select.noTransformer. Transformer type names are identity and stay verbatim.
The REST controllers, one per kind:
Mech/Topo/StaticTranslationController.csMech/Topo/StaticRotationController.csMech/Topo/StaticFreeformController.csMech/Topo/DynamicTranslationController.csMech/Topo/DynamicRotationController.csMech/Topo/GeneralTransformController.cs— also servesIndexRotationandIndexTranslation.Mech/Topo/NoTransformController.cs—NewandGet; there is nothing on aNoTransformto update.
See Also
- Mechanism Builder Page — edits a mechanism’s per-branch transformer through this switchboard
- TransformationGeom Editor — embeds this picker as its inner transformer, with no kind restriction at all