Archived
deploy webservice static-file routing for docsite folder URLs, per-instance step-cache db, and constant-height panel title bars.
This commit is contained in:
@@ -111,93 +111,92 @@ using Hi.NcMech.Holders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Hi.Milling.MillingTools
|
||||
namespace Hi.Milling.MillingTools;
|
||||
|
||||
/// <summary>
|
||||
/// Display host for a milling tool composed of a cutter and a holder.
|
||||
/// </summary>
|
||||
public class MillingToolEditorDisplayee : ITopoDisplayee, IClearCache
|
||||
{
|
||||
/// <summary>
|
||||
/// Display host for a milling tool composed of a cutter and a holder.
|
||||
/// Gets or sets the delegate that provides the <see cref="MillingTool"/> instance.
|
||||
/// </summary>
|
||||
public class MillingToolEditorDisplayee : ITopoDisplayee, IClearCache
|
||||
public Func<MillingTool> MillingToolGetter { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="MillingTool"/> instance.
|
||||
/// </summary>
|
||||
public MillingTool MillingTool => MillingToolGetter?.Invoke();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether to show the cutter.
|
||||
/// </summary>
|
||||
public bool ShowCutter { get; set; } = true;
|
||||
/// <summary>
|
||||
/// Gets or sets whether to show the holder.
|
||||
/// </summary>
|
||||
public bool ShowHolder { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the displayee for the milling cutter.
|
||||
/// </summary>
|
||||
public MillingCutterEditorDisplayee MillingCutterEditorDisplayee { get; }
|
||||
= new MillingCutterEditorDisplayee();
|
||||
/// <summary>
|
||||
/// Gets the displayee for the holder.
|
||||
/// </summary>
|
||||
public HolderEditorDisplayee HolderEditorDisplayee { get; }
|
||||
= new HolderEditorDisplayee();
|
||||
/// <inheritdoc/>
|
||||
public List<IAnchoredDisplayee> GetAnchoredDisplayeeList()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the delegate that provides the <see cref="MillingTool"/> instance.
|
||||
/// </summary>
|
||||
public Func<MillingTool> MillingToolGetter { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="MillingTool"/> instance.
|
||||
/// </summary>
|
||||
public MillingTool MillingTool => MillingToolGetter?.Invoke();
|
||||
var dst = new List<IAnchoredDisplayee>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether to show the cutter.
|
||||
/// </summary>
|
||||
public bool ShowCutter { get; set; } = true;
|
||||
/// <summary>
|
||||
/// Gets or sets whether to show the holder.
|
||||
/// </summary>
|
||||
public bool ShowHolder { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the displayee for the milling cutter.
|
||||
/// </summary>
|
||||
public MillingCutterEditorDisplayee MillingCutterEditorDisplayee { get; }
|
||||
= new MillingCutterEditorDisplayee();
|
||||
/// <summary>
|
||||
/// Gets the displayee for the holder.
|
||||
/// </summary>
|
||||
public HolderEditorDisplayee HolderEditorDisplayee { get; }
|
||||
= new HolderEditorDisplayee();
|
||||
/// <inheritdoc/>
|
||||
public List<IAnchoredDisplayee> GetAnchoredDisplayeeList()
|
||||
{
|
||||
var dst = new List<IAnchoredDisplayee>();
|
||||
|
||||
var millingTool = MillingTool;
|
||||
if (millingTool == null)
|
||||
return dst;
|
||||
|
||||
if (ShowCutter)
|
||||
{
|
||||
var cutter = millingTool.Cutter;
|
||||
if (cutter is MillingCutter millingCutter)
|
||||
{
|
||||
//MessageKit.AddMessage($"MillingTool.Cutter: {MillingTool?.Cutter?.GetHashCode()}");
|
||||
MillingCutterEditorDisplayee.MillingCutterSourceFunc
|
||||
= () => MillingTool?.Cutter as MillingCutter;
|
||||
dst.Add(MillingCutterEditorDisplayee);
|
||||
}
|
||||
else if(cutter!=null)
|
||||
dst.Add(cutter);
|
||||
}
|
||||
if (ShowHolder)
|
||||
{
|
||||
HolderEditorDisplayee.Holder = millingTool.Holder;
|
||||
dst.Add(HolderEditorDisplayee);
|
||||
}
|
||||
var millingTool = MillingTool;
|
||||
if (millingTool == null)
|
||||
return dst;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void Display(Bind bind)
|
||||
{
|
||||
bind.PushCoveringPixelMode();
|
||||
DimensionBar.Display(bind, "mm");
|
||||
bind.ModelMatStack.Pop();
|
||||
|
||||
TopoDisplayeeUtil.Display(this, bind);
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void ExpandToBox3d(Box3d dst)
|
||||
if (ShowCutter)
|
||||
{
|
||||
TopoDisplayeeUtil.ExpandToBox3d(this, dst);
|
||||
var cutter = millingTool.Cutter;
|
||||
if (cutter is MillingCutter millingCutter)
|
||||
{
|
||||
//MessageKit.AddMessage($"MillingTool.Cutter: {MillingTool?.Cutter?.GetHashCode()}");
|
||||
MillingCutterEditorDisplayee.MillingCutterSourceFunc
|
||||
= () => MillingTool?.Cutter as MillingCutter;
|
||||
dst.Add(MillingCutterEditorDisplayee);
|
||||
}
|
||||
else if(cutter!=null)
|
||||
dst.Add(cutter);
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public Asmb GetAsmb() => MillingTool?.Asmb;
|
||||
/// <inheritdoc/>
|
||||
public Anchor GetAnchor() => MillingTool?.GetAnchor();
|
||||
/// <inheritdoc/>
|
||||
public void ClearCache()
|
||||
if (ShowHolder)
|
||||
{
|
||||
MillingCutterEditorDisplayee?.ClearCache();
|
||||
HolderEditorDisplayee.Holder = millingTool.Holder;
|
||||
dst.Add(HolderEditorDisplayee);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void Display(Bind bind)
|
||||
{
|
||||
bind.PushCoveringPixelMode();
|
||||
DimensionBar.Display(bind, "mm");
|
||||
bind.ModelMatStack.Pop();
|
||||
|
||||
TopoDisplayeeUtil.Display(this, bind);
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void ExpandToBox3d(Box3d dst)
|
||||
{
|
||||
TopoDisplayeeUtil.ExpandToBox3d(this, dst);
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public Asmb GetAsmb() => MillingTool?.Asmb;
|
||||
/// <inheritdoc/>
|
||||
public Anchor GetAnchor() => MillingTool?.GetAnchor();
|
||||
/// <inheritdoc/>
|
||||
public void ClearCache()
|
||||
{
|
||||
MillingCutterEditorDisplayee?.ClearCache();
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
Reference in New Issue
Block a user