|
|
|
|
@ -1066,7 +1066,7 @@ public class ViewportHelperPro |
|
|
|
|
if (valKey.IsNullOrEmpty()) |
|
|
|
|
{ |
|
|
|
|
//显示两个值 |
|
|
|
|
var param = new List<string> { "CROWN_ANGLE", "CROWN_HEIGHT" }; |
|
|
|
|
var param = GetAlgorithmParam(step, selFacetType); |
|
|
|
|
|
|
|
|
|
StringBuilder sbShowText = new StringBuilder(); |
|
|
|
|
foreach (var p in param) |
|
|
|
|
@ -1080,7 +1080,7 @@ public class ViewportHelperPro |
|
|
|
|
|
|
|
|
|
sbShowText.Append($" {facetIndex}"); |
|
|
|
|
result.Add(DisplayText3D(sbShowText.ToString(), |
|
|
|
|
new Vector3(facetTextPoint.X, facetTextPoint.Y - 0.4f, facetTextPoint.Z))); |
|
|
|
|
new Vector3(facetTextPoint.X, facetTextPoint.Y + DisplacementCalculations(selFacetType), facetTextPoint.Z))); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
@ -2450,7 +2450,7 @@ public class ViewportHelperPro |
|
|
|
|
private static bool FactoryShowTextCheck(string diamondType, PlaneType planeType) |
|
|
|
|
{ |
|
|
|
|
Dictionary<string, HashSet<PlaneType>> stepPlaneMappings = new() |
|
|
|
|
{ |
|
|
|
|
{ |
|
|
|
|
["S1"] = new() { PlaneType.CrownIncomplete }, |
|
|
|
|
["S2"] = new() { PlaneType.CrownIncomplete, PlaneType.StarFacet }, |
|
|
|
|
["S3"] = new() { PlaneType.CrownIncomplete, PlaneType.StarFacet }, |
|
|
|
|
@ -2459,7 +2459,7 @@ public class ViewportHelperPro |
|
|
|
|
["S6"] = new() { PlaneType.PavilionIncomplete }, |
|
|
|
|
["S7"] = new() { PlaneType.PavilionIncomplete, PlaneType.CrownIncomplete }, |
|
|
|
|
["S8"] = new() { PlaneType.PavilionIncomplete, PlaneType.CrownIncomplete } |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
var endType = diamondType.Split(' ').LastOrDefault(); |
|
|
|
|
if (string.IsNullOrEmpty(endType) || !stepPlaneMappings.TryGetValue(endType, out var allowedTypes)) |
|
|
|
|
{ |
|
|
|
|
@ -2467,5 +2467,69 @@ public class ViewportHelperPro |
|
|
|
|
} |
|
|
|
|
return allowedTypes.Contains(planeType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static string[] GetAlgorithmParam(string diamondType, PlaneType planeType) |
|
|
|
|
{ |
|
|
|
|
Dictionary<string, Dictionary<PlaneType, string[]>> stepPlaneMappings = new() |
|
|
|
|
{ |
|
|
|
|
["S1"] = new (){[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"]}, |
|
|
|
|
["S2"] = new() { |
|
|
|
|
[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"], |
|
|
|
|
[PlaneType.StarFacet] = ["STAR_ANGLE","STAR"] |
|
|
|
|
}, |
|
|
|
|
["S3"] = new() |
|
|
|
|
{ |
|
|
|
|
[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"], |
|
|
|
|
[PlaneType.UpperGirdleFacet] = ["UPPER_HALF_ANGLE"] |
|
|
|
|
}, |
|
|
|
|
["S4"] = new() |
|
|
|
|
{ |
|
|
|
|
[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"] |
|
|
|
|
}, |
|
|
|
|
["S5"] = new() |
|
|
|
|
{ |
|
|
|
|
[PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"] |
|
|
|
|
}, |
|
|
|
|
["S6"] = new() |
|
|
|
|
{ |
|
|
|
|
[PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"] |
|
|
|
|
}, |
|
|
|
|
["S7"] = new() |
|
|
|
|
{ |
|
|
|
|
[PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"], |
|
|
|
|
[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"] |
|
|
|
|
}, |
|
|
|
|
["S8"] = new() |
|
|
|
|
{ |
|
|
|
|
[PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"], |
|
|
|
|
[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"] |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
if (stepPlaneMappings.ContainsKey(diamondType) ) |
|
|
|
|
{ |
|
|
|
|
var pts = stepPlaneMappings[diamondType]; |
|
|
|
|
if (pts.ContainsKey(planeType)) |
|
|
|
|
{ |
|
|
|
|
return pts[planeType]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static float DisplacementCalculations(PlaneType planeType, float vol = 0.4f) |
|
|
|
|
{ |
|
|
|
|
switch (planeType) |
|
|
|
|
{ |
|
|
|
|
case PlaneType.StarFacet: |
|
|
|
|
case PlaneType.CrownIncomplete: |
|
|
|
|
case PlaneType.UpperGirdleFacet: |
|
|
|
|
case PlaneType.UpperMainFacet: |
|
|
|
|
case PlaneType.Crown: |
|
|
|
|
return vol * -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return vol * 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|