[IoId("00000000-5b8c-4ffa-b0d9-38e86ca1f51d")] [Author("DavidR")] public sealed class Cluster : Component, IDocumentParent, IPinCushion
A single component wrapping a whole document.

Constructors

Cluster

#
public Cluster()

Cluster

#
public Cluster(IDocumentObject[] objects, out Guid[][] inputMapping, out Guid[][] outputMapping)
Create a cluster based on a set of components. These components will be duplicated as part of this constructor.
objects (IDocumentObject[])Objects that make up the cluster.
inputMapping (out Guid[][])For every cluster input parameter, an array of IDs of parameters whose input lists to migrate.
outputMapping (out Guid[][])For every cluster output parameter, an array of IDs of parameters whose output lists to migrate.

Cluster

#
public Cluster(IReader reader)
reader (IReader)

Properties

Activity

public ObjectActivity Activity { get; set; }
Gets or sets the active state of this object. Note that this property is meaningless for certain types of object.
inherited fromDocumentObject
Activity

Attributes

public IAttributes Attributes { get; }
Gets or sets the attributes for this object.
inherited fromDocumentObject
Attributes

BakeCapable

public virtual bool BakeCapable { get; }
Gets whether this component is capable of baking any data at this very moment.
inherited fromComponent
BakeCapable

ChildrenObjects

public override IEnumerable<IDocumentObject> ChildrenObjects { get; }
Gets all immediate child objects that belong to the current object. It is possible that an object does not have any children, and it is possible that a child object has children of its own.
inherited fromComponent

Connectivity

public override IObjectConnectivity Connectivity { get; }
Gets the topological description of this object. Component topology by default only connects the component to its own inputs and outputs. If you wish to get the connectivity for the component as a whole, access the ConnectivityComplete property instead.
inherited fromComponent

ConnectivityComplete

public IObjectConnectivity ConnectivityComplete { get; }
Gets the connectivity of this component as a whole (meaning including the input and output parameters).
inherited fromComponent

CustomValues

public KeyedValues CustomValues { get; }
Gets a collection of keyed values which can be used to store custom data which will survive (de)serialisation.
inherited fromDocumentObject
CustomValues

Display

public ObjectDisplay Display { get; set; }
Gets or sets the display state of this object. Note that this property is meaningless for certain types of object.
inherited fromDocumentObject
Display

DisplayCache

public DisplayCache DisplayCache { get; }
Gets or sets the ActiveObject.DisplayCache to use while displaying this object.
inherited fromActiveObject

DisplayCapable

public override bool DisplayCapable { get; }
inherited fromComponent

DisplayName

public virtual string DisplayName { get; }
Gets the display name of this object. Often the DisplayName is identical to the UserName, but there could be more complicated algorithms involved.
inherited fromDocumentObject
DisplayName

DisplayParameters

protected IEnumerable<IParameter> DisplayParameters { get; }
Enumerate over all display capable inputs and outputs. This enumerator skips over disabled and hidden parameters, as well as inputs with sources, and parameters whose attribute bounds are empty.
inherited fromComponent

DisplayStyle

public ObjectDisplayStyle DisplayStyle { get; set; }
Gets or sets the display style to use for the geometric data inside this object. Note that this property is meaningless for certain types of object.
inherited fromDocumentObject
DisplayStyle

Document

public Document Document { get; set; }
Gets or sets the document this object belongs to. It is possible an object does not belong to any document, however it can never belong to more than one document simultaneously.
inherited fromDocumentObject
Document

EntangledClusters

#
public IEnumerable<Cluster> EntangledClusters { get; }
Iterate over all entangled clusters in the file containing this cluster. Entangled clusters have the same Document.Hash of the InnerDocument. This enumeration will always include at least this cluster, but not necessarily at the start or end.

EntireFamily

