FEditorModeTools

A helper class to store the state of the various editor modes.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Public/EditorModeManager.h

Include

#include "EditorModeManager.h"

Syntax

class FEditorModeTools :
    public FGCObject,
    public FEditorUndoClient

Remarks

A helper class to store the state of the various editor modes.

Variables

Name Description

Protected variable

TArray< UEdMode...

 

ActiveScriptableModes

A list of active editor modes.

Protected variable

bool

 

bHideViewportUI

If true, the viewports will hide all UI overlays

Protected variable

bool

 

bSelectionHasSceneComponent

If true the current selection has a scene component

Protected variable

bool

 

bShowWidget

If 1, draw the widget and let the user interact with it.

Public variable

FVector

 

CachedLocation

Protected variable

TArray< FEditor...

 

DefaultModeIDs

List of default modes for this tool. These must all be compatible with each other.

Public variable

FVector

 

GridBase

Public variable

FString

 

InfoString

Draws in the top level corner of all FEditorViewportClient windows (can be used to relay info to the user).

Protected variable

FWidget::EWidge...

 

OverrideWidgetMode

If the widget mode is being overridden, this will be != WM_None.

Public variable

FVector

 

PivotLocation

Public variable

bool

 

PivotShown

Protected variable

TMap< FEditorMo...

 

RecycledScriptableModes

A list of previously active editor modes that we will potentially recycle

Public variable

bool

 

SnappedActor

Public variable

FVector

 

SnappedLocation

Public variable

bool

 

Snapping

Protected variable

TWeakPtr< ITool...

 

ToolkitHost

The host of the toolkits created by these modes

Public variable

float

 

TranslateRotate2DAngle

The angles for the 2d translate rotate widget

Public variable

float

 

TranslateRotateXAxisAngle

The angle for the translate rotate widget

Protected variable

FWidget::EWidge...

 

WidgetMode

The mode that the editor viewport widget is in.

Protected variable

float

 

WidgetScale

Scale Factor for Widget

Constructors

Name Description

Public function

FEditorModeTools()

Destructors

Name Description

Public function Virtual

~FEditorModeTools()

Functions

Name Description

Public function

void

 

ActivateDefaultMode()

Activates the default modes defined by this class.

Public function

void

 

ActivateMode

(
    FEditorModeID InID,
    bool bToggle
)

Activates an editor mode.

Public function

void

 

ActorMoveNotify()

Public function

void

 

ActorPropChangeNotify()

Public function

void

 

ActorsDuplicatedNotify

(
    TArray< AActor* >& InPreDupli...,
    TArray< AActor* >& InPostDupl...,
    const bool bOffsetLocations
)

Public function

void

 

ActorSelectionChangeNotify()

Public function

void

 

AddDefaultMode

(
    const FEditorModeID DefaultModeID
)

Adds a new default mode to this tool's list of default modes.

Public function Const

bool

 

AllowsViewportDragTool()

Public function Const

bool

 

AllowWidgetMove()

True if we should allow widget move

true if we should allow widget move

Public function

bool

 

BoxSelect

(
    FBox& InBox,
    bool InSelect
)

Notifies all active modes of box selection attempts

Public function

void

 

BroadcastCoordSystemChanged

(
    ECoordSystem InCoordSystem
)

Broadcasts the CoordSystemChangedEvent event

Public function

void

 

BroadcastEditorModeIDChanged

(
    const FEditorModeID& ModeID,
    bool IsEnteringMode
)

Broadcasts the EditorModeIDChanged event

Public function

void

 

BroadcastWidgetModeChanged

(
    FWidget::EWidgetMode InWidgetMode
)

Broadcasts the WidgetModeChanged event

Public function Const

bool

 

CanAutoSave()

Returns true if all active EdModes are OK with an AutoSave happening now

Public function Const

bool

 

CanCycleWidgetMode()

Check with modes to see if the widget mode can be cycled

Public function

bool

 

CapturedMouseMove

(
    FEditorViewportClient* InViewp...,
    FViewport* InViewport,
    int32 InMouseX,
    int32 InMouseY
)

Notifies all active modes of captured mouse movement

Public function

bool

 

ComputeBoundingBoxForViewportFocus

(
    AActor* Actor,
    UPrimitiveComponent* Primitive...,
    FBox& InOutBox
)

Allows editor modes to override the bounding box used to focus the viewport on a selection

Public function

void

 

CycleWidgetMode()

Cycle the widget mode, forwarding queries to modes

Used to cycle widget modes

Public function

void

 

DeactivateAllModes()

Deactivates all modes,

some modes can never be deactivated.

Public function

void

 

DeactivateMode

(
    FEditorModeID InID
)

Deactivates an editor mode.

Public function

void

 

DeactivateOtherVisibleModes

(
    FEditorModeID InMode
)

Protected function

void

 

DeactivateScriptableModeAtIndex

(
    int32 InIndex
)

Deactivates the editor mode at the specified index

Public function

void

 

DestroyMode

(
    FEditorModeID InID
)

Deactivate the mode and entirely purge it from memory. Used when a mode type is unregistered

Public function Const

bool

 

DisallowMouseDeltaTracking()

True if we should disallow mouse delta tracking.

Public function

void

 

DrawActiveModes

(
    const FSceneView* InView,
    FPrimitiveDrawInterface* PDI
)

Draws all active modes

Draws all active mode components

Public function

void

 

DrawHUD

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport,
    const FSceneView* View,
    FCanvas* Canvas
)

Draws the HUD for all active modes

Public function

bool

 

EndTracking

(
    FEditorViewportClient* InViewp...,
    FViewport* InViewport
)

Mouse tracking interface. Passes tracking messages to all active modes

Public function Const

bool

 

EnsureNotInMode

(
    FEditorModeID ModeID,
    const FText& ErrorMsg,
    bool bNotifyUser
)

Returns true if the current mode is not the specified ModeID. Also optionally warns the user.

Public function

bool

 

FrustumSelect

(
    const FConvexVolume& InFrustum,
    FEditorViewportClient* InViewp...,
    bool InSelect
)

Notifies all active modes of frustum selection attempts

Public function

EEditAction:...

 

GetActionEditCopy()

Public function

EEditAction:...

 

GetActionEditCut()

Public function

EEditAction:...

 

GetActionEditDelete()

Public function

EEditAction:...

 

GetActionEditDuplicate()

Public function

EEditAction:...

 

GetActionEditPaste()

Public function Const

const FEdMod...

 

GetActiveMode

(
    FEditorModeID InID
)

Returns a pointer to an active mode specified by the passed in ID If the editor mode is not active, NULL is returned

Public function

FEdMode *...

 

GetActiveMode

(
    FEditorModeID InID
)

Returns a pointer to an active mode specified by the passed in ID If the editor mode is not active, NULL is returned

Public function

SpecificMode...

 

GetActiveModeTyped

(
    FEditorModeID InID
)

Public function Const

const Specif...

 

GetActiveModeTyped

(
    FEditorModeID InID
)

Public function Const

UEdMode *...

 

GetActiveScriptableMode

(
    FEditorModeID InID
)

Public function Const

const FModeT...

 

GetActiveTool

(
    FEditorModeID InID
)

Returns the active tool of the passed in editor mode.

Public function

ECoordSystem

 

GetCoordSystem

(
    bool bGetRawValue
)

Returns the current CoordSystem

Public function Const

bool

 

GetCursor

(
    EMouseCursor::Type& OutCursor
)

Get a cursor to override the default with, if any

Public function

FMatrix

 

GetCustomDrawingCoordinateSystem()

Returns a coordinate system that should be applied on top of the worldspace system.

Public function

FMatrix

 

GetCustomInputCoordinateSystem()

Public function Const

FEditorViewp...

 

GetFocusedViewportClient()

Returns the currently focused viewport client

Public function Const

FEditorViewp...

 

GetHoveredViewportClient()

Returns the currently hovered viewport client

Public function

FMatrix

 

GetLocalCoordinateSystem()

Public function Const

bool

 

GetOverrideCursorVisibility

(
    bool& bWantsOverride,
    bool& bHardwareCursorVisible,
    bool bSoftwareCursorVisible
)

Get override cursor visibility settings

Public function Const

bool

 

GetPivotForOrbit

(
    FVector& OutPivot
)

Get a pivot point specified by any active modes around which the camera should orbit

Public function Virtual Const

USelection &...

 

GetSelectedActors()

Returns the set of selected actors.

Public function Virtual Const

USelection &...

 

GetSelectedComponents()

Returns the set of selected components.

Public function Virtual Const

USelection &...

 

GetSelectedObjects()

Public function Const

bool

 

GetShowWidget()

Public function Const

TSharedPtr< ...

 

GetToolkitHost()

Returns the host for toolkits created via modes from this mode manager

Public function Const

EAxisList::T...

 

GetWidgetAxisToDraw

(
    FWidget::EWidgetMode InWidgetMode
)

Gets the widget axis to be drawn

Public function Const

FVector

 

GetWidgetLocation()

Returns a good location to draw the widget at.

Public function Const

FWidget::EWi...

 

GetWidgetMode()

Retrieves the current widget mode, taking overrides into account.

Public function Const

float

 

GetWidgetScale()

Get Widget Scale

Get Scale On The Widget

Public function Virtual Const

UWorld *

 

GetWorld()

Returns the world that is being edited by this mode manager

Public function

bool

 

HandleClick

