Dungeon Architect  17.0.0
DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor Class Referenceabstract

The graph editor script for managing a graph. This contains the bulk of the logic for graph editing More...

Inheritance diagram for DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor:
DungeonArchitect.UI.Widgets.IWidget DungeonArchitect.Editors.DungeonThemeGraphEditor DungeonArchitect.Editors.Flow.FlowExecGraphEditor DungeonArchitect.Editors.Flow.Layout.FlowPreviewLayoutGraphEditor DungeonArchitect.Editors.Flow.Tilemap.FlowPreviewTilemapGraphEditor DungeonArchitect.Editors.SnapFlow.SnapEdExecutionGraphEditor DungeonArchitect.Editors.SnapFlow.SnapEdGrammarGraphEditor DungeonArchitect.Editors.SnapFlow.SnapEdResultGraphEditor DungeonArchitect.Editors.SpatialConstraints.SpatialConstraintsGraphEditor

Public Member Functions

bool CanAcquireFocus ()
 
virtual void SortPinsForDrawing (GraphPin[] pins)
 
Vector2 GetDesiredSize (Vector2 size, UISystem uiSystem)
 
virtual void HandleMessage (UISystem uiSystem, WidgetMessage message)
 
virtual void Init (Graph graph, Rect editorBounds, UnityEngine.Object assetObject, UISystem uiSystem)
 Initializes the graph editor with the specified graph More...
 
void SetReadOnly (bool graphReadOnly)
 
virtual void Release (UISystem uiSystem)
 
void FocusCameraOnNode (GraphNode node)
 Moves the graph editor viewport to show the marker on the screen More...
 
virtual void OnFocus ()
 
virtual void LostFocus ()
 
virtual bool RequiresInputEveryFrame ()
 
void FocusCameraOnBestFit (Rect editorBounds)
 Moves the graph editor viewport to show as many markers as possible. Called when a new graph is loaded More...
 
void FocusCameraOnBestFit ()
 
virtual void OnEnable ()
 
void OnDisable ()
 
void OnDestroy ()
 
virtual void HandleMarkedDirty (UISystem uiSystem)
 
virtual void UpdateWidget (UISystem uiSystem, Rect bounds)
 
virtual void Update ()
 
virtual void HandleGraphStateChanged (UISystem uiSystem)
 
virtual void HandleNodePropertyChanged (GraphNode node)
 
virtual void HandleInput (Event _e, UISystem uiSystem)
 Handles user input (mouse and keyboard) More...
 
virtual void OnNodeSelectionChanged (UISystem uiSystem)
 
virtual void OnNodeDoubleClicked (UISystem uiSystem, GraphNode node)
 
void DeleteNodes (GraphNode[] nodesToDelete, UISystem uiSystem)
 
virtual bool IsCompositeWidget ()
 
IWidget[] GetChildWidgets ()
 
virtual void Draw (UISystem uiSystem, UIRenderer renderer)
 Renders the graph editor in the editor window More...
 
virtual T CreateNode< T > (Vector2 screenCoord, UISystem uiSystem)
 Creates a new node in the specified screen coordinate More...
 
virtual GraphNode CreateNode (Vector2 screenCoord, System.Type nodeType, UISystem uiSystem)
 
void SelectNode (GraphNode nodeToSelect, UISystem uiSystem)
 Selects and highlights a node More...
 
GraphPin GetPinUnderPosition (Vector2 worldPosition)
 Gets the node pin under the mouse position. Takes the owning node's Z-order into consideration More...
 
virtual GraphSchema GetGraphSchema ()
 
virtual T CreateLink< T > (Graph graph, GraphPin output, GraphPin input, UISystem uiSystem)
 Creates a graph link between the two specified pins More...
 

Protected Member Functions

abstract GraphContextMenu CreateContextMenu ()
 
abstract void InitializeNodeRenderers (GraphNodeRendererFactory nodeRenderers)
 
abstract IGraphLinkRenderer CreateGraphLinkRenderer ()
 
abstract void OnMenuItemClicked (object userdata, GraphContextMenuEvent e)
 
virtual void SortNodesForDeletion (GraphNode[] nodesToDelete)
 
virtual GraphEditorStyle CreateEditorStyle ()
 
virtual void DrawHighlight (UIRenderer renderer)
 
void SetGraph (Graph graph)
 
GraphNode[] GetSelectedNodes ()
 
virtual GraphNode DuplicateNode (GraphNode sourceNode, UISystem uiSystem)
 
virtual void DestroyNode (GraphNode node, UISystem uiSystem)
 
virtual void DrawOverlay (UIRenderer renderer, Rect bounds)
 
bool IsPaintEvent (UISystem uiSystem)
 
virtual void DrawHUD (UISystem uiSystem, UIRenderer renderer, Rect bounds)
 Draws non-interactive textual information for the user More...
 
void BringToFront (GraphNode node)
 
virtual void CreateLinkBetweenPins (GraphPin outputPin, GraphPin inputPin, UISystem uiSystem)
 
abstract string GetGraphNotInitializedMessage ()
 

