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
workpieceWorkpieceworkpiece data model.
Properties
BottomResolution
Resolution.
public double BottomResolution { get; }
Property Value
CollidableName
Gets the name of the collidable object.
public string CollidableName { get; }
Property Value
CollisionFlag
Gets or sets the collision flag.
public CollisionFlag CollisionFlag { get; set; }
Property Value
ConstructionDefectDisplayee
Construction defect displayee.
public ConstructionDefectDisplayee ConstructionDefectDisplayee { get; }
Property Value
DiffAttachmentBag
transient object. For Internal Use.
public ConcurrentBag<DiffAttachment> DiffAttachmentBag { get; set; }
Property Value
DiffRangeColorRule
Internal used.
public RangeColorRule DiffRangeColorRule { get; set; }
Property Value
DiffVisualRadius_mm
Visual radius for difference visualization.
public double DiffVisualRadius_mm { get; set; }
Property Value
HasDiff
Indicates whether there are differences between ideal and actual geometry.
public bool HasDiff { get; }
Property Value
IdealGeom
Delegate property for IdealGeom with cache cleanup.
public IGetStl IdealGeom { get; set; }
Property Value
IdealSolid
Gets the drawing representing the ideal geometry faces of the workpiece. The derived solid from IdealGeom.
public Solid IdealSolid { get; }
Property Value
InitGeom
Delegate property for InitGeom with runtime cleanup.
public IMakeXmlSource InitGeom { get; set; }
Property Value
InitSolid
The derived solid from InitGeom.
public Solid InitSolid { get; }
Property Value
IsRuntimeGeomInit
Indicates whether the runtime geometry is initialized.
public bool IsRuntimeGeomInit { get; }
Property Value
Workpiece
The underlying workpiece data model.
public Workpiece Workpiece { get; set; }
Property Value
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
detectionRadiusdoubleDetection radius.
tokenCancellationTokenCancellation token.
progressIProgress<object>Progress reporting interface.
Display(Bind)
Display function called in DispEngine rendering loop.
public void Display(Bind bind)
Parameters
bindBindBind 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
disposingbool
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
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
GetRuntimeGeom(CancellationToken, IProgress<object>)
Gets the runtime geometry.
public CubeTree GetRuntimeGeom(CancellationToken token, IProgress<object> progress = null)
Parameters
tokenCancellationTokenCancellation token.
progressIProgress<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
filestringSource file path.
ResetRuntimeGeom(ClStrip)
Resets the runtime geometry.
public void ResetRuntimeGeom(ClStrip clStrip)
Parameters
clStripClStripCutter location strip.
ScanRuntimeGeomInfDefect(IProgress<object>, CancellationToken)
Scans the runtime geometry for inf defects.
public bool? ScanRuntimeGeomInfDefect(IProgress<object> messageHost, CancellationToken cancellationToken)
Parameters
messageHostIProgress<object>cancellationTokenCancellationToken
Returns
- bool?
SetRuntimeGeom(CubeTree)
Sets the runtime geometry instance and rebuilds its attachments.
public void SetRuntimeGeom(CubeTree runtimeGeom_)
Parameters
runtimeGeom_CubeTreeThe 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
filestringTarget file path.
tokenCancellationTokenCancellation token.
progressIProgress<object>Progress reporting interface.