Table of Contents

Class Branch

Namespace
Hi.Mech.Topo
Assembly
HiMech.dll

The linkage between two Anchor objects.

public class Branch
Inheritance
Branch
Inherited Members
Extension Methods

Properties

Arrow

Anchor from arrow side.

public Anchor Arrow { get; }

Property Value

Anchor

Fletch

Anchor from fletch side.

public Anchor Fletch { get; }

Property Value

Anchor

Guid

GUID.

public Guid Guid { get; }

Property Value

Guid

IsBreak

Is break.

public bool IsBreak { get; }

Property Value

bool

Name

Gets or sets the name of the branch.

public string Name { get; set; }

Property Value

string

Step

If the Transformer is IDynamicRegular, the property is delegated from IDynamicRegular.Step; otherwise, the getter returns NAN and setter does nothing.

public double Step { get; set; }

Property Value

double

Transformer

Transformer.

public ITransformer Transformer { get; set; }

Property Value

ITransformer

Methods

Attach(IGetAnchor, IGetAnchor)

Attempts to attach two anchors.

public static Branch Attach(IGetAnchor fletch, IGetAnchor arrow)

Parameters

fletch IGetAnchor

See Fletch

arrow IGetAnchor

See Arrow

Returns

Branch

branch

Attach(IGetAnchor, IGetAnchor, ITransformer)

Attempts to attach two anchors with a specified transformer.

public static Branch Attach(IGetAnchor fletch, IGetAnchor arrow, ITransformer transformer)

Parameters

fletch IGetAnchor

See Fletch

arrow IGetAnchor

See Arrow

transformer ITransformer

See Transformer

Returns

Branch

branch

AttachIfAbsence(IGetAnchor, IGetAnchor)

Attempts to attach two anchors if they are not already connected. If the anchors are already connected, returns null instead of throwing an exception.

public static Branch AttachIfAbsence(IGetAnchor fletch, IGetAnchor arrow)

Parameters

fletch IGetAnchor

The fletch-side anchor to attach

arrow IGetAnchor

The arrow-side anchor to attach

Returns

Branch

The newly created branch if successful, null if the anchors are already connected

Detach()

Break the branch.

public void Detach()

Detach(IGetAnchor, IGetAnchor)

Break the branch from Get(IGetAnchor, IGetAnchor).

public static void Detach(IGetAnchor fletch, IGetAnchor arrow)

Parameters

fletch IGetAnchor

See Fletch

arrow IGetAnchor

See Arrow

Exceptions

InvalidOperationException

The exception is throwed if the Branch is not existed.

DetachIfExisted(IGetAnchor, IGetAnchor)

Break the branch from Get(IGetAnchor, IGetAnchor).

public static bool DetachIfExisted(IGetAnchor fletch, IGetAnchor arrow)

Parameters

fletch IGetAnchor

See Fletch

arrow IGetAnchor

See Arrow

Returns

bool

true if the Branch existed and then been deteched.

Get(IGetAnchor, IGetAnchor)

Get existed Branch by fletchSource and arrowSource.

public static Branch Get(IGetAnchor fletchSource, IGetAnchor arrowSource)

Parameters

fletchSource IGetAnchor

fletch

arrowSource IGetAnchor

arrow

Returns

Branch

The branch. If branch not exist, return null.

IsExisted(IGetAnchor, IGetAnchor)

Checks if a branch exists between two anchors.

public static bool IsExisted(IGetAnchor fletch, IGetAnchor arrow)

Parameters

fletch IGetAnchor

The fletch-side anchor.

arrow IGetAnchor

The arrow-side anchor.

Returns

bool

True if a branch exists between the anchors, false otherwise.

ToLinkString()

Get brief link description.

public string ToLinkString()

Returns

string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryAttach(IGetAnchor, IGetAnchor, ITransformer)

Attempts to attach two anchors with a specified transformer. If the attachment fails, returns null instead of throwing an exception.

public static Branch TryAttach(IGetAnchor fletch, IGetAnchor arrow, ITransformer transformer)

Parameters

fletch IGetAnchor

The fletch-side anchor to attach

arrow IGetAnchor

The arrow-side anchor to attach

transformer ITransformer

The transformer to use for the branch

Returns

Branch

The newly created branch if successful, null if the attachment fails