Protected Attributes

Graph graph
 
GraphCamera camera
 
UnityEngine.Object assetObject
 
GraphEditorEvents events = new GraphEditorEvents()
 
float renderCullingBias = 0
 
GraphSelectionBox selectionBox
 
GraphContextMenu contextMenu
 
GraphNodeRendererFactory nodeRenderers
 
GraphRendererContext rendererContext = new GraphRendererContext()
 
Vector2 lastMousePosition = new Vector2()
 
Rect lastDrawBounds = Rect.zero
 
bool draggingNodes = false
 

Properties

GraphCamera Camera [get]
 
GraphEditorStyle EditorStyle [get]
 
GraphEditorEvents Events [get]
 
bool ShowFocusHighlight [get, set]
 
Rect WidgetBounds [get, set]
 
virtual Vector2 ScrollPosition [get, set]
 
IGraphLinkRenderer GraphLinkRenderer [get]
 
Vector2 LastMousePosition [get]
 
Graph Graph [get]
 The owning graph More...
 
- Properties inherited from DungeonArchitect.UI.Widgets.IWidget
Rect WidgetBounds [get, set]
 
bool ShowFocusHighlight [get, set]
 
Vector2 ScrollPosition [get, set]
 

Detailed Description

The graph editor script for managing a graph. This contains the bulk of the logic for graph editing

Definition at line 47 of file GraphEditor.cs.

Member Function Documentation

◆ CreateLink< T >()

virtual T DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.CreateLink< T > ( Graph  graph,
GraphPin  output,
GraphPin  input,
UISystem  uiSystem 
)
virtual

Creates a graph link between the two specified pins

Template Parameters
TThe type of the link. Should be GraphLink or one of its subclass
Parameters
outputThe output pin from where the link originates
inputThe input pin, where the link points to
Returns

Reimplemented in DungeonArchitect.Editors.SnapFlow.SnapEdResultGraphEditor, DungeonArchitect.Editors.SnapFlow.SnapEdGrammarGraphEditor, and DungeonArchitect.Editors.SnapFlow.SnapEdExecutionGraphEditor.

Type Constraints
T :GraphLink 

Definition at line 1199 of file GraphEditor.cs.

◆ CreateNode< T >()

virtual T DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.CreateNode< T > ( Vector2  screenCoord,
UISystem  uiSystem 
)
virtual

Creates a new node in the specified screen coordinate

Template Parameters
TThe type of node to created. Should be a subclass of GraphNode
Parameters
screenCoordThe screen coordinate to place the node at
Returns
The created graph node
Type Constraints
T :GraphNode 
T :new() 

Definition at line 977 of file GraphEditor.cs.

◆ Draw()

virtual void DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.Draw ( UISystem  uiSystem,
UIRenderer  renderer 
)
virtual

◆ DrawHUD()

virtual void DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.DrawHUD ( UISystem  uiSystem,
UIRenderer  renderer,
Rect  bounds 
)
protectedvirtual

Draws non-interactive textual information for the user

Parameters
boundsBounds.

Reimplemented in DungeonArchitect.Editors.SnapFlow.SnapEdGrammarGraphEditor, and DungeonArchitect.Editors.SnapFlow.SnapEdExecutionGraphEditor.

Definition at line 956 of file GraphEditor.cs.

◆ FocusCameraOnBestFit()

void DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.FocusCameraOnBestFit ( Rect  editorBounds)

Moves the graph editor viewport to show as many markers as possible. Called when a new graph is loaded

Parameters
editorBoundsThe bounds of the editor window

Definition at line 231 of file GraphEditor.cs.

◆ FocusCameraOnNode()

void DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.FocusCameraOnNode ( GraphNode  node)

Moves the graph editor viewport to show the marker on the screen

Parameters
markerNameThe name of the marker to focus on
editorBoundsThe bounds of the editor

Definition at line 202 of file GraphEditor.cs.

◆ GetPinUnderPosition()

GraphPin DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.GetPinUnderPosition ( Vector2  worldPosition)

Gets the node pin under the mouse position. Takes the owning node's Z-order into consideration

Parameters
worldPositionThe world position in graph coordinates
Returns
The pin under the specified position. null otherwise

Definition at line 1080 of file GraphEditor.cs.

◆ HandleInput()

virtual void DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.HandleInput ( Event  _e,
UISystem  uiSystem 
)
virtual

◆ Init()

virtual void DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.Init ( Graph  graph,
Rect  editorBounds,
UnityEngine.Object  assetObject,
UISystem  uiSystem 
)
virtual

◆ SelectNode()

void DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.SelectNode ( GraphNode  nodeToSelect,
UISystem  uiSystem 
)

Selects and highlights a node

Parameters
nodeToSelect

Definition at line 1062 of file GraphEditor.cs.

Property Documentation

◆ Graph

Graph DungeonArchitect.UI.Widgets.GraphEditors.GraphEditor.Graph
get

The owning graph

Definition at line 127 of file GraphEditor.cs.


The documentation for this class was generated from the following file: