Navigation
API > API/Plugins > API/Plugins/ModelingComponents > API/Plugins/ModelingComponents/Selection
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UInteractionMechanic
- UMeshTopologySelectionMechanic
- UBoundarySelectionMechanic
- UPolygonSelectionMechanic
References
| Module | ModelingComponents |
| Header | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Selection/MeshTopologySelectionMechanic.h |
| Include | #include "Selection/MeshTopologySelectionMechanic.h" |
Syntax
UCLASS&40;Abstract&41;
class UMeshTopologySelectionMechanic :
public UInteractionMechanic,
public IClickBehaviorTarget,
public IHoverBehaviorTarget
Remarks
Base class mechanic for selecting a subset of mesh elements (edge loops, groups, corners, etc.) Internally it relies on an FMeshTopologySelector to define which type of mesh topology is selectable.
NOTE: Users should not use this class directly, but rather subclass it and specify a particular FMeshTopologySelector to use.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TUniquePtr< FMeshTopologySelectionMechanicSelectionChange > | ActiveChange | ||
| bool | bAddSelectionFilterPropertiesToParentTool | Configuration variables that must be set before bSetup is called | |
| FInputCapturePriority | BasePriority | ||
| bool | bCtrlToggle | ||
| bool | bCurrentlyMarqueeDragging | ||
| bool | bIsEnabled | ||
| bool | bShiftToggle | ||
| bool | bShowEdges | ||
| bool | bShowSelectableCorners | ||
| FViewCameraState | CameraState | ||
| TObjectPtr< USingleClickOrDragInputBehavior > | ClickOrDragBehavior | ||
| TSet< int > | CurrentlyHighlightedGroups | ||
| TObjectPtr< UTriangleSetComponent > | DrawnTriangleSetComponent | ||
| TFunction< FDynamicMeshAABBTree3 *()> | GetSpatialFunc | ||
| TObjectPtr< UMaterialInterface > | HighlightedFaceMaterial | ||
| FToolDataVisualizer | HilightRenderer | ||
| FGroupTopologySelection | HilightSelection | ||
| TObjectPtr< UMouseHoverBehavior > | HoverBehavior | ||
| FVector3d | LastClickedHitNormal | ||
| FVector3d | LastClickedHitPosition | ||
| FGroupTopologySelection | LastUpdateRectangleSelection | ||
| TObjectPtr< URectangleMarqueeMechanic > | MarqueeMechanic | ||
| const FDynamicMesh3 * | Mesh | ||
| FSimpleMulticastDelegate | OnFaceSelectionPreviewChanged | This is broadcast during marquee rectangle dragging if selected faces change, to allow user to dynamically update face highlighting if desired (needed because OnSelectionChanged is only fired once the rectangle is completed, not while it is being updated). | |
| FSimpleMulticastDelegate | OnSelectionChanged | OnSelectionChanged is broadcast whenever the selection is modified (including by FChanges, which means that called functions should not issue undo transactions. | |
| FGroupTopologySelection | PersistentSelection | ||
| FToolDataVisualizer | PolyEdgesRenderer | ||
| FGroupTopologySelection | PreDragPersistentSelection | Used for box selection. | |
| FGroupTopologySelector::FSelectionSettings | PreDragTopoSelectorSettings | ||
| TObjectPtr< APreviewGeometryActor > | PreviewGeometryActor | The actor we create internally to own the DrawnTriangleSetComponent | |
| TObjectPtr< UMeshTopologySelectionMechanicProperties > | Properties | TODO: Is it worth issuing separate callbacks in normal selection changes and in FChange ones, to allow the user to bundle in some FChanges into the normal callback? | |
| FToolDataVisualizer | SelectionRenderer | ||
| int32 | SelectionTimestamp | ||
| TFunction< bool(void)> | ShouldAddToSelectionFunc | ||
| TFunction< bool(void)> | ShouldRemoveFromSelectionFunc | ||
| TFunction< bool(void)> | ShouldSelectEdgeLoopsFunc | When bSelectEdgeLoops is true, this function is tested to see if we should select edge loops, to allow edge loop selection to be toggled with some key (setting bSelectEdgeLoops to false overrides this function). | |
| TFunction< bool(void)> | ShouldSelectEdgeRingsFunc | When bSelectEdgeRings is true, this function is tested to see if we should select edge rings, to allow edge ring selection to be toggled with some key (setting bSelectEdgeRings to false overrides this function). | |
| FTransform3d | TargetTransform | ||
| TSharedPtr< FMeshTopologySelector, ESPMode::ThreadSafe > | TopoSelector | Subclass should initialize this with a concrete subclass of FMeshTopologySelector | |
| TMap< int32, bool > | TriIsOccludedCache |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | BeginChange () |
Change Tracking Begin a change record. | |
| void | Clear current hover-highlight | ||
| void | Clear the current selection. | ||
| void | DisableBehaviors
(
UInteractiveTool* ParentToolIn |
Removes the mechanic's own click/hover handlers, which means that the parent tool will need to call UpdateSelection(), UpdateHighlight(), ClearHighlight(), and ClearSelection() from its own hover/click handlers. | |
| void | DrawHUD
(
FCanvas* Canvas, |
||
| TUniquePtr< FToolCommandChange > | EndChange () |
End the active change and return it. Returns empty change if the selection was not modified! | |
| bool | Ends the active change and emits it via the parent tool, if the selection has been modified. | ||
| const FGroupTopologySelection & | |||
| void | GetClickedHitPosition
(
FVector3d& PositionOut, |
Can be used by in an OnSelectionChanged event to inspect the clicked location (i.e., the values returned by the UpdateSelection() function when the click happened). | |
| TPair< FInputCapturePriority, FInputCapturePriority > | Gets the current priority range used by behaviors in the mechanic. | ||
| FAxisAlignedBox3d | GetSelectionBounds
(
bool bWorld |
||
| FFrame3d | GetSelectionFrame
(
bool bWorld, |
||
| TSharedPtr< FMeshTopologySelector, ESPMode::ThreadSafe > | |||
| FGroupTopologySelector::FSelectionSettings | GetTopoSelectorSettings
(
bool bUseOrthoSettings |
Get the topology selector settings to use given the current selection settings. | |
| bool | HasSelection () |
||
| void | Initialize
(
const FDynamicMesh3* MeshIn, |
||
| void | |||
| bool | When true, the selection mechanic is currently tracking a marquee rectangle drag, and acting on the selection may be unwise until it is over (and an OnSelectionChanged event is fired). | ||
| void | NotifyMeshChanged
(
bool bTopologyModified |
Notify internal data structures that the associated MeshComponent has been modified. | |
| void | OnDragRectangleChanged
(
const FCameraRectangle& CurrentRectangle |
||
| void | OnDragRectangleFinished
(
const FCameraRectangle& Rectangle, |
||
| void | These get bound to marquee mechanic delegates. | ||
| void | RenderMarquee
(
IToolsContextRenderAPI* RenderAPI |
Render only the MarqueeMechanic, without rendering the current selection | |
| void | SelectAll () |
||
| void | SetBasePriority
(
const FInputCapturePriority& Priority |
Sets the base priority so that tools can make sure that their own behaviors are higher priority. | |
| void | SetIsEnabled
(
bool bOn |
Enable/disable the mechanic without permanently removing behaviors or shutting it down. | |
| void | SetSelection
(
const FGroupTopologySelection& Selection, |
Replace the current selection with an external selection. | |
| void | SetShouldAddToSelectionFunc
(
TFunction< bool(void)> Func |
By default, the shift key will cause new clicks to add to the selection. | |
| void | SetShouldRemoveFromSelectionFunc
(
TFunction< bool(void)> Func |
By default, the Ctrl key will cause new clicks to remove from the existing selection. | |
| void | SetShouldSelectEdgeLoopsFunc
(
TFunction< bool(void)> Func |
||
| void | SetShouldSelectEdgeRingsFunc
(
TFunction< bool(void)> Func |
||
| void | SetShowEdges
(
const bool bRenderEdges |
Toggle rendering of edges | |
| void | SetShowSelectableCorners
(
bool bShowCorners |
||
| bool | TopologyHitTest
(
const FRay& WorldRay, |
Perform a hit test on the topology using the current selection settings. | |
| bool | TopologyHitTest
(
const FRay& WorldRay, |
Perform a hit test on the topology using the current selection settings. | |
| bool | UpdateHighlight
(
const FRay& WorldRay |
Hover API Update the hover highlight based on the hit elements at the given World Ray | |
| void | |||
| bool | UpdateSelection
(
const FRay& WorldRay, |
Selection API Intersect the ray with the mesh and update the selection based on the hit element, modifier states, etc |
Overridden from UInteractionMechanic
| Type | Name | Description | |
|---|---|---|---|
| void | Render
(
IToolsContextRenderAPI* RenderAPI |
Allow the Mechanic to do any custom drawing (ie via PDI/RHI) | |
| void | Setup
(
UInteractiveTool* ParentTool |
Called to initialize the InteractionMechanic | |
| void | Shutdown () |
Called to clean up the InteractionMechanic |
Overridden from IClickBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| FInputRayHit | IsHitByClick
(
const FInputDeviceRay& ClickPos |
IClickBehaviorTarget implementation. | |
| void | OnClicked
(
const FInputDeviceRay& ClickPos |
Notify Target that click ocurred |
Overridden from IModifierToggleBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| void | OnUpdateModifierState
(
int ModifierID, |
Notify target of current modifier state |
Overridden from IHoverBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| FInputRayHit | BeginHoverSequenceHitTest
(
const FInputDeviceRay& PressPos |
IHoverBehaviorTarget implementation. | |
| void | OnBeginHover
(
const FInputDeviceRay& DevicePos |
Initialize hover sequence at given position | |
| void | OnEndHover () |
Terminate active hover sequence | |
| bool | OnUpdateHover
(
const FInputDeviceRay& DevicePos |
Update active hover sequence with new input position |
Typedefs
| Name | Description |
|---|---|
| FAxisAlignedBox3d | |
| FFrame3d |
Constants
| Name | Description |
|---|---|
| CtrlModifierID | |
| ShiftModifierID |