Class GeneralMechanism
General Mechanism.
public class GeneralMechanism : IMakeXmlSource, ITopoDisplayee, IGetAsmb, IGetTopoIndex, IAnchoredDisplayee, IGetRootAnchor, IDisplayee, IExpandToBox3d, IGetAnchoredDisplayeeList, IGetAnchorToSolidDictionary
- Inheritance
-
GeneralMechanism
- Implements
- Inherited Members
- Extension Methods
Remarks
The XML IO is according to self-contained principle.
Constructors
GeneralMechanism()
Initializes a new instance of the GeneralMechanism class.
public GeneralMechanism()
GeneralMechanism(XElement, string)
Initializes a new instance of the GeneralMechanism class from XML.
public GeneralMechanism(XElement src, string baseDirectory)
Parameters
srcXElementThe XML element containing the mechanism data.
baseDirectorystringThe base directory for resolving relative file paths.
Properties
AnchorToSolid
Gets the dictionary mapping anchors to their corresponding solids.
public Dictionary<Anchor, Solid> AnchorToSolid { get; }
Property Value
Asmb
Gets the assembly containing the mechanism components.
public Asmb Asmb { get; }
Property Value
Root
Gets the root anchor of the mechanism.
public Anchor Root { get; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
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 void ExpandToBox3d(Box3d dst)
Parameters
dstBox3dDestination box
GetAnchorToSolidDictionary()
public Dictionary<Anchor, Solid> GetAnchorToSolidDictionary()
Returns
- Dictionary<Anchor, Solid>
A dictionary where keys are anchors and values are their associated solids.
GetAnchoredDisplayeeList()
Gets a list of anchored displayable objects.
public List<IAnchoredDisplayee> GetAnchoredDisplayeeList()
Returns
- List<IAnchoredDisplayee>
A list of IAnchoredDisplayee objects
GetAsmb()
Gets the key asmb.
public Asmb GetAsmb()
Returns
- Asmb
The key asmb.
GetRootAnchor()
Get root anchor.
public Anchor GetRootAnchor()
Returns
- Anchor
root anchor.
MakeXmlSource(string, string)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
Returns
- XElement
An XML element representing the object's state