Connectivity

References
public sealed class Connectivity
A readonly snapshot of the object connectivity within a document.

Constructors

Connectivity

#
Construct a new document connectivity. This is not a threadsafe constructor, if the document is modified during the construction of this connectivity, things may go terribly wrong.
public Connectivity()

Connectivity

#
Create a connectivity set from a collection of objects.
public Connectivity()

Properties

AllNodes

#
Iterate over all object and group nodes.
public IEnumerable<ConnectiveObject> AllNodes { get; }

GroupNodes

#
Iterate over all group nodes.
public IEnumerable<ConnectiveGroup> GroupNodes { get; }

ObjectNodes

#
Iterate over all object nodes.
public IEnumerable<ConnectiveObject> ObjectNodes { get; }

Methods

Find

#
Low level GUID -> ConnectiveObject resolver. This will search both the object and the group lists.
public bool Find()

FindAllInputs

#
Recursively find all input objects.
public IEnumerable<ConnectiveObject> FindAllInputs()

FindAllInputs

#
Recursively find all input objects.
public IEnumerable<ConnectiveObject> FindAllInputs(
id
)

FindAllOutputs

#
Recursively find all output objects.
public IEnumerable<ConnectiveObject> FindAllOutputs()

FindAllOutputs

#
Recursively find all output objects.
public IEnumerable<ConnectiveObject> FindAllOutputs(
id
)

FindConnections

#
Find all connective paths between two objects.
public IEnumerable<ConnectiveObject[]> FindConnections(
upstream,
Upstream object.
downstream
Downstream object.
)

FindConnections

#
Find all connective paths between two objects.
public IEnumerable<ConnectiveObject[]> FindConnections(
upstream,
Upstream object.
downstream
Downstream object.
)

FindImmediateInputs

#
Iterate over all the immediate inputs for an object. This includes inputs of any attached pins.
public IEnumerable<ConnectiveObject> FindImmediateInputs()

FindImmediateInputs

#
Iterate over all the immediate inputs for an object. This includes inputs of any attached pins.
public IEnumerable<ConnectiveObject> FindImmediateInputs(
id
)

FindImmediateOutputs

#
Iterate over all the immediate outputs for an object. This includes outputs of any attached pins.
public IEnumerable<ConnectiveObject> FindImmediateOutputs()

FindImmediateOutputs

#
Iterate over all the immediate outputs for an object. This includes outputs of any attached pins.
public IEnumerable<ConnectiveObject> FindImmediateOutputs(
id
)

FindNodes

#
Enumerate over all nodes that match the given IDs. Ids which cannot be found will be ignored.
public IEnumerable<ConnectiveObject> FindNodes(
ids,
Ids to find.
failures = null
If not null, will be populated with IDs which failed to resolve.
)

GetConnectiveId

#
Find the topological ID of an object.
public static Guid GetConnectiveId(
doc,
Document containing the object.
id
Id of object whose topological id to resolve.
)

GetConnectiveId

#
Gets the Id under which an object is represented in a Connectivity graph. This will either be the IDocumentObject.InstanceId of the founding object, or, if the object is an attached pin, the IDocumentObject.InstanceId of the cushion.
public static Guid GetConnectiveId()

IsLinear

#
Determine whether a set of objects acts as a linear sequence. That is there is a first object which is allowed to have inputs not in the set, a last object which is allowed to have outputs not in the set, and zero or more objects in between which only connect to their immediate neighbours on either side. Furthermore groups are allowed to exist, but only if all their contained objects are present within the sequence.
public bool IsLinear(
objects,
Objects to test.
leading,
First object in linear sequence, if found.
trailing
Last object in linear sequence, if found.
)

IsLinear

#
Determine whether a set of objects acts as a linear sequence. That is there is a first object which is allowed to have inputs not in the set, a last object which is allowed to have outputs not in the set, and zero or more objects in between which only connect to their immediate neighbours on either side. Furthermore groups are allowed to exist, but only if all their contained objects are present within the sequence.
public bool IsLinear(
ids,
Ids to test.
first,
First object in linear sequence, if found.
last
Last object in linear sequence, if found.
)

SortCausally

#
Sort a set of objects using their causal connections.
public ConnectiveObject[] SortCausally()

SubsetTopology

#
Measure the topology class for the subset of objects represented by the ids.
public GraphTopology SubsetTopology()

SubsetTopology

#
Measure the topology class for the set of objects. This method assumes that all the objects in the provided subset are part of the same document from which this connectivity was created. No input validation takes place.
public GraphTopology SubsetTopology()

WithoutRelays

#
Create a new connectivity not containing (certain) relay objects.
public Connectivity WithoutRelays(
dangling,
If true, relays with either no inputs or no outputs are removed.
simple,
If true, relays with single inputs and single outputs are removed.
complex
If true, relays with at least two inputs or two outputs are removed.
)