FLevelViewportLayout

Base class for level viewport layout configurations Handles maximizing and restoring well as visibility of specific viewports.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

LevelEditor

Header

/Engine/Source/Editor/LevelEditor/Public/LevelViewportLayout.h

Include

#include "LevelViewportLayout.h"

Syntax

class FLevelViewportLayout :
    public TSharedFromThis< FLevelViewportLayout >,
    public FEditorViewportLayout,
    public FTickableEditorObject

Remarks

Base class for level viewport layout configurations Handles maximizing and restoring well as visibility of specific viewports.

Variables

Name Description

Protected variable

bool

 

bIsImmersive

True if we're currently in immersive mode

Protected variable

bool

 

bIsMaximized

True if we're currently maximized

Protected variable

bool

 

bIsMaximizeSupported

True if the layout supports maximizing one viewport, false if the feature is disabled

Protected variable

bool

 

bIsQueryingLayoutMetrics

Temporarily set to true while we are querying layout metrics and want all widgets to be visible

Protected variable

bool

 

bIsReplacement

True if the user selected this layout, false if it's the initial layout loaded

Protected variable

bool

 

bIsTransitioning

True if we've started an animation and are waiting for it to finish

Protected variable

bool

 

bWasImmersive

True when transitioning from an immersive state

Protected variable

bool

 

bWasMaximized

True when transitioning from a maximized state

Protected variable

TWeakPtr< SWind...

 

CachedOwnerWindow

Caches the window that our widgets are contained within

Protected variable

TArray< FMaximi...

 

DeferredMaximizeCommands

Protected variable

FCurveSequence

 

MaximizeAnimation

Curve for animating from a "restored" state to a maximized state

Protected variable

FName

 

MaximizedViewport

The current maximized viewport if any

Protected variable

FVector2D

 

MaximizedViewportStartPosition

Window-space start position of the viewport that's currently being maximized

Protected variable

FVector2D

 

MaximizedViewportStartSize

Window-space start size of the viewport that's currently being maximized

Protected variable

TWeakPtr< ILeve...

 

ParentLevelEditor

The optional parent level editor for this layout

Protected variable

TWeakPtr< SDock...

 

ParentTab

The parent tab where this layout resides

Protected variable

TWeakPtr< class...

 

ParentTabContent

The parent tab content object where this layout resides

Protected variable

TSharedPtr< SWi...

 

ViewportReplacementWidget

Dummy widget that we'll inline-replace viewport widgets with while a view is maximized (or made immersive)

Protected variable

FThrottleReques...

 

ViewportResizeThrottleRequest

Viewport resize draw throttle request

Protected variable

TWeakPtr< class...

 

ViewportsOverlayPtr

The overlay widget that handles what viewports should be on top (non-maximized or maximized)

Protected variable

TSharedPtr< SWi...

 

ViewportsOverlayWidget

When maximizing viewports (or making them immersive), this stores the widget we create to wrap the viewport

Constructors

Name Description

Public function

FLevelViewportLayout()

Constructor

Destructors

Name Description

Public function Virtual

~FLevelViewportLayout()

Destructor

Functions

Name Description

Protected function

void

 

BeginThrottleForAnimatedResize()

Begins a draw throttle for responsiveness when animating a viewports size

Public function

TSharedRef< ...

 

BuildViewportLayout

(
    TSharedPtr< SDockTab > InParentDock...,
    TSharedPtr< class FLevelViewportTab...,
    const FString& LayoutString,
    TWeakPtr< ILevelEditor > InParentLe...
)

Builds a viewport layout and returns the widget containing the layout

Protected function

void

 

EndThrottleForAnimatedResize()

Ends a draw throttle for responsiveness when animating a viewports size

Protected function

void

 

FinishMaximizeTransition()

If a viewport animation is in progress, finishes that transition immediately

Protected function Const

FVector2D

 

GetMaximizedViewportPositionOnCanvas()

Returns the widget position for viewport transition animations

Protected function Const

FVector2D

 

GetMaximizedViewportSizeOnCanvas()

Returns the widget size for viewport transition animations

Public function Const

TWeakPtr< cl...

 

GetParentTabContent()

Returns the parent tab content object

Protected function Const

FString

 

GetTypeSpecificLayoutString

(
    const FString& LayoutString
)

Generates a layout string for persisting settings for this layout based on the runtime type of layout

Protected function

void

 

InitCommonLayoutFromString

(
    const FString& SpecificLayoutStrin...,
    FName DefaultMaximizedViewport
)

Called in MakeViewportLayout() functions for derived types of layout to init values common to all types

Public function Const

bool

 

IsLevelViewportVisible

(
    FName InViewport
)

Checks to see the specified level viewport is visible in this layout A viewport is visible in a layout if the layout is visible and the viewport is the maximized viewport or there is no maximized viewport

Public function Const

bool

 

IsMaximizeSupported()

Checks to see if the specified level viewport supports maximizing one pane

Public function Const

bool

 

IsTransitioning()

Returns whether a viewport animation is currently taking place

Public function Const

bool

 

IsViewportImmersive

(
    FName InViewport
)

Checks to see if the specified level viewport is in immersive mode

Public function Const

bool

 

IsViewportMaximized

(
    FName InViewport
)

Checks to see if the specified level viewport is maximized

Public function Const

bool

 

IsVisible()

Protected function

TSharedRef< ...

 

MakeViewportLayout

(
    const FString& LayoutString
)

Overridden in derived classes to set up custom layouts

Protected function

void

 

MaximizeViewport

(
    FName ViewportToMaximize,
    const bool bWantMaximize,
    const bool bWantImmersive,
    const bool bAllowAnimation
)

Maximizes a specific viewport and hides the others in this layout

Protected function Const

EVisibility

 

OnGetNonMaximizedVisibility()

Delegate called to get the visibility of the non-maximized viewports The non-maximized viewports are not visible if there is a maximized viewport on top of them

Protected function

void

 

ReplaceWidget

(
    TSharedRef< SWidget > Source,
    TSharedRef< SWidget > Replacement
)

Inline replaces a viewport content widget within this layout

Public function

void

 

RequestMaximizeViewport

(
    FName ViewportToMaximize,
    const bool bWantMaximize,
    const bool bWantImmersive,
    const bool bAllowAnimation
)

Makes a request to maximize a specific viewport and hide the others in this layout

Protected function Const

void

 

SaveCommonLayoutString

(
    const FString& SpecificLayoutStrin...
)

Called in SaveLayoutString() functions for derived types of layout to save values common to all types

Public function

void

 

SetIsReplacement

(
    bool bInIsReplacement
)

Tells this layout whether it was the intial layout or replaced an existing one when the user switched layouts

Protected function

void

 

TakeHighResScreenShot()

Method for taking high res screen shots of viewports

Overridden from FTickableObjectBase

Name Description

Public function Virtual Const

TStatId

 

GetStatId()

Return the stat id to use for this tickable

Public function Virtual Const

bool

 

IsTickable()

Virtual that can be overloaded by the inheriting class.

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

FTickableEditorObject interface

Classes

Name

Description

Protected struct

FMaximizeViewportCommand

Maximize/immersive commands can be queued up at startup to be executed on the first tick.

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