Dungeon Architect  17.0.0
DungeonArchitect.Graphs.GraphNode Class Reference

Represents a graph node in the theme graph. This is the base class for all graph nodes More...

Inheritance diagram for DungeonArchitect.Graphs.GraphNode:
DungeonArchitect.Flow.Domains.Layout.Tooling.Graph2D.FlowLayoutToolGraph2DNode DungeonArchitect.Flow.Domains.Tilemap.Tooling.FlowTilemapToolGraphNode DungeonArchitect.Flow.Exec.FlowExecGraphNodeBase DungeonArchitect.Grammar.GrammarExecNodeBase DungeonArchitect.Grammar.GrammarNodeBase DungeonArchitect.Graphs.CommentNode DungeonArchitect.Graphs.MarkerNode DungeonArchitect.Graphs.PlaceableNode DungeonArchitect.Graphs.SpatialConstraints.SCBaseDomainNode

Public Member Functions

virtual void OnEnable ()
 
virtual void Initialize (string id, Graph graph)
 
virtual void CopyFrom (GraphNode node)
 Called when the node is copied.
The implementations should implement copy here (e.g. deep / shallow copy depending on implementation) More...
 
GraphNode[] GetParentNodes ()
 Gets the list of parent graph nodes More...
 
GraphNode[] GetChildNodes ()
 Gets the list of child nodes More...
 
void DragNode (Vector2 delta)
 Moves the node by the specified delta More...
 

Protected Member Functions

void UpdateName (string prefix)
 
GraphPin CreatePin (GraphPinType pinType, Vector2 position, Rect boundsOffset, Vector2 tangent)
 Creates a pin with the specified configuration More...
 
CreatePinOfType< T > (GraphPinType pinType, Vector2 position, Rect boundsOffset, Vector2 tangent)
 

Protected Attributes

string id
 
string caption
 
Rect bounds = new Rect(10, 10, 120, 120)
 
bool canBeDeleted = true
 
bool canBeSelected = true
 
bool canBeMoved = true
 
bool selected = false
 
int zIndex
 
List< GraphPininputPins
 
List< GraphPinoutputPins
 
Graph graph
 

Properties

string Id [get, set]
 The ID of the graph node More...
 
string Caption [get, set]
 The caption label of the node. It is up to the implementation to draw this label, if needed More...
 
Rect Bounds [get, set]
 The bounds of the node More...
 
bool CanBeDeleted [get]
 
bool CanBeSelected [get]
 
bool CanBeMoved [get]
 
bool Selected [get, set]
 Flag to indicate if the node has been selected More...
 
Vector2 Size [get, set]
 The size of the node More...
 
Vector2 Position [get, set]
 The position of the node More...
 
int ZIndex [get, set]
 The Z-index of the node. It determines if the node is on top of other nodes More...
 
GraphPin[]? InputPins [get]
 List of input pins owned by this node More...
 
GraphPin[]? OutputPins [get]
 List of output pins owned by this node More...
 
GraphPin OutputPin [get]
 Gets the first output pin. Returns null if no output pins are defined More...
 
GraphPin InputPin [get]
 Gets the first input pin. Returns null if no input pins are defined More...
 
Graph Graph [get]
 The graph that owns this node More...
 
bool Dragging [get, set]
 

Detailed Description

Represents a graph node in the theme graph. This is the base class for all graph nodes

Definition at line 12 of file GraphNode.cs.

Member Function Documentation

◆ CopyFrom()

virtual void DungeonArchitect.Graphs.GraphNode.CopyFrom ( GraphNode  node)
virtual

◆ CreatePin()

GraphPin DungeonArchitect.Graphs.GraphNode.CreatePin ( GraphPinType  pinType,
Vector2  position,
Rect  boundsOffset,
Vector2  tangent 
)
protected

Creates a pin with the specified configuration

Parameters
pinTypeThe type of pin (input / output)
positionThe position of the pin, relative to the node bounds
boundsOffsetThe bounds of the pin, relative to the position
tangentThe tangent of the pin. Links connected to the pin would come out from this direction

Definition at line 267 of file GraphNode.cs.

◆ DragNode()

void DungeonArchitect.Graphs.GraphNode.DragNode ( Vector2  delta)

Moves the node by the specified delta

Parameters
deltaThe delta offset to move the node by

Definition at line 345 of file GraphNode.cs.

◆ GetChildNodes()

GraphNode [] DungeonArchitect.Graphs.GraphNode.GetChildNodes ( )

Gets the list of child nodes

Returns
List of child nodes

Definition at line 325 of file GraphNode.cs.

◆ GetParentNodes()

GraphNode [] DungeonArchitect.Graphs.GraphNode.GetParentNodes ( )

Gets the list of parent graph nodes

Returns
List of parent graph nodes

Definition at line 305 of file GraphNode.cs.

Property Documentation

◆ Bounds

Rect DungeonArchitect.Graphs.GraphNode.Bounds
getset

The bounds of the node

Definition at line 53 of file GraphNode.cs.

◆ Caption

string DungeonArchitect.Graphs.GraphNode.Caption
getset

The caption label of the node. It is up to the implementation to draw this label, if needed

Definition at line 35 of file GraphNode.cs.

◆ Graph

Graph DungeonArchitect.Graphs.GraphNode.Graph
get

The graph that owns this node

Definition at line 215 of file GraphNode.cs.

◆ Id

string DungeonArchitect.Graphs.GraphNode.Id
getset

The ID of the graph node

Definition at line 20 of file GraphNode.cs.

◆ InputPin

GraphPin DungeonArchitect.Graphs.GraphNode.InputPin
get

Gets the first input pin. Returns null if no input pins are defined

Definition at line 199 of file GraphNode.cs.

◆ InputPins

GraphPin []? DungeonArchitect.Graphs.GraphNode.InputPins
get

List of input pins owned by this node

Definition at line 162 of file GraphNode.cs.

◆ OutputPin

GraphPin DungeonArchitect.Graphs.GraphNode.OutputPin
get

Gets the first output pin. Returns null if no output pins are defined

Definition at line 187 of file GraphNode.cs.

◆ OutputPins

GraphPin []? DungeonArchitect.Graphs.GraphNode.OutputPins
get

List of output pins owned by this node

Definition at line 176 of file GraphNode.cs.

◆ Position

Vector2 DungeonArchitect.Graphs.GraphNode.Position
getset

The position of the node

Definition at line 129 of file GraphNode.cs.

◆ Selected

bool DungeonArchitect.Graphs.GraphNode.Selected
getset

Flag to indicate if the node has been selected

Definition at line 95 of file GraphNode.cs.

◆ Size

Vector2 DungeonArchitect.Graphs.GraphNode.Size
getset

The size of the node

Definition at line 117 of file GraphNode.cs.

◆ ZIndex

int DungeonArchitect.Graphs.GraphNode.ZIndex
getset

The Z-index of the node. It determines if the node is on top of other nodes

Definition at line 144 of file GraphNode.cs.


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