Class Anchor
A coordinate system using in kinematic chain.
public class Anchor : IAnchoredDisplayee, IGetAnchor, IGetTopoIndex, IDisplayee, IExpandToBox3d
- Inheritance
-
Anchor
- Implements
- Inherited Members
- Extension Methods
Constructors
Anchor()
Ctor.
public Anchor()
Anchor(Asmb)
Ctor.
public Anchor(Asmb asmb)
Parameters
asmbAsmbadd this to
asmbby Add(Anchor)
Anchor(Asmb, string)
Ctor.
public Anchor(Asmb asmb, string name)
Parameters
asmbAsmbadd this to
asmbby Add(Anchor)namestring
Properties
BranchMap
Gets a snapshot of the branches departing from this anchor, keyed by their Arrow. ‘this’ anchor locates on Fletch.
public Dictionary<Anchor, Branch> BranchMap { get; }
Property Value
BranchMapInv
Gets a snapshot of the branches arriving at this anchor, keyed by their Fletch. ‘this’ anchor locates on Arrow.
public Dictionary<Anchor, Branch> BranchMapInv { get; }
Property Value
Guid
GUID.
public Guid Guid { get; }
Property Value
IndexXName
The XML element name used for indexing anchors.
public static string IndexXName { get; }
Property Value
IndexXml
Get XML for indexing. Only the Guid takes effect when reading.
public XElement IndexXml { get; }
Property Value
Name
Name.
public string Name { get; set; }
Property Value
Parent
The assembly this anchor belongs to; null while it belongs to none. An anchor belongs to at most one assembly at a time. Maintained by Add(Anchor) and Remove(Anchor).
public Asmb Parent { get; }
Property Value
Methods
Ancestors()
The assemblies enclosing this anchor, nearest first.
public IEnumerable<Asmb> Ancestors()
Returns
ConnectedAnchors()
Every anchor reachable from this one over branches, this one included, regardless of which assemblies they belong to.
public HashSet<Anchor> ConnectedAnchors()
Returns
Detach()
Detach all related Branch.
public void Detach()
Display(Bind)
Display function called in DispEngine rendering loop.
public void Display(Bind bind)
Parameters
bindBindBind with DispEngine. See Bind.
ExpandToBox3d(Box3d)
Expands the destination box. This function is usually used to compute the bounding box of elements.
public virtual void ExpandToBox3d(Box3d dst)
Parameters
dstBox3dDestination box
GetAnchor()
Get key anchor. (i.e. root anchor)
public Anchor GetAnchor()
Returns
- Anchor
key anchor
GetByIndexXml(XElement, Dictionary<Guid, Anchor>)
Gets an anchor from its XML index representation using a GUID-to-Anchor dictionary.
public static Anchor GetByIndexXml(XElement src, Dictionary<Guid, Anchor> guidToAncDictionary)
Parameters
srcXElementThe source XML element containing the anchor index information.
guidToAncDictionaryDictionary<Guid, Anchor>Dictionary mapping GUIDs to Anchor objects.
Returns
- Anchor
The anchor object corresponding to the XML index.
GetMat4d(IGetAnchor)
Get transform matrix from this to tail.
public Mat4d GetMat4d(IGetAnchor tail)
Parameters
tailIGetAnchortail
Returns
- Mat4d
transform matrix; null when no branch chain connects the two
GetMat4dMap()
Gets the transform of every anchor in ConnectedAnchors(), expressed in this anchor's coordinate.
public Dictionary<Anchor, Mat4d> GetMat4dMap()
Returns
NeighborAnchors()
The anchors one branch away, in either direction; each once.
public IEnumerable<Anchor> NeighborAnchors()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.