(
    FEditorViewportClient* InViewp...,
    HHitProxy* HitProxy,
    const FViewportClick& Click
)

Notifies all active modes of mouse click messages.

Public function Const

bool

 

HasToolkitHost()

Check if toolkit host exists

Public function

bool

 

InputAxis

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport,
    int32 ControllerId,
    FKey Key,
    float Delta,
    float DeltaTime
)

Notifies all active modes of axis movement

Public function

bool

 

InputDelta

(
    FEditorViewportClient* InViewp...,
    FViewport* InViewport,
    FVector& InDrag,
    FRotator& InRot,
    FVector& InScale
)

Notifies all active modes of any change in mouse movement

Public function

bool

 

InputKey

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport,
    FKey Key,
    EInputEvent Event
)

Notifies all active modes of keyboard input

Public function

void

 

InvokeToolPaletteTab

(
    FEditorModeID InMode,
    FName InPaletteName
)

Sets the active Modes ToolBar Palette Tab to the named Palette

Public function Const

bool

 

IsDefaultMode

(
    const FEditorModeID ModeID
)

Returns whether or not the provided mode ID is a default mode

Public function Const

bool

 

IsDefaultModeActive()

Returns true if the default modes are active.

Public function Const

bool

 

IsModeActive

(
    FEditorModeID InID
)

Returns true if the passed in editor mode is active

Public function Const

bool

 

IsOnlyVisibleActiveMode

(
    FEditorModeID InMode
)

Public function Const

bool

 

IsSelectionAllowed

(
    AActor* InActor,
    const bool bInSelected
)

Public function Const

bool

 

IsSelectionHandled

(
    AActor* InActor,
    const bool bInSelected
)

Public function Const

bool

 

IsSnapRotationEnabled()

Public function Const

bool

 

IsTracking()

Public function Const

bool

 

IsViewportUIHidden()

Is the viewport UI hidden?

Public function

void

 

LoadConfig()

Loads the state that was saved in the INI file

Public function

void

 

LoadWidgetSettings()

Load Widget Settings from Ini file

Public function

bool

 

LostFocus

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport
)

Notifies all active modes that a viewport has lost focus

Public function

TSharedRef< ...

 

MakeModeToolbarTab()

Creates the mode toolbar tab if needed

Public function

void

 

MapChangeNotify()

Notifies all active modes that a map change has occured

Public function

bool

 

MouseEnter

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport,
    int32 X,
    int32 Y
)

Public function

bool

 

MouseLeave

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport
)

Public function

bool

 

MouseMove

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport,
    int32 X,
    int32 Y
)

Notifies all active modes that the mouse has moved

Public function

FCoordSystem...

 

OnCoordSystemChanged()

Public function

FEditorModeI...

 

OnEditorModeIDChanged()

Protected function

void

 

OnEditorSelectionChanged

(
    UObject* NewSelection
)

Delegate handlers

Protected function

void

 

OnEditorSelectNone()

Protected function

void

 

OnModeUnregistered

(
    FEditorModeID ModeID
)

Removes the mode ID from the tools manager when a mode is unregistered

Public function

FWidgetModeC...

 

OnWidgetModeChanged()

Public function

bool

 

PostConvertMouseMovement

(
    FEditorViewportClient* InViewp...
)

Called after converting mouse movement to drag/rot

Public function

bool

 

PreConvertMouseMovement

(
    FEditorViewportClient* InViewp...
)

Called before converting mouse movement to drag/rot

Public function

bool

 

ProcessCapturedMouseMoves

(
    FEditorViewportClient* InViewp...,
    FViewport* InViewport,
    const TArrayView< FIntPoint >& Cap...
)

Notifies all active modes of all captured mouse movement

Public function

bool

 

ProcessEditCopy()

Public function

bool

 

ProcessEditCut()

Public function

bool

 

ProcessEditDelete()

Public function

bool

 

ProcessEditDuplicate()

Public function

bool

 

ProcessEditPaste()

Public function

bool

 

ReceivedFocus

(
    FEditorViewportClient* InViewp...,
    FViewport* Viewport
)

Notifies all active modes that a viewport has received focus

Public function

void

 

RemoveDefaultMode

(
    const FEditorModeID DefaultModeID
)

Removes a default mode

Public function

void

 

Render

(
    const FSceneView* InView,
    FViewport* Viewport,
    FPrimitiveDrawInterface* PDI
)

Renders all active modes

Public function

void

 

SaveConfig()

Saves the current state to the INI file

Public function

void

 

SaveWidgetSettings()

Save Widget Settings to Ini file

Public function Const

bool

 

SelectionHasSceneComponent()

Whether or not the current selection has a scene component selected

Public function

void

 

SelectNone()

Notifies all active modes to empty their selections

Public function

void

 

SetCoordSystem

