Navigation
API > API/Plugins > API/Plugins/ModelingComponents
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.
| Name | UPolyLassoMarqueeMechanic |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Mechanics/PolyLassoMarqueeMechanic.h |
| Include Path | #include "Mechanics/PolyLassoMarqueeMechanic.h" |
Syntax
UCLASS (MinimalAPI)
class UPolyLassoMarqueeMechanic :
public UInteractionMechanic ,
public IClickDragBehaviorTarget ,
public IHoverBehaviorTarget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractionMechanic → UPolyLassoMarqueeMechanic
Implements Interfaces
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| OnDrawPolyLassoChangedEvent | TMulticastDelegate_OneParam< void, const FCameraPolyLasso & > | Called as the user drags the other corner of the PolyLasso around. | Mechanics/PolyLassoMarqueeMechanic.h |
| OnDrawPolyLassoFinishedEvent | TMulticastDelegate_TwoParams< void, const FCameraPolyLasso &, bool bCanceled > | Called once the user lets go of the mouse button after dragging out a PolyLasso. | Mechanics/PolyLassoMarqueeMechanic.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bEnableFreehandPolygons | bool | If true, freehand polygons can be drawn by click-dragging the mouse | Mechanics/PolyLassoMarqueeMechanic.h | |
| bEnableMultiClickPolygons | bool | If true, if click and release are within SpacingTolerance, mechanic enters a multi-click mode, where each click adds a vertex to a polygon. | Mechanics/PolyLassoMarqueeMechanic.h | |
| ClosedColor | FLinearColor | PolyLasso path is drawn in this color if the cursor is at a point that would close the loop | Mechanics/PolyLassoMarqueeMechanic.h | |
| LineColor | FLinearColor | PolyLasso path is drawn in this color | Mechanics/PolyLassoMarqueeMechanic.h | |
| LineThickness | float | Thickness of the 2D PolyLasso drawing path | Mechanics/PolyLassoMarqueeMechanic.h | |
| OnDrawPolyLassoChanged | OnDrawPolyLassoChangedEvent | Mechanics/PolyLassoMarqueeMechanic.h | ||
| OnDrawPolyLassoFinished | OnDrawPolyLassoFinishedEvent | Mechanics/PolyLassoMarqueeMechanic.h | ||
| OnDrawPolyLassoStarted | FSimpleMulticastDelegate | Called when user starts dragging a new PolyLasso. | Mechanics/PolyLassoMarqueeMechanic.h | |
| SpacingTolerance | float | Tolerance for PolyLasso points and closure test | Mechanics/PolyLassoMarqueeMechanic.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsDragging | bool | Mechanics/PolyLassoMarqueeMechanic.h | ||
| bIsEnabled | bool | Mechanics/PolyLassoMarqueeMechanic.h | ||
| bIsInMultiClickPolygon | bool | Mechanics/PolyLassoMarqueeMechanic.h | ||
| bIsMultiClickPolygonClosed | bool | Mechanics/PolyLassoMarqueeMechanic.h | ||
| CurrentPolyLasso | FCameraPolyLasso | Mechanics/PolyLassoMarqueeMechanic.h | ||
| DragCurrentScreenPosition | FVector2D | Mechanics/PolyLassoMarqueeMechanic.h | ||
| PolyPathPoints | TArray< FInputDeviceRay > | Mechanics/PolyLassoMarqueeMechanic.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void DrawHUD
(
FCanvas* Canvas, |
Mechanics/PolyLassoMarqueeMechanic.h | ||
TPair< FInputCapturePriority, FInputCapturePriority > GetPriorityRange () |
Gets the current priority range used by behaviors in the mechanic, higher priority to lower. | Mechanics/PolyLassoMarqueeMechanic.h | |
bool IsEnabled() |
Mechanics/PolyLassoMarqueeMechanic.h | ||
void SetBasePriority
(
const FInputCapturePriority& Priority |
Sets the base priority so that users can make sure that their own behaviors are higher priority. | Mechanics/PolyLassoMarqueeMechanic.h | |
void SetIsEnabled
(
bool bOn |
Enable/disable the PolyLasso mechanic (effectively controls whether the mechanic's behaviors will be allowed to capture the mouse) | Mechanics/PolyLassoMarqueeMechanic.h |
Overridden from UInteractionMechanic
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Setup
(
UInteractiveTool* ParentTool |
UInteractionMechanic. | Mechanics/PolyLassoMarqueeMechanic.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool ApproximateSelfClipPolyline
(
TArray< FVector2D >& Polyline |
Utility function clients can use to clean up poly-lasso if it is not closed (perhaps should be folded into mechanic behavior) | Mechanics/PolyLassoMarqueeMechanic.h |