-
Notifications
You must be signed in to change notification settings - Fork 263
ATF Graph Interfaces
Graph support in ATF includes a variety of interfaces for general graphs, circuits, and statecharts. These interfaces reside in the Sce.Atf.Controls.Adaptable.Graphs
namespace and Atf.Gui
assembly.
In ATF, the interface for a graph is IGraph<IGraphNode, IGraphEdge<IGraphNode, IEdgeRoute>, IEdgeRoute>
:
public interface IGraph<out TNode, out TEdge, out TEdgeRoute>
where TNode : class, IGraphNode
where TEdge : class, IGraphEdge<TNode, TEdgeRoute>
where TEdgeRoute : class, IEdgeRoute
Graph objects, such as circuits, implement IGraph
.
IGraph
references several other interfaces:
-
IGraphNode
: Interface for a node in a graph; nodes are connected by edges. -
IGraphEdge<IGraphNode, IEdgeRoute>
: Interface for routed edges in a graph. Routed edges connect nodes and have a defined source and destination route from and to the nodes. -
IEdgeRoute
: Interface for edge routes, which contain information on source and destination nodes for graph edges.
IGraph
are covariant, so that more derived types can be used than the ones specified. (As of C# 4.0, generic interfaces support covariance for type parameters marked with the out modifier. This modifier ensures that the marked type parameter is only used in an output position, for example, the return type of a method.) Other types of graphs use IGraph
interfaces with parameters that are derived from the parameters specified in IGraph
's declaration, as shown in Types of Graphs. For instance, the Sce.Atf.Controls.Adaptable.Graphs.Circuit
class for circuit graphs implements IGraph
this way:
public abstract class Circuit : DomNodeAdapter, IGraph<Element, Wire, ICircuitPin>, ...
In this circuit interface, Element
is an element like an AND gate, Wire
is a wire connecting elements, and ICircuitPin
is a pin on an element. These classes and interface derive from or implement the interfaces in the general IGraph
interface:
-
Element
implementsICircuitElement
which implementsIGraphNode
. -
Wire
implementsIGraphEdge<Element, ICircuitPin>
. -
ICircuitPin
implementsIEdgeRoute
.
IGraph
interface contains the following properties:
-
Nodes
: Get the nodes in the graph asIEnumerable<IGraphNode>
— or something derived from that, because the parameter is covariant. -
Edges
: Get the edges in the graph asIEnumerable<IGraphEdge<IGraphNode, IEdgeRoute>>
— or something derived from that.
IGraph
also offers these extension methods:
-
GetEdges()
: Get the edges that connect to the given node. -
GetNodes()
: Get the nodes that connect to the given node. -
GetInputEdges()
: Get the "incoming" edges that connect to the given node. These are the edges whoseToNode
matches the given node. For a description of theToNode
property, see IGraphEdge Interface. -
GetOutputEdges()
: Get the "outgoing" edges that connect to the given node. These are the edges whoseFromNode
matches the given node. For a description of theFromNode
property, see IGraphEdge Interface. -
GetInputNodes()
: Get the "incoming" nodes that connect to the given node by an incoming edge. An incoming edge is an edge whoseToNode
matches the given node. -
GetOutputNodes()
: Get the "outgoing" nodes that connect to the given node by an outgoing edge. An outgoing edge is an edge whoseFromNode
matches the given node.
IGraphNode
is the interface for a node in a graph. Nodes take a variety of forms, depending on the type of graph. In a circuit, for instance, a node is an element that contains pins that are connected to other pins on elements. IGraphNode
contains these properties:
-
Name
: Get the node name. -
Bounds
: Get the bounding rectangle for the node in world space (or local space if a hierarchy is involved, as with sub-circuits).
IGraphEdge
is the interface for edges in a graph and has two forms. The first form is IGraphEdge<IGraphNode>
:
public interface IGraphEdge<out TNode>
where TNode : class, IGraphNode
This interface has the properties:
-
FromNode
: Get the edge's source node as anIGraphNode
— or something derived fromIGraphNode
, because the parameter is covariant. -
ToNode
: Get the edge's destination node as anIGraphNode
— or something derived from that, because the parameter is covariant.
IGraphEdge<out IGraphNode, out IEdgeRoute>
:
public interface IGraphEdge<out TNode, out TEdgeRoute> : IGraphEdge<TNode>
where TNode : class, IGraphNode
where TEdgeRoute : class, IEdgeRoute
This interface includes the properties:
-
FromRoute
: Get theIEdgeRoute
for the source node. -
ToRoute
: Get theIEdgeRoute
for the destination node.
IEdgeRoute
properties.
IEdgeRoute
indicates whether nodes allow multiple input or output edges with these Boolean properties:
-
AllowFanIn
: Get whether this node can accept multiple edges as inputs. -
AllowFanOut
: Get whether this node can accept multiple edges as outputs.
This table lists the other graph interfaces and their derivation. It includes Interfaces for general, circuit, and statechart graphs.
Interface | Derives from | Description |
---|---|---|
ICircuitContainer
|
Interface for container of circuit items. The container should support element addition, removal, and insertion. For details, see ICircuitContainer Interface. | |
ICircuitElement
|
IGraphNode
|
Interface for circuit elements, which have a Type property defining their pins and appearance.
|
ICircuitElementType
|
Interface for circuit element types, containing properties to define the appearance, inputs, and outputs of an element. For instance, the Image property gets an element image.
|
|
ICircuitGroupPin<out TElement> where TElement : class, ICircuitElement
|
ICircuitPin
|
Interface for group pins, which are virtual pins that expose real pins of elements inside the group to other circuit elements outside the group. Contains properties to get pin information: connections, bounds, and CircuitGroupPinInfo to specify behavior or appearance of ICircuitGroupPin .
|
ICircuitGroupType<TElement, TWire, TPin> where TElement : class, IGraphNode where TWire : class, IGraphEdge<TElement, TPin> where TPin : class, IEdgeRoute
|
IHierarchicalGraphNode<TElement, TWire, TPin> , ICircuitElementType
|
Interface for hierarchical circuit group element types. For more information on this interface, see Group Class. |
ICircuitPin
|
IEdgeRoute
|
Interface for pins, which are the sources and destinations for wires between circuit elements. Its properties get the name, type, and pin index. |
IComplexState<TNode, TEdge> where TNode : class, IState where TEdge : class, IGraphEdge<TNode, BoundaryRoute>
|
IHierarchicalGraphNode<TNode, TEdge, BoundaryRoute>
|
Interface for states in statechart diagrams that are non-pseudo-states. For more information, see Statechart Interfaces. |
IEdgeStyleProvider
|
Provide information about an edge's shape and appearance in an EdgeStyle enumeration or EdgeStyleData . For more information, see EdgeStyleData Class.
|
|
IEditableGraph<in TNode, TEdge, in TEdgeRoute> where TNode : class, IGraphNode where TEdge : class, IGraphEdge<TNode, TEdgeRoute> where TEdgeRoute : class, IEdgeRoute
|
Interface for a graph that can be edited by a control.Contains methods to change node connections. | |
IEditableGraphContainer<in TNode, TEdge, in TEdgeRoute> where TNode : class, IGraphNode where TEdge : class, IGraphEdge<TNode, TEdgeRoute> where TEdgeRoute : class, IEdgeRoute
|
IEditableGraph<TNode, TEdge, TEdgeRoute>
|
Interface for container of graph objects. Its methods allow moving items in and out of the container and resizing it. For information on its use, see CircuitEditingContext Class. |
IGraphAdapter<TNode, TEdge, TEdgeRoute> where TNode : class, IGraphNode where TEdge : class, IGraphEdge<TNode, TEdgeRoute> where TEdgeRoute : class, IEdgeRoute
|
Interface for graph adapters, which manage rendering and picking for a graph in the adapted control. This is currently unused. | |
IGraphNodeOptionsProvider
|
Interface for IGraphNode that can provide additional options for controlling the display and other aspects of a graph node.
|
|
IHierarchicalCircuitElementType<TElement, TWire, TPin> where TElement : class, ICircuitElement where TWire : class, IGraphEdge<TElement, TPin> where TPin : class, ICircuitPin
|
IHierarchicalGraphNode<TElement, TWire, TPin> , ICircuitElementType
|
Interface for a hierarchical circuit element type. Currently unused. |
IHierarchicalGraphNode<out TNode, TEdge, TEdgeRoute> where TNode : class, IGraphNode where TEdge : class, IGraphEdge<TNode, TEdgeRoute> where TEdgeRoute : class, IEdgeRoute
|
IGraphNode
|
Interface for hierarchical nodes in a graph, which contain sub-nodes. For more information on this interface, see Group Class. |
IState
|
IGraphNode
|
Interface for states in state-transition diagrams, such as statecharts. For more information, see Statechart Interfaces. |
- What is a Graph in ATF: General description of graphs.
- Graph Data Model: Data model for graphs using the ATF DOM.
- Types of Graphs: Types of graphs supported in ATF.
-
ATF Graph Interfaces: The main interface
IGraph
and other interfaces used in graphs. - General Graph Support: Description of general graph support.
- Circuit Graph Support: How to use circuit graphs, which ATF provides the most support for.
- Statechart Graph Support: Support for statechart type graphs.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC