Class ClStrip
- Namespace
- Hi.CutterLocations.ClStrips
- Assembly
- HiMech.dll
Represents a CL (Cutter Location) strip for 3D display. This class manages the display and interaction of cutter location points and lines.
public class ClStrip : IDisplayee, IExpandToBox3d, IDisposable
- Inheritance
-
ClStrip
- Implements
- Inherited Members
- Extension Methods
Constructors
ClStrip(int)
Initializes a new instance of the ClStrip class.
public ClStrip(int cap = 2048)
Parameters
cap
intThe initial capacity of the strip
Fields
slice_distance
The distance between slices for efficient rendering.
public const int slice_distance = 8192
Field Value
Properties
AbsDispEnd
Gets the absolute display end position. If the display end is set to -1, returns the total number of positions.
public int AbsDispEnd { get; }
Property Value
CallRefreshDrawing
internal use
public bool CallRefreshDrawing { get; }
Property Value
IsShowDot
Gets or sets whether to display dots at each position.
public bool IsShowDot { get; set; }
Property Value
StripPoses
Gets the list of strip positions. Do not add or remove elements directly.
public SynList<ClStripPos> StripPoses { get; }
Property Value
StripPosesClearLock
Gets the lock for thread-safe operations on strip positions.
public ReaderWriterLockSlim StripPosesClearLock { get; }
Property Value
StripPosesCount
Gets the thread-safe count of strip positions.
public int StripPosesCount { get; }
Property Value
Methods
Add(object, DVec3d)
Adds a new position to the strip.
public ClStripPos Add(object state, DVec3d programCl)
Parameters
Returns
- ClStripPos
The newly created strip position
Clear(object)
Clears all strip positions and resets the display state.
public void Clear(object sender)
Parameters
sender
objectThe object that initiated this clear operation
Display(Bind)
Displays the strip.
public void Display(Bind bind)
Parameters
bind
BindThe binding context for display
Dispose()
Disposes of the resources used by this strip.
public void Dispose()
Dispose(bool)
Disposes of the resources used by this strip.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolWhether this is being called from Dispose
ExpandToBox3d(Box3d)
Expands the given box to include all strip positions.
public void ExpandToBox3d(Box3d dst)
Parameters
dst
Box3dThe box to expand
GetDispBegin()
Gets the current display begin position.
public int GetDispBegin()
Returns
- int
The display begin position
GetDispEnd()
Gets the current display end position. A value of -1 indicates that the display should follow the end of the strip.
public int GetDispEnd()
Returns
- int
The display end position
GetEnteredPos()
Gets the currently entered position.
public ClStripPos GetEnteredPos()
Returns
- ClStripPos
The entered position
GetScaledFittingViewByStripDispRange(Mat4d, Mat4d)
Gets a scaled fitting view based on the strip display range.
public Mat4d GetScaledFittingViewByStripDispRange(Mat4d sketchView, Mat4d clStripZeroToRoot = null)
Parameters
sketchView
Mat4dThe sketch view matrix
clStripZeroToRoot
Mat4dThe transformation from strip zero to root
Returns
- Mat4d
The scaled fitting view matrix
GetSelectedPos()
Gets the currently selected position.
public ClStripPos GetSelectedPos()
Returns
- ClStripPos
The selected position
GetStripPos(int, bool)
Gets a strip position by index.
public ClStripPos GetStripPos(int index, bool isLocked = false)
Parameters
Returns
- ClStripPos
The strip position at the specified index
RefreshDrawing()
Marks the drawing for refresh.
public void RefreshDrawing()
RefreshDrawingInRendering(bool)
internal use
public void RefreshDrawingInRendering(bool isLocked)
Parameters
isLocked
bool
SetDispBegin(int, object)
Sets the display begin position.
public void SetDispBegin(int value, object caller)
Parameters
SetDispEnd(int, object)
Sets the display end position. A value of -1 indicates that the display should follow the end of the strip.
public void SetDispEnd(int value, object caller)
Parameters
SetEnteredPos(ClStripPos, object)
Sets the currently entered position.
public void SetEnteredPos(ClStripPos value, object sender)
Parameters
value
ClStripPosThe new entered position
sender
objectThe object that initiated this change
SetSelectedPos(ClStripPos, object)
Sets the currently selected position.
public void SetSelectedPos(ClStripPos value, object sender)
Parameters
value
ClStripPosThe new selected position
sender
objectThe object that initiated this change
ShrinkAttachmentMemory()
Shrinks the attachment memory for all positions.
public void ShrinkAttachmentMemory()
StripPosesThreadSafeSelect<T>(Func<ClStripPos, T>)
Thread-safe selection of strip positions.
public List<T> StripPosesThreadSafeSelect<T>(Func<ClStripPos, T> func)
Parameters
func
Func<ClStripPos, T>The function to transform each strip position
Returns
- List<T>
A list of transformed strip positions
Type Parameters
T
The type of the selected data
Events
AbsDispEndChanged
Event raised when the absolute display end position changes.
public event EventHandler AbsDispEndChanged
Event Type
DispBeginChanged
Event raised when the display begin position changes.
public event EventHandler DispBeginChanged
Event Type
DispEndChanged
Event raised when the display end position changes.
public event EventHandler DispEndChanged
Event Type
DrawingRefreshing
Event raised when the drawing is being refreshed.
public event EventHandler DrawingRefreshing
Event Type
PosAdded
Event raised when a new position is added to the strip.
public event Action<ClStripPos> PosAdded
Event Type
PosEntered
Event raised when the mouse enters a position.
public event EventHandler<ClStripPos> PosEntered
Event Type
PosSelected
Event raised when a position is selected.
public event EventHandler<ClStripPos> PosSelected
Event Type
StaticPosSelected
Static event raised when any position is selected.
public static event EventHandler<ClStripPos> StaticPosSelected