Table of Contents

Class WorkpieceService

Namespace
Hi.NcMech.Workpieces
Assembly
HiMech.dll

Runtime service for Workpiece.

public class WorkpieceService : IDisplayee, IExpandToBox3d, IDisposable, IGetAnchoredDisplayeeList, IAnchoredCollidableLeaf, IAnchoredCollidableNode, IAnchoredCollidableBased, ICollidable
Inheritance
WorkpieceService
Implements
Inherited Members
Extension Methods

Remarks

WorkpieceService handles runtime geometry, caching, diff calculation, defect scanning, display and collision — state that does not require configuration IO. Compare to Workpiece, which holds the persistent/serializable configuration.

Constructors

WorkpieceService()

Ctor.

public WorkpieceService()

WorkpieceService(Workpiece)

Ctor.

public WorkpieceService(Workpiece workpiece)

Parameters

workpiece Workpiece

workpiece data model.

Properties

BottomResolution

Resolution.

public double BottomResolution { get; }

Property Value

double

CollidableName

Gets the name of the collidable object.

public string CollidableName { get; }

Property Value

string

CollisionFlag

Gets or sets the collision flag.

public CollisionFlag CollisionFlag { get; set; }

Property Value

CollisionFlag

ConstructionDefectDisplayee

Construction defect displayee.

public ConstructionDefectDisplayee ConstructionDefectDisplayee { get; }

Property Value

ConstructionDefectDisplayee

DiffAttachmentBag

transient object. For Internal Use.

public ConcurrentBag<DiffAttachment> DiffAttachmentBag { get; set; }

Property Value

ConcurrentBag<DiffAttachment>

DiffRangeColorRule

Internal used.

public RangeColorRule DiffRangeColorRule { get; set; }

Property Value

RangeColorRule

DiffVisualRadius_mm

Visual radius for difference visualization.

public double DiffVisualRadius_mm { get; set; }

Property Value

double

HasDiff

Indicates whether there are differences between ideal and actual geometry.

public bool HasDiff { get; }

Property Value

bool

IdealGeom

Delegate property for IdealGeom with cache cleanup.

public IGetStl IdealGeom { get; set; }

Property Value

IGetStl

IdealSolid

Gets the drawing representing the ideal geometry faces of the workpiece. The derived solid from IdealGeom.

public Solid IdealSolid { get; }

Property Value

Solid

InitGeom

Delegate property for InitGeom with runtime cleanup.

public IMakeXmlSource InitGeom { get; set; }

Property Value

IMakeXmlSource

InitSolid

The derived solid from InitGeom.

public Solid InitSolid { get; }

Property Value

Solid

IsRuntimeGeomInit

Indicates whether the runtime geometry is initialized.

public bool IsRuntimeGeomInit { get; }

Property Value

bool

Workpiece

The underlying workpiece data model.

public Workpiece Workpiece { get; set; }

Property Value

Workpiece

Methods

ClearDefectDisplayee()

Clears all defect displayees.

public void ClearDefectDisplayee()

ClearIdealGeomCache()

Clears the ideal geometry cache.

public void ClearIdealGeomCache()

ClearRawGeomCache()

Clears the raw geometry cache.

public void ClearRawGeomCache()

Diff(double, CancellationToken, IProgress<object>)

Calculates the difference between ideal and actual geometry.

public void Diff(double detectionRadius, CancellationToken token, IProgress<object> progress = null)

Parameters

detectionRadius double

Detection radius.

token CancellationToken

Cancellation token.

progress IProgress<object>

Progress reporting interface.

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

ExpandToBox3d(Box3d)

Expands the destination box. This function is usually used to compute the bounding box of elements.

public void ExpandToBox3d(Box3d dst)

Parameters

dst Box3d

Destination box

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

GetCollidableAnchor()

Gets the anchor associated with this collidable leaf.

public Anchor GetCollidableAnchor()

Returns

Anchor

The anchor for this collidable leaf.

GetCollidee()

Get ICollidee.

public ICollidee GetCollidee()

Returns

ICollidee

ICollidee

GetRuntimeGeom(CancellationToken, IProgress<object>)

Gets the runtime geometry.

public CubeTree GetRuntimeGeom(CancellationToken token, IProgress<object> progress = null)

Parameters

token CancellationToken

Cancellation token.

progress IProgress<object>

Progress reporting interface.

Returns

CubeTree

Cube tree representing the runtime geometry.

ReadRuntimeGeom(string)

Reads the runtime geometry from a file.

public void ReadRuntimeGeom(string file)

Parameters

file string

Source file path.

ResetRuntimeGeom(ClStrip)

Resets the runtime geometry.

public void ResetRuntimeGeom(ClStrip clStrip)

Parameters

clStrip ClStrip

Cutter location strip.

ScanRuntimeGeomInfDefect(IProgress<object>, CancellationToken)

Scans the runtime geometry for inf defects.

public bool? ScanRuntimeGeomInfDefect(IProgress<object> messageHost, CancellationToken cancellationToken)

Parameters

messageHost IProgress<object>
cancellationToken CancellationToken

Returns

bool?

SetRuntimeGeom(CubeTree)

Sets the runtime geometry instance and rebuilds its attachments.

public void SetRuntimeGeom(CubeTree runtimeGeom_)

Parameters

runtimeGeom_ CubeTree

The runtime cube tree geometry.

WriteRuntimeGeom(string, CancellationToken, IProgress<object>)

Writes the runtime geometry to a file.

public void WriteRuntimeGeom(string file, CancellationToken token, IProgress<object> progress = null)

Parameters

file string

Target file path.

token CancellationToken

Cancellation token.

progress IProgress<object>

Progress reporting interface.