public IEnumerable<IDocumentObject> EntireFamily { get; }
Enumerates over all objects in the hierarchy this object is part of. This enumeration starts at the root object and then continues over all children and grandchildren in a breadth-first fashion.
inherited fromDocumentObject
EntireFamily

FoundingObject

public IDocumentObject FoundingObject { get; }
Gets the root or founding object in the object hierarchy. If the current object does not have a parent, it is a founding object.
inherited fromDocumentObject
FoundingObject
Explicit

IDocumentParent.ParentObject

#
ParentObject
Explicit

IPinCushion.SupportedPins

#
SupportedPins

Icon

public IIcon Icon { get; }
Gets the icon associated with this object.
inherited fromDocumentObject
Icon

IconInternal

protected virtual IIcon IconInternal { get; }
Override this method to provide an icon for this object. If the icon is an embedded resource in this assembly with the same name as the class, it will automatically be loaded. The DocumentObject.Icon property calls this property and caches the result.
inherited fromDocumentObject

IconMode

public NameIconMode IconMode { get; set; }
Gets or sets the name vs. icon display mode of this component.
inherited fromComponent

InnerDocument

#
public Document InnerDocument { get; set; }
Gets or sets the document hosted inside this cluster. Changes made to the document do not automatically percolate to the cluster. Probably best if you keep your dirty little fingers away from it altogether.

InstanceId

public Guid InstanceId { get; set; }
Gets or sets the instance Id for this object. The instance Id should be different for every instance of every type. Do *not* assign this Id unless you know exactly what you are doing.
inherited fromDocumentObject
InstanceId

Label

public string Label { get; protected set; }
Gets (or sets, if you derive from this component) the label. The label ought to be a short, single-line string which is displayed as part of the component slab.
inherited fromComponent

LoopSolution

#
public bool LoopSolution { get; set; }
Gets or sets whether to loop this cluster. It is the responsibility of the caller to record undo and compute new solutions after setting this.

Nomen

public Nomen Nomen { get; }
Gets the user friendly description of this object.
inherited fromDocumentObject
Nomen

Obsolete

public bool Obsolete { get; }
Gets whether this object is considered obsolete.
inherited fromDocumentObject
Obsolete

Parameters

public ComponentParameters Parameters { get; }
Gets access to the input and output parameters of this component.
inherited fromComponent

ParentObject

public IDocumentObject ParentObject { get; set; }
Gets or sets the parent object that owns this object. Top-level objects do not have parents. Do not assign or remove parents unless you know exactly what you are doing.
inherited fromDocumentObject
ParentObject

Phase

public virtual Phase Phase { get; }
Gets the current solution phase of this object.
inherited fromDocumentObject
Phase

Pins

[EditorBrowsable(EditorBrowsableState.Never)] public Pins Pins { get; }
Gets the pin collection for this cushion. Note that the Component base class implements this only to make it easier for sub-classes to implement IPinCushion. If the derived class does not implement IPinCushion then this field will probably be null.
inherited fromComponent

ProgressPercentage

public int ProgressPercentage { get; }
Gets the progress as a percentage. If this object is currently not calculating a new solution, this number is not meaningful.
inherited fromDocumentObject
ProgressPercentage

RelayMessages

#
public bool RelayMessages { get; set; }

Relevance

public ObjectRelevance Relevance { get; set; }
Gets or sets the auxiliary state of this object. Auxiliary objects are drawn in an inconspicuous way as they are considered in-between logic. Note that this property is meaningless for certain types of object.
inherited fromDocumentObject
Relevance

Selected

public bool Selected { get; }
Gets the main yes/no state from the SelectionState.
inherited fromDocumentObject
Selected

Selection

public ObjectSelection Selection { get; set; }
Gets or sets the selected state of this object. Note that the selected setting of secondary objects is inherited from the parent.
inherited fromDocumentObject
Selection

SiblingObjects

public IEnumerable<IDocumentObject> SiblingObjects { get; }
Gets all sibling objects in the object family tree.
inherited fromDocumentObject
SiblingObjects

