Table of Contents

Class ConstructionDefectDisplayee

Namespace
Hi.Cbtr
Assembly
HiCbtr.dll

Encapsulates cube tree construction defect results, including both defect data and visualization drawings.

The drawings are made by Display(Bind), where a GL context is current, never by the constructor, which runs on the cube tree's build thread outside any frame: a drawing made there while no other context lives is stale the moment it is returned (the context made for it is the only one of its share group, and the group dies with it), and a large one, such as the outline of more than 113 boxes, keeps the process's anchor context alive although no canvas was ever opened.

public class ConstructionDefectDisplayee : IDisplayee, IExpandToBox3d, IDisposable
Inheritance
ConstructionDefectDisplayee
Implements
Inherited Members
Extension Methods

Remarks

The box outline is a rebuildable drawing: it keeps no copy of its data, is not resident, and draws nothing once its share group died, so a display that finds it missing, or made under another ShareGroupGeneration, makes it again from the boxes. The per-triangle outlines are small drawings that keep a copy of their data and upload it again under a new group by themselves; the first display makes them, once. The boxes and the pickables are taken by the constructor and never again.

Display(Bind) and Dispose() may run on different threads. A display makes and takes what it draws, the picking ids included, under the gate the dispose takes, and draws outside it; a display after the dispose draws nothing and makes nothing.

Constructors

ConstructionDefectDisplayee(List<DefectNodeInfo>, IProgress<IMessage>)

Ctor. Takes the boxes of the first DefectNodesToShow nodes and makes their pickables; makes no drawing (the class note).

public ConstructionDefectDisplayee(List<CubeTree.DefectNodeInfo> defectNodeInfos, IProgress<IMessage> messageProgress = null)

Parameters

defectNodeInfos List<CubeTree.DefectNodeInfo>

Defect node infos from cube tree construction.

messageProgress IProgress<IMessage>

Progress reporter for user-facing messages.

Fields

DefaultDefectNodesToShow

Default of DefectNodesToShow; also how many per-node warnings WorkpieceService streams while the build is still running.

public const int DefaultDefectNodesToShow = 200

Field Value

int

Properties

DefectNodeInfos

Defect node infos collected during cube tree construction.

public List<CubeTree.DefectNodeInfo> DefectNodeInfos { get; }

Property Value

List<CubeTree.DefectNodeInfo>

DefectNodesToShow

Maximum number of defect nodes to show.

public int DefectNodesToShow { get; set; }

Property Value

int

HasDefects

Whether any defects were found.

public bool HasDefects { get; }

Property Value

bool

Methods

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(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

GetFittingView(box3d_t, mat4d_t)

Gets a fitting view matrix for a defect box, preserving the current view rotation.

public static mat4d_t GetFittingView(box3d_t defectBox, mat4d_t sketchView)

Parameters

defectBox box3d_t

The defect box to fit.

sketchView mat4d_t

The current sketch view matrix.

Returns

mat4d_t

A view matrix that fits the defect box, or the original sketch view if inputs are invalid.

Events

DefectBoxSelected

Fired when a defect box flag is selected (clicked). The parameter is the box3d_t of the selected defect box.

public event Action<box3d_t> DefectBoxSelected

Event Type

Action<box3d_t>