refactor(Hi.Sample)!: Box3d, Tri3d, DVec3d and Box2d are named box3d_t, tri3d_t, dvec3d_t and box2d_t -- the C++ typedef names, following HiGeom; the Hi.Native vec3d/tri3d/box3d mirrors are the Hi.Geom values now and vec3f is Hi.Geom.vec3f_t (a word-boundary identifier rename; compound names, string literals and the wire kind names are untouched)

BREAKING CHANGE: source that names these types must use the _t names; the Hi.Native mirrors are gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 13:54:35 +08:00
co-authored by Claude Fable 5.1
parent 7d79db5685
commit 1b834cff0d
14 changed files with 33 additions and 33 deletions
+4 -4
View File
@@ -20,16 +20,16 @@ namespace Sample.Disp
public void Display(Bind bind)
{
bind.Rgb = ColorUtil.GetDiscreteRGB_Env();
new Box3d(0, 0, 0, 1, 1, 1).ToDraw_Face().Display(bind);
new box3d_t(0, 0, 0, 1, 1, 1).ToDraw_Face().Display(bind);
bind.Rgb = ColorUtil.GetDiscreteRGB_Env();
new Box3d(1, 0, 0, 2, 1, 1).ToDraw_Face().Display(bind);
new box3d_t(1, 0, 0, 2, 1, 1).ToDraw_Face().Display(bind);
bind.Rgb = ColorUtil.GetDiscreteRGB_Env();
new Box3d(2, 0, 0, 3, 1, 1).ToDraw_Face().Display(bind);
new box3d_t(2, 0, 0, 3, 1, 1).ToDraw_Face().Display(bind);
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
dst = dst.Expanded(new vec3d_t(0, 0, 0));
dst = dst.Expanded(new vec3d_t(3, 1, 1));
+5 -5
View File
@@ -126,7 +126,7 @@ namespace Sample.Disp
{
//the rgb values set as casual.
vec3d_t rgb = ColorUtil.GetDiscreteRgb(i);
Tri3d tri = new Tri3d(new vec3d_t(i, 0, 0), new vec3d_t(i + 1, 0, 0), new vec3d_t(i + 0.5, 0, 1));
tri3d_t tri = new tri3d_t(new vec3d_t(i, 0, 0), new vec3d_t(i + 1, 0, 0), new vec3d_t(i + 0.5, 0, 1));
for (int j = 0; j < 3; j++)
{
vs[k++] = rgb.x;
@@ -147,7 +147,7 @@ namespace Sample.Disp
{
//the rgb values set as casual.
vec3d_t rgb = ColorUtil.GetDiscreteRgb(i);
Tri3d tri = new Tri3d(new vec3d_t(i, 0, 3), new vec3d_t(i + 1, 0, 3), new vec3d_t(i + 0.5, 0, 4));
tri3d_t tri = new tri3d_t(new vec3d_t(i, 0, 3), new vec3d_t(i + 1, 0, 3), new vec3d_t(i + 0.5, 0, 4));
vec3d_t nn = tri.GetNormal();
for (int j = 0; j < 3; j++)
{
@@ -171,16 +171,16 @@ namespace Sample.Disp
}
/// <summary>
/// Demonstrates drawing 3D triangles using the Tri3d helper class.
/// Demonstrates drawing 3D triangles using the tri3d_t helper class.
/// Creates a series of triangles and renders them as both face (filled) and line (wireframe) drawings.
/// Shows how to apply different colors to faces and lines of the same geometry.
/// </summary>
public static void DrawTri3d()
{
int n = 10;
List<Tri3d> tris = new List<Tri3d>(n);
List<tri3d_t> tris = new List<tri3d_t>(n);
for (int i = 0; i < n; i++)
tris.Add(new Tri3d(new vec3d_t(i, 0, 0), new vec3d_t(i + 1, 0, 0), new vec3d_t(i + 0.5, 0, 1)));
tris.Add(new tri3d_t(new vec3d_t(i, 0, 0), new vec3d_t(i + 1, 0, 0), new vec3d_t(i + 0.5, 0, 1)));
Drawing faceDraw = tris.GetFaceDrawing();
Drawing linesDraw = tris.ToLineDrawing();
+2 -2
View File
@@ -21,11 +21,11 @@ namespace Sample.Disp
{
bind.PickID = PickingID;
bind.Rgb = new vec3d_t(isMouseOver ? 0 : 1, 1, 1);
new Box3d(0, 0, 0, 1, 1, 1).DisplayFace(bind);
new box3d_t(0, 0, 0, 1, 1, 1).DisplayFace(bind);
bind.PickID = 0;
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
dst = dst.Expanded(new vec3d_t(0, 0, 0));
dst = dst.Expanded(new vec3d_t(1, 1, 1));
+4 -4
View File
@@ -24,20 +24,20 @@ namespace Sample.Disp
{
bind.PickID = pickableA.PickingID;
bind.Rgb = ColorUtil.GetDiscreteRgb(1);
new Box3d(0, 0, 0, 1, 1, 1).DisplayFace(bind);
new box3d_t(0, 0, 0, 1, 1, 1).DisplayFace(bind);
bind.PickID = pickableB.PickingID;
bind.Rgb = ColorUtil.GetDiscreteRgb(2);
new Box3d(0, 0, 1, 1, 1, 2).DisplayFace(bind);
new box3d_t(0, 0, 1, 1, 1, 2).DisplayFace(bind);
bind.PickID = pickableC.PickingID;
bind.Rgb = ColorUtil.GetDiscreteRgb(3);
new Box3d(0, 0, 2, 1, 1, 3).DisplayFace(bind);
new box3d_t(0, 0, 2, 1, 1, 3).DisplayFace(bind);
bind.PickID = 0;
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
dst = dst.Expanded(new vec3d_t(0, 0, 0));
dst = dst.Expanded(new vec3d_t(1, 1, 3));
+1 -1
View File
@@ -40,7 +40,7 @@ public class DemoPickable : IDisplayee
draw.Display(bind);
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
draw.ExpandToBox3d(ref dst);
}
+4 -4
View File
@@ -21,9 +21,9 @@ namespace Sample.Disp
double angle_moon;
DemoSatellite()
{
sun = Box3d.CenterUnitBox.ScaledFromCenter(4).ToDraw_Face();
earth = Box3d.CenterUnitBox.ScaledFromCenter(2).ToDraw_Face();
moon = Box3d.CenterUnitBox.ToDraw_Face();
sun = box3d_t.CenterUnitBox.ScaledFromCenter(4).ToDraw_Face();
earth = box3d_t.CenterUnitBox.ScaledFromCenter(2).ToDraw_Face();
moon = box3d_t.CenterUnitBox.ToDraw_Face();
}
/// <inheritdoc/>
public void Display(Bind bind)
@@ -41,7 +41,7 @@ namespace Sample.Disp
bind.ModelMatStack.Pop();
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
dst = dst.Expanded(new vec3d_t(-14, -14, -2));
dst = dst.Expanded(new vec3d_t(14, 14, 2));
+1 -1
View File
@@ -32,7 +32,7 @@ public static class DemoUtil
LocalApp.AppBegin(loggerFactory.CreateLogger("Hi.Sample"));
try
{
Box3d box = new Box3d();
box3d_t box = new box3d_t();
displayee.ExpandToBox3d(ref box);
Console.WriteLine($"{title}: {displayee.GetType().Name} bounding {box}");
Console.WriteLine("Assign it to your canvas' DispEngine.Displayee to see it.");
+1 -1
View File
@@ -90,7 +90,7 @@ namespace Sample.Disp
bind.ModelMatStack.Pop();
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
HardNcEnv ncEnv = NcEnv;
if (ncEnv == null || NcEnv.CncBrand != CncBrand.Heidenhain)
+1 -1
View File
@@ -59,7 +59,7 @@ public class IsoCoordinateEntryDisplayee : IAnchoredDisplayee
bind.ModelMatStack.Pop();
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
HardNcEnv ncEnv = NcEnv;
if (ncEnv == null)
+1 -1
View File
@@ -239,7 +239,7 @@ public class MachiningProjectDisplayee : IDisplayee, IGetAnchor
bind.PopColor();
}
/// <inheritdoc/>
public void ExpandToBox3d(ref Box3d dst)
public void ExpandToBox3d(ref box3d_t dst)
{
//Console.WriteLine($"dst.A: {dst}");
LocalProjectService?.MachiningEquipment?.GetAsmb()?.ExpandToBox3d(ref dst,