UDrawPolygonTool

This tool allows the user to draw and extrude 2D polygons

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

MeshModelingTools

Header

/Engine/Plugins/Experimental/MeshModelingToolset/Source/MeshModelingTools/Public/DrawPolygonTool.h

Include

#include "DrawPolygonTool.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UDrawPolygonTool :
    public UInteractiveTool,
    public IClickSequenceBehaviorTarget

Remarks

This tool allows the user to draw and extrude 2D polygons

Variables

Name Description

Protected variable

IToolsContextAs...

 

AssetAPI

Protected variable

bool

 

bAbortActivePolygonDraw

Protected variable

bool

 

bHaveSelfIntersection

Protected variable

bool

 

bHaveSurfaceHit

Only used when SnapSettings.bHitSceneObjects = true

Protected variable

bool

 

bIgnoreSnappingToggle

Protected variable

bool

 

bInFixedPolygonMode

Protected variable

bool

 

bInInteractiveExtrude

Protected variable

bool

 

bPreviewUpdatePending

Protected variable

FViewCameraStat...

 

CameraState

Protected variable

int32

 

CurrentCurveTimestamp

Protected variable

FQuaterniond

 

DrawPlaneOrientation

Orientation of plane we will draw polygon on

Protected variable

FVector3d

 

DrawPlaneOrigin

Origin of plane we will draw polygon on

Protected variable

TArray< FVector...

 

FixedPolygonClickPoints

Protected variable UProperty

UPlaneDistanceF...

 

HeightMechanic

Protected variable

FFrame3f

 

HitPosFrameWorld

Protected variable

FVector3d

 

LastGridSnapPoint

Protected variable

ToolSceneQuerie...

 

LastSnapGeometry

Protected variable UProperty

UNewMeshMateria...

 

MaterialProperties

Protected variable UProperty

UTransformGizmo...

 

PlaneTransformGizmo

Protected variable UProperty

UTransformProxy...

 

PlaneTransformProxy

Protected variable

TArray< TArray<...

 

PolygonHolesVertices

Vertices of holes in current preview polygon

Protected variable UProperty

UDrawPolygonToo...

 

PolygonProperties

Properties that control polygon generation exposed to user via detailsview

Protected variable

TArray< FVector...

 

PolygonVertices

Vertices of current preview polygon

Protected variable UProperty

UPreviewMesh &#...

 

PreviewMesh

Protected variable

FVector3d

 

PreviewVertex

Last vertex of polygon that is actively being updated as input device is moved

Protected variable

FVector3d

 

SelfIntersectionPoint

Protected variable

int

 

SelfIntersectSegmentIdx

Protected variable

IClickBehaviorT...

 

SetPointInWorldConnector

Calls SetDrawPlaneFromWorldPos when user ctrl+clicks on scene

Protected variable

TValueWatcher< ...

 

ShowGizmoWatcher

Protected variable

FPointPlanarSna...

 

SnapEngine

Protected variable UProperty

UDrawPolygonToo...

 

SnapProperties

Protected variable

FVector3d

 

SurfaceHitPoint

Protected variable

FVector3d

 

SurfaceOffsetPoint

Protected variable

UWorld *

 

TargetWorld

Constructors

Name Description

Public function

UDrawPolygonTool()

Functions

Name Description

Public function Virtual

void

 

AppendVertex

(
    const FVector3d& Vertex
)

Public function Virtual

void

 

BeginInteractiveExtrude()

Protected function Const

bool

 

CheckInCurve

(
    int32 Timestamp
)

Public function Virtual

void

 

EmitCurrentPolygon()

Public function Virtual

void

 

EndInteractiveExtrude()

Public function Virtual

bool

 

FindDrawPlaneHitPoint

(
    const FInputDeviceRay& ClickPos,
    FVector3d& HitPosOut
)

Protected function

void

 

GenerateFixedPolygon

(
    const TArray< FVector3d >& FixedPo...,
    TArray< FVector3d >& VerticesOut,
    TArray< TArray< FVector3d >>& Hole...
)

Protected function

bool

 

GeneratePolygonMesh

