ULatticeControlPointsMechanic

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ModelingComponents

Header

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

Include

#include "Mechanics/LatticeControlPointsMechanic.h"

Syntax

UCLASS()
class ULatticeControlPointsMechanic :
    public UInteractionMechanic,
    public IClickBehaviorTarget,
    public IHoverBehaviorTarget

Variables

Name Description

Protected variable

bool

 

bCtrlToggle

Protected variable

bool

 

bGizmoBeingDragged

Used to make it easy to tell whether the gizmo was moved by the user or by undo/redo or some other change that we shouldn't respond to.

Public variable

bool

 

bHasChanged

Protected variable

bool

 

bShiftToggle

Support for Shift and Ctrl toggle.

Protected variable

FViewCameraStat...

 

CachedCameraState

Protected variable

TMap< int32, FC...

 

ColorOverrides

Protected variable

TArray< FVector...

 

ControlPoints

Protected variable

int32

 

CurrentChangeStamp

Used for expiring undo/redo changes, which compare this to their stored value and expire themselves if they do not match.

Protected variable

TArray< int32 >

 

CurrentDragSelection

Protected variable UProperty

TObjectPtr< UPo...

 

DrawnControlPoints

Protected variable UProperty

TObjectPtr< ULi...

 

DrawnLatticeEdges

Protected variable

UE::Geometry::F...

 

GeometrySet

Used for spatial queries.

Protected variable

TFunction< bool...

 

GeometrySetToleranceTest

Support for hovering.

Protected variable

FVector

 

GizmoStartPosition

The starting point of the gizmo is needed to determine the offset by which to move the points.

Protected variable

FQuat

 

GizmoStartRotation

Protected variable

FVector

 

GizmoStartScale

Protected variable

FColor

 

HoverColor

Protected variable

int32

 

HoveredPointID

Protected variable

TArray< FVector...

 

LatticeEdges

Protected variable

FTransform3d

 

LocalToWorldTransform

Protected variable UProperty

TObjectPtr< URe...

 

MarqueeMechanic

Support for selection.

Protected variable

FColor

 

NormalPointColor

Protected variable

FColor

 

NormalSegmentColor

Variables for drawing.

Public variable

OnPointsChanged...

 

OnPointsChanged

Public variable

OnSelectionChan...

 

OnSelectionChanged

Protected variable

float

 

PointsSize

Protected variable UProperty

TObjectPtr< UCo...

 

PointTransformGizmo

Protected variable UProperty

TObjectPtr< UTr...

 

PointTransformProxy

Support for gizmo.

Protected variable

TSet< int32 >

 

PreDragSelection

Protected variable

FColor

 

PreHoverPointColor

Cache previous color while temporarily changing the color of a hovered-over point.

Protected variable UProperty

TObjectPtr< APr...

 

PreviewGeometryActor

Used for displaying points/segments

Protected variable

float

 

SegmentsThickness

Protected variable

FColor

 

SelectedColor

Protected variable

TSet< int32 >

 

SelectedPointIDs

Protected variable

TMap< int32, FV...

 

SelectedPointStartPositions

We need the selected point start positions so we can move multiple points appropriately.

Protected variable

TFunction< bool...

 

ShouldAddToSelectionFunc

Default modifier key behavior is consistent with PolygonSelectionMechanic.

Protected variable

TFunction< bool...

 

ShouldRemoveFromSelectionFunc

Functions

Name Description

Public function

void

 

ClearAllPointColorOverrides()

Protected function

void

 

ClearHover()

Public function

void

 

ClearPointColorOverride

(
    int32 Index
)

Public function

bool

 

ControlPointIsSelected

(
    int32 Index
)

Protected function

bool

 

DeselectPoint

(
    int32 PointID
)

Public function Virtual

void

 

DrawHUD

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

Public function Const

const TArray...

 

GetControlPoints()

Public function Const

EToolContext...

 

GetCoordinateSystem()

Public function Const

const TSet< ...

 

GetSelectedPointIDs()

Protected function

void

 

GizmoTransformChanged

(
    UTransformProxy* Proxy,
    FTransform Transform
)

Callbacks we'll receive from the gizmo proxy.

Protected function

void

 

GizmoTransformEnded

(
    UTransformProxy* Proxy
)

Protected function

void

 

GizmoTransformStarted

(
    UTransformProxy* Proxy
)

Protected function

bool

 

HitTest

(
    const FInputDeviceRay& ClickPos,
    FInputRayHit& ResultOut
)

All of the following do not issue undo/redo change objects.

Public function Virtual

void

 

Initialize

(
    const TArray< FVector3d >& Points,
    const TArray< FVector2i >& Edges,
    const FTransform3d& LocalToWorldTr...
)

Protected function

void

 

OnDragRectangleChanged

(
    const FCameraRectangle& Rectangle
)

Protected function

void

 

OnDragRectangleFinished

(
    const FCameraRectangle& Rectangle,
    bool bCancelled
)

Protected function

void

 

OnDragRectangleStarted()

Protected function

void

 

RebuildDrawables()

Protected function

void

 

SelectPoint

(
    int32 PointID
)

Public function

void

 

SetCoordinateSystem

(
    EToolContextCoordinateSystem InCoor...
)

Public function

void

 

SetPointColorOverride

(
    int32 Index,
    const FColor& NewColor
)

Public function

void

 

SetWorld

(
    UWorld* World
)

Public function

void

 

UpdateControlPointPositions

(
    const TArray< FVector3d >& NewPoin...
)

Public function

void

 

UpdateDrawables()

Protected function

void

 

UpdateGizmoLocation()

Public function

void

 

UpdatePointLocations

(
    const TMap< int32, FVector3d >& Ne...
)

Public function

void

 

UpdateSetPivotMode

(
    bool bInSetPivotMode
)

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
)

UInteractionMechanic.

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
)

Notify target of current modifier state

Overridden from IHoverBehaviorTarget

Name Description

Public function Virtual

FInputRayHit

 

BeginHoverSequenceHitTest

(
    const FInputDeviceRay& PressPos
)

IHoverBehaviorTarget implementation.

Public function Virtual

void

 

OnBeginHover

(
    const FInputDeviceRay& DevicePos
)

Initialize hover sequence at given position

Public function Virtual

void

 

OnEndHover()

Terminate active hover sequence

Public function Virtual

bool

 

OnUpdateHover

(
    const FInputDeviceRay& DevicePos
)

Update active hover sequence with new input position

Typedefs

Name

Description

FTransform3d

FVector2i

OnPointsChangedEvent

This delegate is called every time the control points are moved.

OnSelectionChangedEvent

This delegate is called every time the control point selection changes.

Constants

Name

Description

CtrlModifierID

ShiftModifierID