Table of Contents

Class FreeformHolder

Namespace
Hi.NcMech.Holders
Assembly
HiMech.dll

Represents a freeform tool holder with customizable geometry.

public class FreeformHolder : IHolder, ITopo, IGetAsmb, IGetAnchoredDisplayeeList, IAnchoredDisplayee, IDisplayee, IExpandToBox3d, IMakeXmlSource, IAbstractNote, IGetFletchMount, IDuplicate, INameNote, IAnchoredCollidabled, IGetCollidable, IGetAnchor, IGetTopoIndex, IGetSolid, IDisposable, IAnchoredCollidableLeaf, IAnchoredCollidableNode, IAnchoredCollidableBased, ICollidable, IClearCache
Inheritance
FreeformHolder
Implements
Inherited Members
Extension Methods

Constructors

FreeformHolder()

Ctor.

public FreeformHolder()

FreeformHolder(IStlSource)

Initializes a new instance of the FreeformHolder class from STL geometry.

public FreeformHolder(IStlSource geom)

Parameters

geom IStlSource

The STL geometry provider.

FreeformHolder(XElement, string, string, IProgress<IMessage>)

Initializes a new instance of the FreeformHolder class from XML data.

public FreeformHolder(XElement src, string baseDirectory, string relFile, IProgress<IMessage> progress)

Parameters

src XElement

The XML element containing holder data

baseDirectory string

Base directory path for resolving relative paths

relFile string

Relative file path

progress IProgress<IMessage>

Progress reporter for diagnostic messages emitted during construction.

Fields

XName

XML Name.

public static string XName

Field Value

string

Properties

AbstractNote

Gets a descriptive note or abstract about the object.

public string AbstractNote { get; }

Property Value

string

CollidableName

Gets the name of the collidable object.

public string CollidableName { get; }

Property Value

string

CutterMount

Gets the tail mount (tool mount) anchor point

public Anchor CutterMount { get; }

Property Value

Anchor

Geom

Gets or sets the holder geometry. Internal Use Only.

public IStlSource Geom { get; set; }

Property Value

IStlSource

Remarks

Delegates to Geom of Hi.NcMech.Holders.FreeformHolder.Solid (the same seam as Cylindroid), so the collidee and the display body always tessellate the geometry assigned here; a detached property would leave the solid on the empty geometry it was born with. Call UpdateByGeom() to keep state of Hi.NcMech.Holders.FreeformHolder.Solid if content modified in place.

GeomAnchor

Gets the geometry anchor point

public Anchor GeomAnchor { get; }

Property Value

Anchor

GeomAnchorToSpindleMountBranch

Gets the branch from GeomAnchor to SpindleMount.

public Branch GeomAnchorToSpindleMountBranch { get; }

Property Value

Branch

GeomToCutterBranch

Gets the branch from GeomAnchor to CutterMount.

public Branch GeomToCutterBranch { get; }

Property Value

Branch

GeomToCutterTransformer

Gets or sets the transformer from geometry to tail (Cutter).

public ITransformer GeomToCutterTransformer { get; set; }

Property Value

ITransformer

GeomToSpindleTransformer

Gets or sets the transformer from geometry to base (Spindle)

public ITransformer GeomToSpindleTransformer { get; set; }

Property Value

ITransformer

Name

Gets or sets the name of the object.

public string Name { get; set; }

Property Value

string

Note

Gets or sets the descriptive note for the object.

public string Note { get; set; }

Property Value

string

PolarResolution2d

Gets or sets the polar resolution 2D settings. Authored data. The resolution is part of a Solid's identity, so assigning this property swaps the holder's solid for one born with the new value (the old solid is disposed).

public PolarResolution2d PolarResolution2d { get; set; }

Property Value

PolarResolution2d

SpindleMount

Gets the base mount (spindle mount) anchor point

public Anchor SpindleMount { get; }

Property Value

Anchor

Methods

ClearCache()

Clears any cached data held by the implementing object.

public void ClearCache()

Display(Bind)

Display function called in DispEngine rendering loop.

public void Display(Bind bind)

Parameters

bind Bind

Bind with DispEngine. See Bind.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Duplicate(params object[])

Creates a deep copy of the object, excluding any source file references.

public object Duplicate(params object[] res)

Parameters

res object[]

Optional parameters that may be needed during the duplication process

Returns

object

A new instance that is a deep copy of the original object

ExpandToBox3d(ref box3d_t)

Expands the destination box. This function is usually used to compute the bounding box of elements. box3d_t is a value type, so the destination is passed by reference (the C++ expand_to_box3d(box3&) shape); an implementation writes dst = dst.Expanded(...) or forwards ref dst to its parts.

public void ExpandToBox3d(ref box3d_t dst)

Parameters

dst box3d_t

Destination box, expanded in place

GetAnchor()

Get key anchor. (i.e. root anchor)

public Anchor GetAnchor()

Returns

Anchor

key anchor

GetAnchoredCollidableNode()

Gets the anchored collidable node associated with this object.

public IAnchoredCollidableNode GetAnchoredCollidableNode()

Returns

IAnchoredCollidableNode

The anchored collidable node.

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.

GetCollidable()

public ICollidable GetCollidable()

Returns

ICollidable

The collidable object.

GetCollidableAnchor()

Gets the anchor associated with the collidable object.

public Anchor GetCollidableAnchor()

Returns

Anchor

The Anchor instance.

GetCollidee()

Get ICollidee.

public ICollidee GetCollidee()

Returns

ICollidee

ICollidee

GetFletchMount()

Get fletch mount anchor. the anchor that generally connect to fixed part such as ground and triggering(motor)-side.

public Anchor GetFletchMount()

Returns

Anchor

mount anchor

GetSolid()

Gets the solid geometry object.

public Solid GetSolid()

Returns

Solid

The solid geometry object.

GetTailMount()

Gets the cutter mount anchor, generally located on the free-end side.

public Anchor GetTailMount()

Returns

Anchor

MakeXmlSource(string, string, bool)

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, bool exhibitionOnly)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if true, the extended file creation is suppressed.

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.

Reg(XFactory)

Registers this type's deserializer with the given XFactory (or Default when factory is null). Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory

UpdateByGeom()

Call the function if the Geom content changed.

public void UpdateByGeom()