(
    const TArray< FVector3d >& Polygon,
    const TArray< TArray< FVector3d >> ...,
    FDynamicMesh3* ResultMeshOut,
    FFrame3d& WorldFrameOut,
    bool bIncludePreviewVtx,
    double ExtrudeDistance,
    bool bExtrudeSymmetric
)

Generate extruded meshes. Returns true on success.

Protected function

void

 

GetPolygonParametersFromFixedPoints

(
    const TArray< FVector3d >& FixedPo...,
    FVector2d& FirstReferencePt,
    FVector2d& BoxSize,
    double& YSign,
    double& AngleRad
)

Protected function

void

 

PlaneTransformChanged

(
    UTransformProxy* Proxy,
    FTransform Transform
)

Called on PlaneTransformProxy.OnTransformChanged

Public function Virtual

void

 

PopLastVertexAction()

Public function Virtual

void

 

ResetPolygon()

Polygon drawing functions

Public function Virtual

void

 

SetAssetAPI

(
    IToolsContextAssetAPI* AssetAP...
)

Protected function Virtual

void

 

SetDrawPlaneFromWorldPos

(
    const FVector3d& Position,
    const FVector3d& Normal
)

Updates plane and gizmo position

Public function Virtual

void

 

SetWorld

(
    UWorld* World
)

Protected function

void

 

ShowExtrudeMessage()

Protected function

void

 

ShowStartupMessage()

User feedback messages

Protected function

void

 

UndoCurrentOperation()

Protected function

void

 

UpdateLivePreview()

Public function Virtual

void

 

UpdatePreviewVertex

(
    const FVector3d& PreviewVertex
)

Protected function

bool

 

UpdateSelfIntersection()

Can close poly if current segment intersects existing segment

Protected function

void

 

UpdateShowGizmoState

(
    bool bNewVisibility
)

Overridden from UInteractiveTool

Name Description

Public function Virtual Const

bool

 

CanAccept()

Public function Virtual Const

bool

 

HasAccept()

Public function Virtual Const

bool

 

HasCancel()

Public function Virtual

void

 

RegisterActions

(
    FInteractiveToolActionSet& ActionS...
)

Override this function to register the set of Actions this Tool supports, using FInteractiveToolActionSet::RegisterAction.

Public function Virtual

void

 

Render

(
    IToolsContextRenderAPI* Render...
)

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

Public function Virtual

void

 

Setup()

Called by ToolManager to initialize the Tool after ToolBuilder::BuildTool() has been called

Public function Virtual

void

 

Shutdown

(
    EToolShutdownType ShutdownType
)

Called by ToolManager to shut down the Tool

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

Allow the Tool to do any necessary processing on Tick

Overridden from IClickSequenceBehaviorTarget

Name Description

Public function Virtual

bool

 

CanBeginClickSequence

(
    const FInputDeviceRay& ClickPos
)

Test if target would like to begin sequence based on this click

Public function Virtual

void

 

OnBeginClickSequence

(
    const FInputDeviceRay& ClickPos
)

Notify Target that click sequence can begin at click point

Public function Virtual

void

 

OnBeginSequencePreview

(
    const FInputDeviceRay& ClickPos
)

Notify Target device position has changed but a click sequence hasn't begun yet (eg for interactive previews)

Public function Virtual

bool

 

OnNextSequenceClick

(
    const FInputDeviceRay& ClickPos
)

Notify Target about next click in sqeuence

Public function Virtual

void

 

OnNextSequencePreview

(
    const FInputDeviceRay& ClickPos
)

Notify Target device position has changed but a click hasn't ocurred yet (eg for interactive previews)

Public function Virtual

void

 

OnTerminateClickSequence()

Notify Target that click sequence has been explicitly terminated (eg by escape key, cancel tool, etc)

Public function Virtual

bool

 

RequestAbortClickSequence()

Target overrides this and returns true if it wants to abort click sequence.

Overridden from IModifierToggleBehaviorTarget

Name Description

Public function Virtual

void

 

OnUpdateModifierState

(
    int ModifierID,
    bool bIsOn
)

Notify target of current modifier state

Constants

Name

Description

AngleSnapModifier

IgnoreSnappingModifier

Flags used to identify modifier keys/buttons

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss