class MAGES::SceneGraph::Editor::BaseNode

Overview

The base node. More…

class BaseNode:
    public Node,
    public MAGES::SceneGraph::Editor::IActionImplementor
{
public:
    // properties

    abstract string Identifier;
    abstract bool HasUnsavedChanges;
    SceneGraphView View;
    Port InActionPort;
    Port OutActionPort;
    string Title;
    string Name;
    bool Deleted;
    VisualElement InputContainer;
    SerializedObject SerializedData;
    VisualElement OutputContainer;
    BaseActionData ActionData;
    bool HasAnyIncomingConnections;
    bool BoundToAsset;
    ActionIActionImplementor>> OnCanonicalInputChanged;

    // methods

    BaseNode();
    override void SetPosition(Rect newPos);

    virtual void Initialize(
        System.Type actionType,
        BaseActionData data,
        Action<IActionImplementor, string, string> onNameChanged,
        string name
    );

    virtual void OnConnectionCreated(
        Port thisPort,
        Port otherPort,
        GraphElement other
    );

    virtual void OnConnectionRemoved(
        Port thisPort,
        Port otherPort,
        GraphElement other
    );

    virtual void OnRemoved();

    virtual void Restore(
        Func<BaseActionData, GraphElement> lookup,
        Action addEdge
    );

    virtual void SetRuntimeControlsEnalbed(
        bool enabled,
        Action performAction,
        Action undoAction
    );

    virtual void Save(string path);
};

// direct descendants

class BaseActionNode;

Inherited Members

public:
    // properties

    string Identifier;
    string Title;
    string Name;
    bool HasUnsavedChanges;
    bool Deleted;
    bool HasAnyIncomingConnections;
    bool BoundToAsset;
    SceneGraphView View;
    Port InActionPort;
    Port OutActionPort;
    VisualElement InputContainer;
    VisualElement OutputContainer;
    BaseActionData ActionData;
    SerializedObject SerializedData;
    System.ActionIActionImplementor>> OnCanonicalInputChanged;

    // methods

    void Initialize(
        System.Type actionType,
        BaseActionData data,
        System.Action<IActionImplementor, string, string> onNameChanged,
        string name
    );

    void OnConnectionCreated(Port thisPort, Port otherPort, GraphElement other);
    void OnConnectionRemoved(Port thisPort, Port otherPort, GraphElement other);
    void OnRemoved();
    void Save(string path);

    void Restore(
        Func<BaseActionData, GraphElement> lookup,
        Action addEdge
    );

    void SetRuntimeControlsEnalbed(
        bool enabled,
        Action performAction,
        Action undoAction
    );

    void SetPosition(Rect newPosition);

Detailed Documentation

The base node.

Properties

abstract string Identifier

Gets the identifier of the node.

abstract bool HasUnsavedChanges

Gets a value indicating whether this instance has unsaved changes.

SceneGraphView View

Gets or sets the view.

Port InActionPort

Gets or sets the in action port.

Port OutActionPort

Gets or sets the out action port.

string Title

Gets or sets the title of the node.

string Name

Gets or sets the name of the action.

bool Deleted

Gets or sets a value indicating whether this IActionImplementor is deleted.

VisualElement InputContainer

Gets the input container.

SerializedObject SerializedData

Gets the serialized data.

VisualElement OutputContainer

Gets the output container.

BaseActionData ActionData

Gets the action data instance.

bool HasAnyIncomingConnections

Gets a value indicating whether this instance has any incoming connections.

bool BoundToAsset

Gets or sets a value indicating whether this instance is bound to an asset.

ActionIActionImplementor>> OnCanonicalInputChanged

Sets the on canonical input changed delegate.

Methods

BaseNode()

Initializes a new instance of the BaseNode class.

override void SetPosition(Rect newPos)

Sets the position.

Parameters:

newPos

The new pos.

virtual void Initialize(
    System.Type actionType,
    BaseActionData data,
    Action<IActionImplementor, string, string> onNameChanged,
    string name
)

Initializes a new instance of the BaseNode class.

Parameters:

actionType

The action type.

data

The data.

onNameChanged

The on name changed delegate.

name

The name.

virtual void OnConnectionCreated(
    Port thisPort,
    Port otherPort,
    GraphElement other
)

Called when a connection is created.

Parameters:

thisPort

The port belonging to this node.

otherPort

The port belonging to the other node.

other

The other node.

NotImplementedException

This class should never be instantiated.

virtual void OnConnectionRemoved(
    Port thisPort,
    Port otherPort,
    GraphElement other
)

Called when a connection is removed.

Parameters:

thisPort

The port belonging to this node.

otherPort

The port belonging to the other node.

other

The other node.

NotImplementedException

This class should never be instantiated.

virtual void OnRemoved()

Called when the node is removed.

Parameters:

NotImplementedException

This class should never be instantiated.

virtual void Restore(
    Func<BaseActionData, GraphElement> lookup,
    Action addEdge
)

Restores the node conenctions from a serialized state.

Parameters:

lookup

The lookup function.

addEdge

The add edge function.

NotImplementedException

This class should never be instantiated.

virtual void SetRuntimeControlsEnalbed(
    bool enabled,
    Action performAction,
    Action undoAction
)

Sets the runtime controls enabled.

Parameters:

enabled

True to enable controls.

performAction

The action to call to skip this action.

undoAction

The action to call to undo this action.

NotImplementedException

This class should never be instantiated.

virtual void Save(string path)

Saves the node to a serialized state.

Parameters:

path

The path to save this node to.

NotImplementedException

This class should never be instantiated.