DocumentObject

References
[DebuggerDisplay("{DebuggerDisplay}")] public abstract class DocumentObject : IDocumentObject
Abstract implementation of the IDocumentObject interface for all objects.

Constructors

DocumentObject

#
Deserialization constructor.
protected DocumentObject(
reader
Reader object.
)

DocumentObject

#
Base class constructor.
protected DocumentObject(
nomen
Object description.
)

Properties

Activity

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

Attributes

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

ChildrenObjects

#
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.
public virtual IEnumerable<IDocumentObject> ChildrenObjects { get; }
ChildrenObjects

Connectivity

#
Gets the topological connectivity of this object. The topology is not updated automatically, so be sure to get a fresh instance every time you need it.
public abstract IObjectConnectivity Connectivity { get; }
Connectivity

CustomValues

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

Display

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

DisplayCapable

#
Gets whether this object makes allowance for 3D viewport displays.
public virtual bool DisplayCapable { get; }
DisplayCapable

DisplayName

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

DisplayStyle

#
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.
public ObjectDisplayStyle DisplayStyle { get; set; }
DisplayStyle

Document

#
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.
public Document Document { get; set; }
Document

EntireFamily

#
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.
public IEnumerable<IDocumentObject> EntireFamily { get; }
EntireFamily

FoundingObject

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

Icon

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

IconInternal

#
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 Icon property calls this property and caches the result.
protected virtual IIcon IconInternal { get; }

InstanceId

#
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.
public Guid InstanceId { get; set; }
InstanceId

Nomen

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

Obsolete

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

ParentObject

#
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.
public IDocumentObject ParentObject { get; set; }
ParentObject

Phase

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

ProgressPercentage

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

Relevance

#
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.
public ObjectRelevance Relevance { get; set; }
Relevance

Selected

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

Selection

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

SharedOptionWidth

#
Gets the minimum width needed for drawing the widest option label.
protected static int SharedOptionWidth { get; }

SiblingObjects

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

StandardColourOverrides

#
public static IEnumerable<(OpenColor.Family family, Color colour)> StandardColourOverrides { get; }

State

#
Gets the current solution state of this object.
public abstract ObjectSolutionState State { get; }
State

UserName

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

Methods

AddUndoRecord

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

AddUndoRecord

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

AppendBakeInput

#
Append the baking input panel.
protected void AppendBakeInput()

AppendStateInput

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

AppendToInputPanel

#
Override this method to populate the popover panel. The base implementation does not add any panel inputs, however the DocumentObject class does provide a slew of protected utility methods for adding standard inputs.
public virtual void AppendToInputPanel()
AppendToInputPanel

AppendUserNameInput

#
Append the user name text box within a category labelled 'Attributes'.
protected void AppendUserNameInput()

ChangeInstanceIds

#
public void ChangeInstanceIds()

Compute

#
Compute a new solution for this object, or return a completed solution if one is available.
public abstract SolutionData Compute(
solution,
Document solution info.
stack
Call stack leading up to this call.
)
Result of computation.
Compute

CreateAttributes

#
Create default attributes for this object. If attributes already exist, this method will not replace them.
protected abstract IAttributes CreateAttributes()

DisplayBounds

#
Gets the bounds of the geometry this object might display.
public virtual BoundingBox DisplayBounds()
DisplayBounds

DisplayFaces

#
Draw the shaded faces for this object.
public virtual void DisplayFaces(
pipeline,
guises,
extents
)
DisplayFaces

DisplayWires

#
Draw the wires for this object.
public virtual void DisplayWires(
pipeline,
guises,
extents
)
DisplayWires

Expire

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

ExpireDisplay

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

GetCreationInfo

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

GetModificationInfo

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

InvalidateExistingLayout

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

ModifyIcon

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

ModifyNameAndInfo

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

OnDisplayChanged

#
Raise the DisplayChanged event.
public void OnDisplayChanged()
OnDisplayChanged

OnExpired

#
Raise the Expired event.
protected internal void OnExpired()

OnLayoutChanged

#
Raise the LayoutChanged event.
public void OnLayoutChanged()
OnLayoutChanged

OverrideAttributes

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

RequestAutoSave

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

RequestAutoSave

#
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.
public AutoSaveResult RequestAutoSave(
reason
Autosave reason.
)
RequestAutoSave

SetCreationInfo

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

SetModificationInfo

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

SetProgressPercentage

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

SetProgressPercentage

#
Set the 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.
public void SetProgressPercentage(
partial,
Current step.
total
Total steps.
)

Store

#
Serialise this object.
public virtual void Store(
writer
)
Store

UpdateDisplay

#
Recreate the display caches based on the given solution data and display rules.
public virtual void UpdateDisplay(
data,
Data from which to extract display caches.
rules,
Optional display rules.
token
Cancellation token.
)
UpdateDisplay

Events

ActivityChanged

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

AutosaveRequested

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

DisplayChanged

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

DocumentChanged

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

Expired

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

InstanceIdChanged

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

LayoutChanged

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

NameChanged

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

RelevanceChanged

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

SelectedChanged

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