UPolyLassoMarqueeMechanic

Mechanic for a PolyLasso "marquee" selection.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ModelingComponents

Header

/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Mechanics/PolyLassoMarqueeMechanic.h

Include

#include "Mechanics/PolyLassoMarqueeMechanic.h"

Syntax

UCLASS()
class UPolyLassoMarqueeMechanic :
    public UInteractionMechanic,
    public IClickDragBehaviorTarget,
    public IHoverBehaviorTarget

Remarks

Mechanic for a PolyLasso "marquee" selection. It creates and maintains the 2D PolyLasso associated with a mouse drag. It does not test against any scene geometry, nor does it maintain any sort of list of selected objects.

The PolyLasso has two potential modes, a freehand polyline and a multi-click polygon. By default both are enabled but this can be selectively controlled with flags below. If a click-and-release is within a small distance tolerance, then a multi-click polygon is entered, and must be exited by clicking again at the start point. The freehand polyline is drawn by click-dragging, and exited by releasing the mouse.

When using this mechanic, you should call DrawHUD() in the tool's DrawHUD() call so that it can draw the box.

Attach to the mechanic's delegates and use the passed PolyLasso to test against your geometry.

Variables

Name Description

Protected variable

FInputCapturePr...

 

BasePriority

Public variable UProperty

bool

 

bEnableFreehandPolygons

If true, freehand polygons can be drawn by click-dragging the mouse

Public variable UProperty

bool

 

bEnableMultiClickPolygons

If true, if click and release are within SpacingTolerance, mechanic enters a multi-click mode, where each click adds a vertex to a polygon.

Protected variable

FViewCameraStat...

 

CachedCameraState

Camera state for currently active PolyLasso

Protected variable UProperty

TObjectPtr< UCl...

 

ClickDragBehavior

Public variable UProperty

FLinearColor

 

ClosedColor

PolyLasso path is drawn in this color if the cursor is at a point that would close the loop

Protected variable UProperty

TObjectPtr< UMo...

 

HoverBehavior

Public variable UProperty

FLinearColor

 

LineColor

PolyLasso path is drawn in this color

Public variable UProperty

float

 

LineThickness

Thickness of the 2D PolyLasso drawing path

Public variable

OnDrawPolyLasso...

 

OnDrawPolyLassoChanged

Public variable

OnDrawPolyLasso...

 

OnDrawPolyLassoFinished

Public variable

FSimpleMulticas...

 

OnDrawPolyLassoStarted

Called when user starts dragging a new PolyLasso.

Public variable UProperty

float

 

SpacingTolerance

Tolerance for PolyLasso points and closure test

Functions

Name Description

Public function Virtual

void

 

DrawHUD

(
    FCanvas* Canvas,
    IToolsContextRenderAPI* Render...
)

Public function Const

TPair< FInpu...

 

GetPriorityRange()

Gets the current priority range used by behaviors in the mechanic, higher priority to lower.

Public function Const

bool

 

IsEnabled()

Public function

void

 

SetBasePriority

(
    const FInputCapturePriority& Prior...
)

Sets the base priority so that users can make sure that their own behaviors are higher priority.

Public function

void

 

SetIsEnabled

(
    bool bOn
)

Enable/disable the PolyLasso mechanic (effectively controls whether the mechanic's behaviors will be allowed to capture the mouse)

Overridden from UInteractionMechanic

Name Description

Public function Virtual

void

 

Setup

(
    UInteractiveTool* ParentTool
)

UInteractionMechanic.

Typedefs

Name

Description

OnDrawPolyLassoChangedEvent

Called as the user drags the other corner of the PolyLasso around.

OnDrawPolyLassoFinishedEvent

Called once the user lets go of the mouse button after dragging out a PolyLasso.