UMeshSelectionMechanic

Mechanic for selecting elements of a dynamic mesh.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ModelingComponents

Header

/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/Selection/MeshSelectionMechanic.h

Include

#include "Selection/MeshSelectionMechanic.h"

Syntax

UCLASS()
class UMeshSelectionMechanic :
    public UInteractionMechanic,
    public IClickBehaviorTarget

Remarks

Mechanic for selecting elements of a dynamic mesh.

TODO: Currently only able to select unoccluded elements.

Variables

Name Description

Protected variable

bool

 

bCtrlToggle

Protected variable

bool

 

bShiftToggle

Protected variable

FViewCameraStat...

 

CameraState

Protected variable

int32

 

CentroidTimestamp

Protected variable

FDynamicMeshSel...

 

CurrentSelection

Protected variable

FVector3d

 

CurrentSelectionCentroid

Protected variable

int32

 

CurrentSelectionIndex

Public variable

TUniqueFunction...

 

EmitSelectionChange

Function to use for emitting selection change events.

Protected variable UProperty

TObjectPtr< APr...

 

HoverGeometryActor

Protected variable UProperty

TObjectPtr< ULi...

 

HoverLineSet

Protected variable UProperty

TObjectPtr< UPo...

 

HoverPointSet

Protected variable UProperty

TObjectPtr< UTr...

 

HoverTriangleSet

Protected variable UProperty

TObjectPtr< UMa...

 

HoverTriangleSetMaterial

Protected variable UProperty

TObjectPtr< ULi...

 

LineSet

Protected variable UProperty

TObjectPtr< URe...

 

MarqueeMechanic

Protected variable

TArray< TShared...

 

MeshSpatials

Protected variable

TArray< FTransf...

 

MeshTransforms

Public variable

FSimpleMulticas...

 

OnSelectionChanged

Protected variable UProperty

TObjectPtr< UPo...

 

PointSet

Protected variable

FDynamicMeshSel...

 

PreDragSelection

Protected variable UProperty

TObjectPtr< APr...

 

PreviewGeometryActor

Public variable

EMeshSelectionM...

 

SelectionMode

Protected variable UProperty

TObjectPtr< UMe...

 

Settings

Protected variable UProperty

TObjectPtr< UTr...

 

TriangleSet

Protected variable UProperty

TObjectPtr< UMa...

 

TriangleSetMaterial

The material being displayed for selected triangles

Protected variable

FMeshSelectionM...

 

VisualizationStyle

Destructors

Name Description

Public function Virtual

~UMeshSelectionMechanic()

Functions

Name Description

Public function Virtual

void

 

AddSpatial

(
    TSharedPtr< FDynamicMeshAABBTree3 >...,
    const FTransform& TransformIn
)

Use this to initialize the meshes we want to hit test.

Public function

void

 

ChangeSelectionMode

(
    const EMeshSelectionMechanicMode& ...
)

Public function Virtual

void

 

DrawHUD

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

Public function Virtual Const

const FDynam...

 

GetCurrentSelection()

Public function

FVector3d

 

GetCurrentSelectionCentroid()

Public function

void

 

OnDragRectangleChanged

(
    const FCameraRectangle& CurrentRec...
)

Public function

void

 

OnDragRectangleFinished

(
    const FCameraRectangle& Rectangle,
    bool bCancelled
)

Public function

void

 

OnDragRectangleStarted()

Public function

TSet< int32 ...

 

RayCast

(
    const FInputDeviceRay& ClickPos,
    EMeshSelectionMechanicMode Mode
)

Public function

void

 

RebuildDrawnElements

(
    const FTransform& StartTransform
)

Rebuilds the drawn selection highlights, and intializes them in such a way that their transform is equal to StartTransform (useful so that their transform can later be changed)

Public function

void

 

SetDrawnElementsTransform

(
    const FTransform& Transform
)

Changes the transform of the selection highlights.

Public function Virtual

void

 

SetSelection

(
    const FDynamicMeshSelection& Selec...,
    bool bBroadcast,
    bool bEmitChange
)

Public function

void

 

SetVisualizationStyle

(
    const FMeshSelectionMechanicStyle&...
)

Public function

void

 

SetWorld

(
    UWorld* World
)

Protected function Const

bool

 

ShouldAddToSelection()

All four combinations of shift/ctrl down are assigned a behaviour.

Protected function Const

bool

 

ShouldRemoveFromSelection()

Protected function Const

bool

 

ShouldRestartSelection()

Protected function Const

bool

 

ShouldToggleFromSelection()

Protected function

void

 

UpdateCentroid()

Overridden from UInteractionMechanic

Name Description

Public function Virtual

void

 

Render

(
    IToolsContextRenderAPI* Render...
)

Allow the Mechanic to do any custom drawing (ie via PDI/RHI)

Public function Virtual

void

 

Setup

(
    UInteractiveTool* ParentTool
)

Called to initialize the InteractionMechanic

Public function Virtual

void

 

Shutdown()

Called to clean up the InteractionMechanic

Overridden from IClickBehaviorTarget

Name Description

Public function Virtual

FInputRayHit

 

IsHitByClick

(
    const FInputDeviceRay& ClickPos
)

IClickBehaviorTarget implementation.

Public function Virtual

void

 

OnClicked

(
    const FInputDeviceRay& ClickPos
)

Notify Target that click ocurred

Overridden from IModifierToggleBehaviorTarget

Name Description

Public function Virtual

void

 

OnUpdateModifierState

(
    int ModifierID,
    bool bIsOn
)

IModifierToggleBehaviorTarget implementation.

Typedefs

Constants

Name

Description

CtrlModifierID

ShiftModifierID