State

public override ObjectSolutionState State { get; }
Gets the current state of this object. This is always the most recently completed state.
inherited fromActiveObject

SupportsVariableParameters

public bool SupportsVariableParameters { get; }
Gets whether this component supports parameter addition and removal. For this to be true, the methods Component.CanCreateParameter(Side, int), Component.CanRemoveParameter(Side, int), and Component.DoCreateParameter(Side, int, ActionList) must all have been overridden.
inherited fromComponent

Threading

public ThreadingState Threading { get; set; }
Gets or sets the processing level for this component.
inherited fromComponent

UserName

public string UserName { get; set; }
Gets the user specified name of this object.
inherited fromDocumentObject
UserName

Methods

AddInputs

#
protected override void AddInputs(InputAdder inputs)
inputs (InputAdder)

AddOutputs

#
protected override void AddOutputs(OutputAdder outputs)
outputs (OutputAdder)

AddUndoRecord

public void AddUndoRecord(Record record)
Add a custom undo record for this object.
inherited fromDocumentObject
record (Record)Undo record to add.
Id of undo record.
AddUndoRecord

AddUndoRecord

public void AddUndoRecord(VerbNoun name, Action action)
Add a single action undo record for this object.
inherited fromDocumentObject
name (VerbNoun)Name of undo record.
action (Action)Specific action to undo.
Id of undo record.
AddUndoRecord

AppendBakeInput

protected void AppendBakeInput(InputPanel panel)
Append the baking input panel.
inherited fromDocumentObject
panel (InputPanel)

AppendMetaMixingInput

protected void AppendMetaMixingInput(InputPanel panel)
inherited fromComponent
panel (InputPanel)

AppendPinToggles

protected void AppendPinToggles(InputPanel panel)
Add toggles to an input panel based on the supported pins of this component.
inherited fromComponent
panel (InputPanel)

AppendStateInput

protected void AppendStateInput(InputPanel panel, bool enabledState, bool displayState)
Append the 'Enabled' and 'Display' states to this input panel.
inherited fromDocumentObject
panel (InputPanel)Panel to append to.
enabledState (bool)If true, the Enabled state button will be modifiable.
displayState (bool)If true, the Display state button will be modifiable.

AppendToInputPanel

#
public override void AppendToInputPanel(InputPanel panel)
panel (InputPanel)

AppendUserNameInput

protected void AppendUserNameInput(InputPanel panel)
Append the user name text box within a category labelled 'Attributes'.
inherited fromDocumentObject
panel (InputPanel)

BakeShapes

public string[] BakeShapes(BakeContext context, BakeUpdateMode mode)
Bake the shapes in all output parameters. By default this method does not include input parameters or any data on the component itself, but individual components may override that behaviour.
inherited fromComponent
context (BakeContext)
mode (BakeUpdateMode)
BakeShapes

BeforeProcess

#
protected override void BeforeProcess(Solution solution)
solution (Solution)

CanCreateParameter

public virtual bool CanCreateParameter(Side side, int index)
Method which determines whether a parameter can be created at the given location.
inherited fromComponent
side (Side)
index (int)

CanRemoveParameter

public virtual bool CanRemoveParameter(Side side, int index)
Method which determines whether the specified parameter can be removed.
inherited fromComponent
side (Side)
index (int)

ChangeInstanceIds

public void ChangeInstanceIds(Dictionary<Guid, Guid> map)
inherited fromDocumentObject
map (Dictionary<Guid, Guid>)

Compute

public sealed override SolutionData Compute(Solution solution, CallStack stack)
Compute a new solution for this object, or return a completed solution if one is available.
inherited fromActiveObject
solution (Solution)
stack (CallStack)
Result of computation.

ComputeInternal

protected override SolutionData ComputeInternal(Solution solution, CallStack stack)
Compute and populate a new solution object. Please do not override this method on your own component class unless you have a really solid understanding of what you're doing. The only reason this method isn't sealed is because Chains and Clusters need to be able to override it.
inherited fromComponent
solution (Solution)Top level document solution associated with this particular Compute() invoke.
stack (CallStack)Call stack up to this point.
A fully populated solution object.

CreateAttributes

#
protected override IAttributes CreateAttributes()

Disentangle

#
public void Disentangle(ActionList actions = null)
Disentangle this cluster from any and all relations by setting a random Guid in the custom values of the inner document. This will cause the inner document to have a different hash, which in turn disassociates this cluster from any other ones.
actions (ActionList = null)

DisplayBounds

public override BoundingBox DisplayBounds()
inherited fromComponent

DisplayFaces

public override void DisplayFaces(DisplayPipeline pipeline, Guises guises, ref BoundingBox extents)
inherited fromComponent
pipeline (DisplayPipeline)
guises (Guises)
extents (ref BoundingBox)

DisplayWires

public override void DisplayWires(DisplayPipeline pipeline, Guises guises, ref BoundingBox extents)
inherited fromComponent
pipeline (DisplayPipeline)
guises (Guises)
extents (ref BoundingBox)

DoCreateParameter

public virtual void DoCreateParameter(Side side, int index, ActionList undo)
Method used to construct the parameter at the given location. This method is only called if Component.CanCreateParameter(Side, int) returns true with the same side and index.
inherited fromComponent
side (Side)Indicated side.
index (int)Indicated index.
undo (ActionList)Addition and other modification undo actions ought to be appended to this list.

DoRemoveParameter

public virtual void DoRemoveParameter(Side side, int index, ActionList undo)
Method used to remove the indicated parameter for realsies. This method is only called if Component.CanRemoveParameter(Side, int) returns true with the same side and index.
inherited fromComponent
side (Side)Indicated side.
index (int)Indicated index.
undo (ActionList)Removal and other modification undo actions ought to be appended to this list.

EditInnerDocument

#
public bool EditInnerDocument()

EnsureMaps

#
public void EnsureMaps(out Listen[] mapIn, out Shout[] mapOut)
Ensure that the cached arrays linking input and output parameters with the Listen and Shout objects inside the InnerDocument exist and have been populated with matches. Note that this assumes the parameters, listens, and shouts actually do match up. If that's not the case, the mapping arrays will contain null entries.
mapIn (out Listen[])
mapOut (out Shout[])

Expire

public sealed override void Expire()
Expire this object and all objects that depend on it. This will request-cancel any running solutions inside whatever document contains this object.
inherited fromActiveObject

ExpireAllRecipients

#
protected override void ExpireAllRecipients()

ExpireDisplay

protected void ExpireDisplay()
Expire the attributes and raise the DisplayChanged event.
inherited fromDocumentObject

ExpireDueToPin

#
public void ExpireDueToPin(Guid pinTypeId)
Expire all objects contained within the inner document which support the given pin type, but which do not have a pin of that type attached to them. If at least one inner object was expired, the cluster itself is also expired so that downstream recipients recompute.
pinTypeId (Guid)

Explode

#
public bool Explode()
Explode this cluster into the host document. Every object inside the inner document (excluding the cluster-boundary Listen/Shout proxies) is duplicated into the host document with fresh instance ids; wires crossing the cluster boundary are rerouted directly between the host document's parameters and the duplicates. The cluster itself is then removed. The entire operation is recorded as a single undo record. Looping clusters cannot be exploded; calling this method on a looping cluster returns false without making any change.
True if the cluster was exploded.

GetCreationInfo

public bool GetCreationInfo(out string name, out DateTime time)
Gets information about who created this component and when.
inherited fromDocumentObject
name (out string)Name of creator.
time (out DateTime)Time of creation in UTC coordinates.
True if the creation data was available.
GetCreationInfo

GetModificationInfo

