refactor(Hi.Sample)!: Vec3d and Vec2d are named vec3d_t and vec2d_t -- the C++ typedef names, following HiGeom 43fccaf (a word-boundary identifier rename over the 14 demo files the 09-24 rename batch left behind; the repo builds against the HiGeom project reference, so it had stopped compiling)
BREAKING CHANGE: source that names Hi.Geom.Vec3d or Hi.Geom.Vec2d as the vector type must say vec3d_t / vec2d_t. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -31,8 +31,8 @@ namespace Sample.Disp
|
||||
/// <inheritdoc/>
|
||||
public void ExpandToBox3d(Box3d dst)
|
||||
{
|
||||
dst.Expand(new Vec3d(0, 0, 0));
|
||||
dst.Expand(new Vec3d(3, 1, 1));
|
||||
dst.Expand(new vec3d_t(0, 0, 0));
|
||||
dst.Expand(new vec3d_t(3, 1, 1));
|
||||
}
|
||||
|
||||
static void Main()
|
||||
|
||||
+9
-9
@@ -40,14 +40,14 @@ namespace Sample.Disp
|
||||
/// </summary>
|
||||
public static void DrawLines()
|
||||
{
|
||||
List<Vec3d> ps;
|
||||
List<vec3d_t> ps;
|
||||
double[] vs;
|
||||
int n = 10; //vertex num
|
||||
|
||||
////create drawPoints
|
||||
ps = new List<Vec3d>(n);
|
||||
ps = new List<vec3d_t>(n);
|
||||
for (int i = 0; i < n; i++)
|
||||
ps.Add(new Vec3d(i, 0, 0));
|
||||
ps.Add(new vec3d_t(i, 0, 0));
|
||||
vs = new double[ps.Count * 3];
|
||||
for (int i = 0; i < ps.Count; i++)
|
||||
{
|
||||
@@ -125,8 +125,8 @@ namespace Sample.Disp
|
||||
for (int i = 0, k = 0; i < n; i++)
|
||||
{
|
||||
//the rgb values set as casual.
|
||||
Vec3d rgb = ColorUtil.GetDiscreteRgb(i);
|
||||
Tri3d tri = new Tri3d(new Vec3d(i, 0, 0), new Vec3d(i + 1, 0, 0), new Vec3d(i + 0.5, 0, 1));
|
||||
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));
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
vs[k++] = rgb.x;
|
||||
@@ -146,9 +146,9 @@ namespace Sample.Disp
|
||||
for (int i = 0, k = 0; i < n; i++)
|
||||
{
|
||||
//the rgb values set as casual.
|
||||
Vec3d rgb = ColorUtil.GetDiscreteRgb(i);
|
||||
Tri3d tri = new Tri3d(new Vec3d(i, 0, 3), new Vec3d(i + 1, 0, 3), new Vec3d(i + 0.5, 0, 4));
|
||||
Vec3d nn = tri.GetNormal();
|
||||
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));
|
||||
vec3d_t nn = tri.GetNormal();
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
vs[k++] = rgb.x;
|
||||
@@ -180,7 +180,7 @@ namespace Sample.Disp
|
||||
int n = 10;
|
||||
List<Tri3d> tris = new List<Tri3d>(n);
|
||||
for (int i = 0; i < n; i++)
|
||||
tris.Add(new Tri3d(new Vec3d(i, 0, 0), new Vec3d(i + 1, 0, 0), new Vec3d(i + 0.5, 0, 1)));
|
||||
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)));
|
||||
|
||||
Drawing faceDraw = tris.GetFaceDrawing();
|
||||
Drawing linesDraw = tris.ToLineDrawing();
|
||||
|
||||
+3
-3
@@ -20,15 +20,15 @@ namespace Sample.Disp
|
||||
public void Display(Bind bind)
|
||||
{
|
||||
bind.PickID = PickingID;
|
||||
bind.Rgb = new Vec3d(isMouseOver ? 0 : 1, 1, 1);
|
||||
bind.Rgb = new vec3d_t(isMouseOver ? 0 : 1, 1, 1);
|
||||
new Box3d(0, 0, 0, 1, 1, 1).DisplayFace(bind);
|
||||
bind.PickID = 0;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void ExpandToBox3d(Box3d dst)
|
||||
{
|
||||
dst.Expand(new Vec3d(0, 0, 0));
|
||||
dst.Expand(new Vec3d(1, 1, 1));
|
||||
dst.Expand(new vec3d_t(0, 0, 0));
|
||||
dst.Expand(new vec3d_t(1, 1, 1));
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public override void OnMouseEnter(ui_event_type e, DispEngine dispEngine)
|
||||
|
||||
+2
-2
@@ -39,8 +39,8 @@ namespace Sample.Disp
|
||||
/// <inheritdoc/>
|
||||
public void ExpandToBox3d(Box3d dst)
|
||||
{
|
||||
dst.Expand(new Vec3d(0, 0, 0));
|
||||
dst.Expand(new Vec3d(1, 1, 3));
|
||||
dst.Expand(new vec3d_t(0, 0, 0));
|
||||
dst.Expand(new vec3d_t(1, 1, 3));
|
||||
}
|
||||
#region IDisposable Support
|
||||
private bool disposedValue = false; // To detect redundant calls
|
||||
|
||||
@@ -30,12 +30,12 @@ namespace Sample.Disp
|
||||
{
|
||||
sun.Display(bind);
|
||||
bind.ModelMatStack.Push();
|
||||
bind.ModelMatStack.Mul(new Mat4d(new AxisAngle4d(new Vec3d(0, 0, 1), angle_earth += 0.03)));
|
||||
bind.ModelMatStack.Mul(new Mat4d(new Vec3d(12, 0, 0)));
|
||||
bind.ModelMatStack.Mul(new Mat4d(new AxisAngle4d(new vec3d_t(0, 0, 1), angle_earth += 0.03)));
|
||||
bind.ModelMatStack.Mul(new Mat4d(new vec3d_t(12, 0, 0)));
|
||||
earth.Display(bind);
|
||||
bind.ModelMatStack.Push();
|
||||
bind.ModelMatStack.Mul(new Mat4d(new AxisAngle4d(new Vec3d(0, 0, 1), angle_moon += 0.02)));
|
||||
bind.ModelMatStack.Mul(new Mat4d(new Vec3d(4, 0, 0)));
|
||||
bind.ModelMatStack.Mul(new Mat4d(new AxisAngle4d(new vec3d_t(0, 0, 1), angle_moon += 0.02)));
|
||||
bind.ModelMatStack.Mul(new Mat4d(new vec3d_t(4, 0, 0)));
|
||||
moon.Display(bind);
|
||||
bind.ModelMatStack.Pop();
|
||||
bind.ModelMatStack.Pop();
|
||||
@@ -43,8 +43,8 @@ namespace Sample.Disp
|
||||
/// <inheritdoc/>
|
||||
public void ExpandToBox3d(Box3d dst)
|
||||
{
|
||||
dst.Expand(new Vec3d(-14, -14, -2));
|
||||
dst.Expand(new Vec3d(14, 14, 2));
|
||||
dst.Expand(new vec3d_t(-14, -14, -2));
|
||||
dst.Expand(new vec3d_t(14, 14, 2));
|
||||
}
|
||||
|
||||
static void Main()
|
||||
|
||||
@@ -62,10 +62,10 @@ namespace Sample.Disp
|
||||
////Console.WriteLine($"B: {CoordinateIndex}; {coordinateMove}");
|
||||
IMachiningEquipment equipment = MillingEquipmentFunc?.Invoke();
|
||||
if (equipment == null
|
||||
|| !equipment.TryGetMachinePositionAtTableMountZero(out Vec3d mcXyz_AttacherAtTableMountZero))
|
||||
|| !equipment.TryGetMachinePositionAtTableMountZero(out vec3d_t mcXyz_AttacherAtTableMountZero))
|
||||
return;
|
||||
|
||||
Vec3d coordinateMove;
|
||||
vec3d_t coordinateMove;
|
||||
string text;
|
||||
if (HeidenhainCycleDef247Q339 == 0 && HeidenhainCycleDef7Arg == null)
|
||||
return;
|
||||
@@ -98,9 +98,9 @@ namespace Sample.Disp
|
||||
|
||||
IMachiningEquipment equipment = MillingEquipmentFunc?.Invoke();
|
||||
if (equipment == null
|
||||
|| !equipment.TryGetMachinePositionAtTableMountZero(out Vec3d mcXyz_AttacherAtTableMountZero))
|
||||
|| !equipment.TryGetMachinePositionAtTableMountZero(out vec3d_t mcXyz_AttacherAtTableMountZero))
|
||||
return;
|
||||
Vec3d coordinateMove;
|
||||
vec3d_t coordinateMove;
|
||||
if (HeidenhainCycleDef247Q339 == 0 && HeidenhainCycleDef7Arg == null)
|
||||
return;
|
||||
coordinateMove = NcFlagUtil.GetHeidenhainCoordinateOffset(
|
||||
|
||||
@@ -45,12 +45,12 @@ public class IsoCoordinateEntryDisplayee : IAnchoredDisplayee
|
||||
if (ncEnv == null)
|
||||
return;
|
||||
|
||||
if (ncEnv.IsoCoordinateTable?.TryGetValue(IsoCoordinateId, out Vec3d coordinateMove) != true)
|
||||
if (ncEnv.IsoCoordinateTable?.TryGetValue(IsoCoordinateId, out vec3d_t coordinateMove) != true)
|
||||
return;
|
||||
string text = IsoCoordinateId ?? "";
|
||||
|
||||
IMachiningEquipment equipment = MillingEquipmentFunc?.Invoke();
|
||||
if (equipment == null || !equipment.TryGetIsoCoordinatePosition(coordinateMove, out Vec3d attacherPos))
|
||||
if (equipment == null || !equipment.TryGetIsoCoordinatePosition(coordinateMove, out vec3d_t attacherPos))
|
||||
return;
|
||||
|
||||
bind.ModelMatStack.Push();
|
||||
@@ -64,11 +64,11 @@ public class IsoCoordinateEntryDisplayee : IAnchoredDisplayee
|
||||
HardNcEnv ncEnv = NcEnv;
|
||||
if (ncEnv == null)
|
||||
return;
|
||||
if (ncEnv.IsoCoordinateTable?.TryGetValue(IsoCoordinateId, out Vec3d coordinateMove) != true)
|
||||
if (ncEnv.IsoCoordinateTable?.TryGetValue(IsoCoordinateId, out vec3d_t coordinateMove) != true)
|
||||
return;
|
||||
|
||||
IMachiningEquipment equipment = MillingEquipmentFunc?.Invoke();
|
||||
if (equipment == null || !equipment.TryGetIsoCoordinatePosition(coordinateMove, out Vec3d attacherPos))
|
||||
if (equipment == null || !equipment.TryGetIsoCoordinatePosition(coordinateMove, out vec3d_t attacherPos))
|
||||
return;
|
||||
dst.Expand(attacherPos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user