SNodePanel

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

GraphEditor

Header

/Engine/Source/Editor/GraphEditor/Public/SNodePanel.h

Include

#include "SNodePanel.h"

Syntax

class SNodePanel : public SPanel

Variables

Name Description

Protected variable

bool

 

bAllowContinousZoomInterpolation

Allow continous zoom interpolation?

Protected variable

bool

 

bDeferredZoomToNodeExtents

Deferred zoom to node extents

Protected variable

bool

 

bDeferredZoomToSelection

Deferred zoom to selected node extents

Protected variable

bool

 

bIsPanning

Are we panning the view at the moment?

Protected variable

bool

 

bIsZoomingWithTrackpad

Are we zooming the view with trackpad at the moment?

Protected variable

bool

 

bRequestDeferredPan

True if pending request for deferred panning

Protected variable

bool

 

bShowSoftwareCursor

Whether the software cursor should be drawn

Protected variable

bool

 

bTeleportInsteadOfScrollingWhenZoomingToFit

Teleport immediately, or smoothly scroll when doing a deferred zoom

Protected variable

bool

 

bVisualUpdatePending

A flag to detect when a visual update is pending to prevent deferred commands like zoom to fit from running when there are no widgets

Protected variable

FGeometry

 

CachedGeometry

Cached geometry for use within the active timer

Protected variable

TSlotlessChildr...

 

Children

The graph node widgets owned by this panel

Protected variable

EGraphRendering...

 

CurrentLOD

Current LOD level for nodes/pins

Protected variable

const UObject &...

 

DeferredMovementTargetObject

If non-null and a part of this panel, this node will be brought into view on the next Tick

Protected variable

FVector2D

 

DeferredPanPosition

Position to pan to

Protected variable

TSet< const UOb...

 

DeferredSelectionTargetObjects

If not empty and a part of this panel, this node will be selected and brought into view on the next Tick

Protected variable

TAttribute< boo...

 

IsEditable

Is the graph editable (can nodes be moved, etc...)?

Protected variable

FInputChord

 

LastKeyChordDetected

The last key chord detected in this graph panel

Protected variable

FMarqueeOperati...

 

Marquee

A pending marquee operation if it's active

Protected variable

FVector2D

 

NodeGrabOffset

Where in the title the user grabbed to initiate the drag

Protected variable

TMap< UObject &...

 

NodeToWidgetLookup

Given a node, find the corresponding widget

Protected variable

TWeakPtr< SNode...

 

NodeUnderMousePtr

The node that the user is dragging. Null when they are not dragging a node.

Protected variable

FVector2D

 

OldViewOffset

The position within the graph at which the user was looking last tick

Protected variable

float

 

OldZoomAmount

The actual scalar zoom amount last tick

Protected variable

SGraphEditor::F...

 

OnSpawnNodeByShortcut

Invoked when the user may be attempting to spawn a node using a shortcut

Protected variable

TMap< TWeakPtr<...

 

OriginalNodePositions

Node positions pre-drag, used to limit transaction creation on drag

Protected variable

FVector2D

 

PastePosition

The position where we should paste when a user executes the paste command.

Protected variable

int32

 

PreviousZoomLevel

Previous Zoom Level

Protected variable

TSharedPtr< FSc...

 

ScopedTransactionPtr

The current transaction for undo/redo

Public variable

FGraphSelection...

 

SelectionManager

Nodes selected in this instance of the editor; the selection is per-instance of the GraphEditor

Protected variable

FVector2D

 

SoftwareCursorPosition

The current position of the software cursor

Protected variable

float

 

TotalGestureMagnify

Cumulative magnify delta from trackpad gesture

Protected variable

float

 

TotalMouseDelta

The total distance that the mouse has been dragged while down

Protected variable

float

 

TotalMouseDeltaXY

The additive X and Y components of mouse drag (used when zooming)

Protected variable

FVector2D

 

ViewOffset

The position within the graph at which the user is looking

Protected variable

TSlotlessChildr...

 

VisibleChildren

Protected variable

int32

 

ZoomLevel

How zoomed in/out we are. e.g. 0.25f results in quarter-sized nodes.

Protected variable

FCurveSequence

 

ZoomLevelFade

Curve that handles fading the 'Zoom +X' text

Protected variable

FCurveSequence

 

ZoomLevelGraphFade

Fade on zoom for graph

Protected variable

TUniquePtr< FZo...

 

ZoomLevels

The interface for mapping ZoomLevel values to actual node scaling values.

Protected variable

float

 

ZoomPadding

Zoom selection padding

Protected variable

FVector2D

 

ZoomStartOffset

Offset in the panel the user started the LMB+RMB zoom from

Constructors

Name Description

Public function

SNodePanel()

Functions

Name Description

Protected function Virtual

void

 

AddGraphNode

(
    const TSharedRef< SNode >& NodeToA...
)

Add a slot to the CanvasPanel dynamically

Protected function Static

