Click or drag to resize

Fusee.Xirkit Namespace

This module implements functionality for dynamically setting up circuits of arbitrary objects with selected fields and properties connected to each other.

This allows for building object graphs with a defined data flow from source properties to other objects' destination properties known from many graphically oriented use cases such as the "Node Editor" in Blender, binding dependency properties in WPF, etc. In contrast to other libraries, Xirkit can take any C# type of object as a node within a circuit and any field or property of such objects may serve as incoming or outgoing connecion pins.

The animation part of FUSEEs SceneRenderer is implemented on top of Xirkit to dynamically wire animation tracks to actual scene graph objects' properties.

The most important types in this module are
  • Circuit - A container that holds a list of all interconnected objects. Contains methods to build up circuits and wires between nodes.
  • Node - Elements within a circuit. Arbitrary objects can be encapsulated within a node to allow them to participate in a circuit.
  • Pin - An arbitrary object wrapped into a Node can expose members through Pins. Pins are automatically created using the Attach(String, Node, String) method.
Classes
  ClassDescription
Public classAnimation
The Animation Class is capable of storing and handling different types of Channels.
Public classChainedMemberAccessorTPin, TObj
Class used inside Xirkit to accces (read and write) nested members that are referenced by a chain of properties/fields separated by the object-access operator '.' (dot).
Public classChannelTValue
Generic Channel implementation capable of storing keyframes of the given Type.
Public classChannelBase
Base class containing functionality common to all Channel types, no matter of the type of the values of the containing key frames.
Public classCircuit
A Circuit contains arbitrary objects. Connections between the objects' members (fields and properties) automatically handle value propagation - if a source value changes, all the connected members will be set to the updated value.

This is the main object of the Xirkit package. Compare a Circuit to a real electronic circuit with the electronic components being instances of objects, their pins welded to the board being instances of IInPin and IOutPin connected to each others by conductive paths. Instead of electricity floating along the connections, a Circuit instance transmits values of certain types from node to node. If you are familiar with CINEMA 4D's XPresso, you know what a Circuit is. You can also compare Xirkit to WPF's Dependency Properties.

To build up a Circuit in code, create a new Circuit. For each arbitrary object that should be connected in the Circuit, create a hosting Node instance, passing the participating object to the Node's constructor. Use AddNode(Node) to add each new node (with the hosted object). Then use Attach(String, Node, String) to connect members (fields and properties) of objects contained in two different nodes to each others.

Technically a Circuit is a container filled with Node instances that are related to each others by connected (in- and out-) pins. A number of these nodes are specified as root nodes. Whenever a circuit is executed by calling its Execute method, the values of all out-pins at the root nodes are propagated (and possibly converted) the their connected in-pins, which in turn might trigger subsequent propagation along the graph. Nodes exposing the ICalculationPerformer interface are triggered to perform their calculation before the values at their out-pins are further propagated.

Public classConvertingFieldAccessorTPin, TObj
Member Accessor implementation specialized on accessing fields where the type of the pin and the actual type of the field are different. The accsessor performs the conversion operation specefied when performing its set or get operations.
Public classConvertingPropertyAccessorTPin, TObj
Member Accessor implementation specialized on accessing properties (using set and get) where the type of the pin and the actual type of the field are different. The accsessor performs the conversion operation specefied when performing its set or get operations.
Public classFieldAccesssorT
Member Accessor implementation specialized on accessing fields.
Public classInPinT
Class representing incoming pins to nodes.
Public classKeyframeTValue
This Class represents a Keyframe it has a time and a Value.
Public classLerp
provides different LerpFunctions that can be used in a channel. A Lerp Function represents a linear interpolataion between 2 points in a timeline.
Public classListSortTValue
This is needed to sort the List in the Channel Class.
Public classNode

Major building block of the Xirkit library. Each Circuit contains Node instances.

A single object instance of any type can be hosted inside a node. This way any arbitrary object can participate in a Circuit. Node instances within a Circuit are interconnected using in-pins and out-pins. The internal connection from pins to actual members (properties and fields) of the contained object are done using IMemberAccessorTs.

Public classOutPinT
Class representing outgoing pins to nodes.
Public classPin
A pin is a connection point where Node instances can be connected to each others. Pin connections carry values of certain types. There are InPinTs and OutPinTs. One out-pin can be connected to one or more in-pins but each in-pin can only be connected to one out-pin.
Public classPropertyAccessorT
Member Accessor implementation specialized on accessing properties (using set and get).
Interfaces
  InterfaceDescription
Public interfaceICalculationPerformer
Users should implement this interface on objects if a custom calculation is to be performed whenever the object is used within the node of a circuit.
Public interfaceIInPin
Interface used to handle incoming pins to nodes. This interface contains all relevant parts of an in-pin implementation not actually bound to the type of the pin.
Public interfaceIMemberAccessorT
Base interface for all accessors. An accessor implements the connections between the Pin (IInPin or IOutPin) of a Node and a member (such as a Field or a Property) of the object "hosted" by the Node.
Public interfaceIOutPin
Interface used to handle incoming pins to nodes. This interface contains all relevant parts of an out-pin implementation not actually bound to the type of the pin
Delegates