public bool GetModificationInfo(out string name, out DateTime time)
Gets information about who last modified this component and when.
inherited fromDocumentObject
name (out string)Name of modifier.
time (out DateTime)Time of modification in UTC coordinates.
True if the modification data was available.
Explicit

IDocumentParent.ResolveGlobal

#
ITree IDocumentParent.ResolveGlobal(string search, IDocumentObject caller, Solution solution)
search (string)
caller (IDocumentObject)
solution (Solution)
ResolveGlobal

InvalidateExistingLayout

protected void InvalidateExistingLayout()
Invalidate the attribute layout, but only if the attributes already exist.
inherited fromDocumentObject

ModifyIcon

public void ModifyIcon(IIcon newIcon, bool overrideExtrinsicIcon = true)
Override the icon for this object. Use this judiciously.
inherited fromDocumentObject
newIcon (IIcon)New icon to assign, or null to revert to the default icon.
overrideExtrinsicIcon (bool = true)If true, the permanent extrinsic icon will be overwritten. If false, the temporary intrinsic icon will be overwritten.
ModifyIcon

ModifyNameAndInfo

public void ModifyNameAndInfo(string name = null, string info = null)
Programmatically modify the nickname, name and/or info strings on the Nomen.
inherited fromDocumentObject
name (string = null)New name if not null.
info (string = null)New info if not null.
ModifyNameAndInfo

OnDisplayChanged

public void OnDisplayChanged()
inherited fromDocumentObject
OnDisplayChanged

OnExpired

protected internal void OnExpired()
Raise the Expired event.
inherited fromDocumentObject

OnLayoutChanged

public void OnLayoutChanged()
inherited fromDocumentObject
OnLayoutChanged

OverrideAttributes

public bool OverrideAttributes(IAttributes attributes)
Assign new attributes to this object. Not all attributes may be accepted, it depends on the implementation.
inherited fromDocumentObject
attributes (IAttributes)New attributes to assign. Assigning null will revert to default attributes.
True if attributes were accepted.
OverrideAttributes

PopulateDisplay

protected virtual void PopulateDisplay(SolutionData result, DisplayBag bag, CancellationToken token)
Override this method to populate a display bag from a computed result. The DisplayCapable property will return true if this method has been overridden.
inherited fromActiveObject
result (SolutionData)Solution result.
bag (DisplayBag)Bag to populate.
token (CancellationToken)Cancellation token.

PostProcess

protected virtual void PostProcess(Solution solution, FleetingCustomData customData)
Override this method to perform some action after all calls to Component.Process(IDataAccess) during a single solution.
inherited fromComponent
solution (Solution)Solution for this process.
customData (FleetingCustomData)Fleeting custom data populated during the Process iterations.

PostProcessTree

protected virtual ITree PostProcessTree(ITree tree, int index, Solution solution)
Override this method if you wish to post-process the trees generated for the output parameters.
inherited fromComponent
tree (ITree)Tree to process.
index (int)Index of output parameter this tree is for.
solution (Solution)Solution this call is associated with.
The same or a modified tree.

PreProcess

protected virtual void PreProcess(Solution solution)
Override this method to perform some action prior to any call to Component.Process(IDataAccess) during a single solution.
inherited fromComponent
solution (Solution)

Process

#
protected override void Process(IDataAccess access)
access (IDataAccess)

Process

protected virtual void Process(IDataAccess[] iterations, CancellationToken token)
inherited fromComponent
iterations (IDataAccess[])
token (CancellationToken)

RequestAutoSave

public AutoSaveResult RequestAutoSave(AutoSaveReason reason, Guid autosaveId)
Request an autosave.
inherited fromDocumentObject
reason (AutoSaveReason)Autosave reason.
autosaveId (Guid)Autosave Id. Consecutive requests with identical Ids are ignored.
RequestAutoSave

RequestAutoSave

