Color legend method
The rules that turn a target’s capabilities into the mode and the frame the gizmo uses, as extension methods of GizmoCapabilities.
A static class. The capabilities page shows it in context, with code. The rules need no graphics device, so a toolbar or an inspector can ask them.
Names are colored by what they are: a method; values and fields keep the plain color.
Methods
Allows() →
Allows(this GizmoCapabilities capabilities, GizmoMode mode) · Whether the mode is offered at all, in either frame or with either scale handle.
| Parameter | Type | Description |
|---|---|---|
capabilities |
GizmoCapabilities |
The target’s flags. |
mode |
GizmoMode |
The mode to ask about. |
Allows(this GizmoCapabilities capabilities, GizmoMode mode, GizmoSpace space) · Whether the mode is offered in the frame. Scale is offered only in Local.
| Parameter | Type | Description |
|---|---|---|
capabilities |
GizmoCapabilities |
The target’s flags. |
mode |
GizmoMode |
The mode to ask about. |
space |
GizmoSpace |
The frame to ask about. |
NextMode() →
NextMode(this GizmoCapabilities capabilities, GizmoMode current) · The next offered mode after current, in translate, rotate, scale order, wrapping round. A lone mode comes back as itself; with nothing offered, current comes back.
| Parameter | Type | Description |
|---|---|---|
capabilities |
GizmoCapabilities |
The target’s flags. |
current |
GizmoMode |
The mode to step on from. |
ResolveSpace() →
ResolveSpace(this GizmoCapabilities capabilities, GizmoMode mode, GizmoSpace preferred) · The frame the mode works in: preferred when the mode is offered there, otherwise the other frame when it is offered there. Local for scale whatever is preferred; preferred for a mode offered in neither frame.
| Parameter | Type | Description |
|---|---|---|
capabilities |
GizmoCapabilities |
The target’s flags. |
mode |
GizmoMode |
The mode to settle the frame of. |
preferred |
GizmoSpace |
The frame asked for, as Space. |
TryClampMode() →
TryClampMode(this GizmoCapabilities capabilities, GizmoMode current, out GizmoMode mode) · Keeps a mode on one the target offers: true with current when it is offered, else true with the first offered mode in translate, rotate, scale order. false, with mode set to current, when nothing is offered.
| Parameter | Type | Description |
|---|---|---|
capabilities |
GizmoCapabilities |
The target’s flags. |
current |
GizmoMode |
The mode in use. |
mode |
out GizmoMode |
The mode to use. |