void

 

ApplyMarqueeSelection

(
    const FMarqueeOperation& InMarquee,
    const FGraphPanelSelectionSet& Cur...,
    FGraphPanelSelectionSet& OutNewSel...
)

Apply the marquee operation to the current selection

Protected function Virtual Const

void

 

ArrangeChildNodes

(
    const FGeometry& AllottedGeometry,
    FArrangedChildren& ArrangedChildre...
)

Arrange child nodes - allows derived classes to supply non-node children in OnArrangeChildren

Protected function

void

 

CancelZoomToFit()

Cancels any active zoom-to-fit action.

Protected function

void

 

CenterObject

(
    const UObject* ObjectToCenter
)

On the next tick, centers the widget associated with the object if it exists

Protected function

void

 

ChangeZoomLevel

(
    int32 ZoomLevelDelta,
    const FVector2D& WidgetSpaceZoomOr...,
    bool bOverrideZoomLimiting
)

Change zoom level by the specified zoom level delta, about the specified origin.

Protected function Static

FVector2D

 

ComputeEdgePanAmount

(
    const FGeometry& MyGeometry,
    const FVector2D& MouseEvent
)

Compute much panel needs to change to pan to location

Protected function

void

 

Construct()

Initialize members

Public function Const

bool

 

Contains

(
    UObject* Node
)

Is the given node being observed by a widget in this panel?

Public function

void

 

FinalizeNodeMovements()

Commit transactions for any node movements

Protected function Const

void

 

FindNodesAffectedByMarquee

(
    FGraphPanelSelectionSet& OutAffect...
)

Figure out which nodes intersect the marquee rectangle

Protected function Const

bool

 

GetBoundsForNode

(
    const UObject* InNode,
    FVector2D& MinCorner,
    FVector2D& MaxCorner,
    float Padding
)

Get the bounds of the given node

Protected function

bool

 

GetBoundsForNodes

(
    bool bSelectionSetOnly,
    FVector2D& MinCorner,
    FVector2D& MaxCorner,
    float Padding
)

Get the bounds of the selected nodes

Public function

bool

 

GetBoundsForSelectedNodes

(
    FSlateRect& Rect,
    float Padding
)

Get the bounding area for the currently selected nodes

Public function Const

EGraphRender...

 

GetCurrentLOD()

Returns the current LOD level of this panel, based on the zoom factor

Public function Const

FVector2D

 

GetPastePosition()

Public function Static

float

 

GetSnapGridSize()

Get the grid snap size

Public function Const

const FGuid ...

 

GetViewBookmarkId()

Public function Const

FVector2D

 

GetViewOffset()

Public function Const

float

 

GetZoomAmount()

The zoom amount; e.g. a value of 0.25f results in quarter-sized nodes

Public function Const

FText

 

GetZoomText()

Public function Const

FSlateColor

 

GetZoomTextColorAndOpacity()

Protected function Const

FVector2D

 

GraphCoordToPanelCoord

(
    const FVector2D& GraphSpaceCoordin...
)

