Vixen
02b45cc4
csharp
public sealed class NodeGraph

The nodes, the wires and the groups. No elements, no canvas, no view.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Kept apart from NodeCanvas on purpose, for the reason DockLayout is kept apart from DockingHost: this is what a shader graph is saved as, compiled from and compared against, and a model that could only be read out of a live element tree would make every one of those depend on a document, a stylesheet and a font.

⚠ It refuses a cycle. A shader graph and a VFX graph are both evaluated by walking from the outputs back, and a cycle is not a graph with a mistake in it — it is a walk that does not terminate. Refusing at the moment of connection is the only place the user can be told which wire was the problem.

⚠ The rules are not this type's. The cycle refusal, the cascade a deletion causes and the one-wire-per-input rule are GraphInvariants's, and the document model — Vixen.Editor.NodeGraph.NodeGraphModel — calls the same three methods with the same GraphConnectionError coming back. That is deliberate and it is the only thing keeping two graph types from drifting into two sets of rules. What differs is how a refusal is delivered: see Connect.

Fields and properties (3)

  • public IReadOnlyList<GraphNode> Nodes

    The nodes, in the order they were added.

  • public IReadOnlyList<GraphWire> Wires

    The wires.

  • public IReadOnlyList<GraphGroup> Groups

    The groups.

Events (1)

  • public Action<NodeGraph>? Changed

    Raised after anything structural changes — a node, a wire or a group.

Methods (10)

Used by (9)

  • NodeCanvasVixen.Ui.Controls.Advanced
  • NodeCanvasTestsVixen.Ui.Controls.Advanced.Tests
  • NodeGraphTestsVixen.Ui.Controls.Advanced.Tests
  • NodeMinimapVixen.Ui.Controls.Advanced
  • NodeWireLayerVixen.Ui.Controls.Advanced
  • ResizeTestsVixen.Ui.Controls.Advanced.Tests
  • GraphPairVixen.Editor.NodeGraph.Tests
  • NodeGraphViewVixen.Editor.NodeGraph
  • ViewTestsVixen.Editor.NodeGraph.Tests