(
    ECoordSystem NewCoordSystem
)

Sets the current CoordSystem

Public function

void

 

SetCurrentWidgetAxis

(
    EAxisList::Type NewAxis
)

Sets the current widget axis

Public function

void

 

SetDefaultMode

(
    const FEditorModeID DefaultModeID
)

Set the default editor mode for these tools

Public function

void

 

SetHideViewportUI

(
    bool bInHideViewportUI
)

Sets the hide viewport UI state

Public function

void

 

SetPivotLocation

(
    const FVector& Location,
    const bool bIncGridBase
)

Sets the pivot locations

Public function

void

 

SetShowWidget

(
    bool InShowWidget
)

Public function

void

 

SetToolkitHost

(
    TSharedRef< IToolkitHost > Host
)

Sets the host for toolkits created via modes from this mode manager (can only be called once)

Public function

void

 

SetWidgetMode

(
    FWidget::EWidgetMode InWidgetMode
)

Changes the current widget mode.

Public function

void

 

SetWidgetModeOverride

(
    FWidget::EWidgetMode InWidgetMode
)

Allows you to temporarily override the widget mode.

Public function

void

 

SetWidgetScale

(
    float InScale
)

Set Scale On The Widget

Public function Const

bool

 

ShouldDrawBrushVertices()

True if brush vertices should be drawn

Public function Const

bool

 

ShouldDrawBrushWireframe

(
    AActor* InActor
)

True if the passed in brush actor should be drawn in wireframe

Public function Const

bool

 

ShouldShowModeToolbar()

Whether or not the mode toolbar should be shown.

Public function Const

bool

 

SnapRotatorToGridOverride

(
    FRotator& InRotation
)

Public function

bool

 

StartTracking

(
    FEditorViewportClient* InViewp...,
    FViewport* InViewport
)

Mouse tracking interface. Passes tracking messages to all active modes

Public function

void

 

Tick

(
    FEditorViewportClient* Viewpor...,
    float DeltaTime
)

Ticks all active modes

Public function

void

 

UpdateInternalData()

Public function Const

bool

 

UsesTransformWidget()

True if any active mode uses a transform widget

Public function Const

bool

 

UsesTransformWidget

(
    FWidget::EWidgetMode CheckMode
)

True if any active mode uses the passed in transform widget

Overridden from FGCObject

Name Description

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Pure virtual that must be overloaded by the inheriting class.

Overridden from FEditorUndoClient

Name Description

Public function Virtual

void

 

PostRedo

(
    bool bSuccess
)

Signal that client should run any PostRedo code

Public function Virtual

void

 

PostUndo

(
    bool bSuccess
)

Begin FEditorUndoClient.

Classes

Name

Description

Public class

FCoordSystemChangedEvent

Delegate type for triggering when coordinate system changed

Public class

FEditorModeIDChangedEvent

Multicast delegate for OnModeEntered and OnModeExited callbacks.

Public class

FWidgetModeChangedEvent

Delegate type for triggering when widget mode changed

Constants

Name

Description

EditorModeToolbarTabName

The toolbar tab name that should be used as the tab identifier

Deprecated Functions

Name Description

Public function Static

bool

 

CheckBookmark

(
    uint32 InIndex,
    FEditorViewportClient* InViewp...
)

Use IBookmarkTypeTools::Get().CheckBookmark

Public function Static

void

 

ClearAllBookmarks

(
    FEditorViewportClient* InViewp...
)

Use IBookmarkTypeTools::Get().ClearAllBookmarks

Public function Static

void

 

ClearBookmark

(
    uint32 InIndex,
    FEditorViewportClient* InViewp...
)

Use IBookmarkTypeTools::Get().ClearBookmark

Public function Static

void

 

CompactBookmarks

(
    FEditorViewportClient* InViewp...
)

Use IBookmarkTypeTools::Get().CompactBookmarks

Public function Static

const uint32

 

GetMaxNumberOfBookmarks

(
    FEditorViewportClient* InViewp...
)

Use IBookmarkTypeTools::Get().GetMaxNumberOfBookmarks

Public function Static

bool

 

GetShowFriendlyVariableNames()

Use GetDefault()->bShowFriendlyNames

Public function

void

 

JumpToBookmark

(
    uint32 InIndex,
    TSharedPtr< struct FBookmarkBaseJum...,
    FEditorViewportClient* InViewp...
)

Use IBookmarkTypeTools::Get().JumpToBookmark

Public function Static

void

 

SetBookmark

(
    uint32 InIndex,
    FEditorViewportClient* InViewp...
)

Use IBookmarkTypeTools::Get().CreateOrSetBookmark

Public function Const

bool

 

ShouldShowModeToolbox()

Individual toolkit hosts, such as the level editor, should handle determining if they show a mode toolbox for hosted toolkits.

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