Given a coordinate in graph space (e.g. a node's position), return the same coordinate in widget space while taking zoom and panning into account

Public function Const

bool

 

HasDeferredObjectFocus()

If it is focusing on a particular object

Public function Const

bool

 

HasMoved()

Returns if the panel has been panned or zoomed since the last update

Protected function Const

bool

 

IsNodeCulled

(
    const TSharedRef< SNode >& Node,
    const FGeometry& AllottedGeometry
)

Determines if a specified node is not visually relevant.

Protected function Virtual

void

 

OnBeginNodeInteraction

(
    const TSharedRef< SNode >& InNodeT...,
    const FVector2D& GrabOffset
)

Lets the CanvasPanel know that the user is interacting with a node.

Protected function Virtual

void

 

OnEndNodeInteraction

(
    const TSharedRef< SNode >& InNodeT...
)

Lets the CanvasPanel know that the user has ended interacting with a node.

Protected function Virtual

bool

 

OnHandleLeftMouseRelease

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Protected function Virtual

TSharedPtr< ...

 

OnSummonContextMenu

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

INTERFACE TO IMPLEMENT.

Protected function Const

void

 

PaintBackgroundAsLines

(
    const FSlateBrush* BackgroundI...,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32& DrawLayerId
)

Paint the background as lines.

Protected function Const

void

 

PaintComment

(
    const FString& CommentText,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 DrawLayerId,
    const FLinearColor& CommentTinting,
    float& HeightAboveNode,
    const FWidgetStyle& InWidgetStyle
)

Paint a comment bubble.

Protected function Const

void

 

PaintMarquee

(
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 DrawLayerId
)

Paint the marquee selection rectangle.

Protected function Const

void

 

PaintSoftwareCursor

(
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 DrawLayerId
)

Paint the software mouse if necessary.

Protected function Const

void

 

PaintSurroundSunkenShadow

(
    const FSlateBrush* ShadowImage,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 DrawLayerId
)

Paint the well shadow (around the perimeter)

Public function Const

FVector2D

 

PanelCoordToGraphCoord

(
    const FVector2D& PanelSpaceCoordin...
)

Given a coordinate in panel space (i.e. panel widget space), return the same coordinate in graph space while taking zoom and panning into account

Protected function Const

FSlateRect

 

PanelRectToGraphRect

(
    const FSlateRect& PanelSpaceRect
)

Given a rectangle in panel space, return a rectangle in graph space.

Protected function Virtual

void

 

PopulateVisibleChildren

(
    const FGeometry& AllottedGeometry
)

Populate visibile children array

Protected function

void

 

PostChangedZoom()

Should be called whenever the zoom level has changed.

Protected function Virtual

void

 

RemoveAllNodes()

Remove all nodes from the panel

Public function

void

 

RequestDeferredPan

(
    const FVector2D& TargetPosition
)

Ask panel to scroll to location

Protected function

void

 

RequestZoomToFit()

Fires up a per-tick function to zoom the graph to fit.

Public function

void

 

RestoreViewSettings

(
    const FVector2D& InViewOffset,
    float InZoomAmount,
    const FGuid& InBookmarkGuid
)

Restore the graph panel to the supplied view offset/zoom.

Protected function

bool

 

ScrollToLocation

(
    const FGeometry& MyGeometry,
    FVector2D DesiredCenterPosition,
    const float InDeltaTime
)

Scroll the view to the desired location

Protected function

void

 

SelectAndCenterObject

(
    const UObject* ObjectToSelect,
    bool bCenter
)

On the next tick, centers and selects the widget associated with the object if it exists

Protected function

void

 

UpdateViewOffset

(
    const FGeometry& MyGeometry,
    const FVector2D& TargetPosition
)

Update the new view offset location

Public function

void

 

ZoomToFit

(
    bool bOnlySelection
)

Zooms out to fit either all nodes or only the selected ones.

Protected function

bool

 

ZoomToLocation

(
    const FVector2D& CurrentSizeWithou...,
    const FVector2D& DesiredSize,
    bool bDoneScrolling
)

Zoom to fit the desired size

Protected function

void

 

ZoomToTarget

(
    const FVector2D& TopLeft,
    const FVector2D& BottomRight
)

Zooms to the specified target rect

Overridden from SWidget

Name Description

Public function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float
)

A Panel's desired size in the space required to arrange of its children on the screen while respecting all of the children's desired sizes and any layout-related options specified by the user.

Public function Virtual

FChildren &#...

 

GetAllChildren()

Returns all the panel children rather than only visible

Public function Virtual

FChildren &#...

 

GetChildren()

All widgets must provide a way to access their children in a layout-agnostic way.

Public function Virtual Const

float

 

GetRelativeLayoutScale

(
    int32 ChildIndex,
    float LayoutScaleMultiplier
)

What is the Child's scale relative to this widget.

Public function Virtual Const

void

 

OnArrangeChildren

(
    const FGeometry& AllottedGeometry,
    FArrangedChildren& ArrangedChildre...
)

Panels arrange their children in a space described by the AllottedGeometry parameter.

Public function Virtual Const

FCursorReply

 

OnCursorQuery

(
    const FGeometry& MyGeometry,
    const FPointerEvent& CursorEvent
)

The system asks each widget under the mouse to provide a cursor. This event is bubbled.

Public function Virtual

void

 

OnFocusLost

(
    const FFocusEvent& InFocusEvent
)

Called when this widget loses focus. This event does not bubble.

Public function Virtual

FReply

 

OnKeyDown

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is pressed when this widget has focus (this event bubbles if not handled)

Public function Virtual

FReply

 

OnKeyUp

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is released when this widget has focus

Public function Virtual

FReply

 

OnMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

MOUSE INPUT The system calls this method to notify the widget that a mouse button was pressed within it.

Public function Virtual

FReply

 

OnMouseButtonUp

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse button was release within it.

Public function Virtual

void

 

OnMouseCaptureLost

(
    const FCaptureLostEvent& CaptureLo...
)

Called when this widget had captured the mouse, but that capture has been revoked for some reason.

Public function Virtual

FReply

 

OnMouseMove

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse moved within it.

Public function Virtual

FReply

 

OnMouseWheel

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

Called when the mouse wheel is spun. This event is bubbled.

Public function Virtual

FReply

 

OnTouchEnded

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is ended (finger lifted)

Public function Virtual

FReply

 

OnTouchGesture

(
    const FGeometry& MyGeometry,
    const FPointerEvent& GestureEvent
)

TOUCH and GESTURES Called when the user performs a gesture on trackpad. This event is bubbled.

Public function Virtual

void

 

Tick

(
    const FGeometry& AllottedGeometry,
    const double InCurrentTime,
    const float InDeltaTime
)

Ticks this widget with Geometry.

Classes

Name

Description

Public class

SNode

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