public AutoSaveResult RequestAutoSave(AutoSaveReason reason)
Request an autosave using the instance ID of this object as a filter. This means hat subsequent autosave requests coming from the same object will be ignored.
inherited fromDocumentObject
reason (AutoSaveReason)Autosave reason.
RequestAutoSave

ResolveIconMode

public NameIconMode ResolveIconMode(NameIconMode mode)
Resolve the current icon mode to one of the definite states.
inherited fromComponent
mode (NameIconMode)

SetCreationInfo

public void SetCreationInfo()
Set the CreatedBy and CreatedAt fields if they haven't been set already.
inherited fromDocumentObject
SetCreationInfo

SetModificationInfo

public void SetModificationInfo()
Set the ModifiedBy and ModifiedAt fields.
inherited fromDocumentObject

SetProgressPercentage

public void SetProgressPercentage(int percentage)
Set the DocumentObject.ProgressPercentage field directly. The percentage is automatically limited to the [0, 100] interval.
inherited fromDocumentObject
percentage (int)

SetProgressPercentage

public void SetProgressPercentage(long partial, long total)
Set the DocumentObject.ProgressPercentage field based on a step count. This method always limits the percentage to the [1, 99] range, as 0% and 100% are oftentimes indicative of unstarted or completed processes, which probably gives the wrong impression.
inherited fromDocumentObject
partial (long)Current step.
total (long)Total steps.

ShowLoopingEditor

#
public void ShowLoopingEditor(bool autoEnableLooping)
autoEnableLooping (bool)

ShowUiAndAuthorEditor

#
public void ShowUiAndAuthorEditor()

Store

#
public override void Store(IWriter writer)
writer (IWriter)
Component.Store

UpdateDisplay

public override void UpdateDisplay(SolutionData data, DisplayRules rules, CancellationToken token)
inherited fromActiveObject

VariableParameterMaintenance

public virtual void VariableParameterMaintenance()
This method will be invoked whenever a parameter is added or removed via the variable parameter mechanism.
inherited fromComponent

Events

ActivityChanged

public event EventHandler<ObjectEventArgs> ActivityChanged
Raised whenever the Enabled state of this object changes.
inherited fromDocumentObject
ActivityChanged

AutosaveRequested

public event EventHandler<ObjectAutoSaveEventArgs> AutosaveRequested
Raised whenever this object requests an autosave.
inherited fromDocumentObject
AutosaveRequested

DisplayChanged

public event EventHandler<ObjectEventArgs> DisplayChanged
Raised whenever the display state of this object changes.
inherited fromDocumentObject
DisplayChanged

DocumentChanged

public event EventHandler<ObjectDocumentEventArgs> DocumentChanged
Raised whenever this object becomes part of a different document.
inherited fromDocumentObject
DocumentChanged

Expired

public event EventHandler<ObjectEventArgs> Expired
Raised whenever the solution currently held by this object is expired.
inherited fromDocumentObject
Expired

InstanceIdChanged

public event EventHandler<ObjectGuidEventArgs> InstanceIdChanged
Raised whenever the InstanceId of this object changes.
inherited fromDocumentObject
InstanceIdChanged

LayoutChanged

public event EventHandler<ObjectEventArgs> LayoutChanged
Raised whenever the layout of this object changes. Layout invalidation triggers a canvas redraw.
inherited fromDocumentObject
LayoutChanged

NameChanged

public event EventHandler<ObjectNameEventArgs> NameChanged
Raised whenever the UserName of this object changes. This typically infers that the DisplayName also changes.
inherited fromDocumentObject
NameChanged

RelevanceChanged

public event EventHandler<ObjectEventArgs> RelevanceChanged
Raised whenever the Auxiliary state of this object changes.
inherited fromDocumentObject
RelevanceChanged

SelectedChanged

public event EventHandler<ObjectEventArgs> SelectedChanged
Raised whenever the Selected state of this object changes.
inherited fromDocumentObject
SelectedChanged