From 04f2dbb714178dd0b43c391c1a0da8d1a208091b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E5=82=B2=E5=B4=96-=E5=BF=98=E9=9C=84?= <702099480@qq.com> Date: Fri, 21 Jul 2023 00:56:42 +0000 Subject: [PATCH 1/3] =?UTF-8?q?update=20src/CAD/IFox.CAD.Shared/ExtensionM?= =?UTF-8?q?ethod/EditorEx.cs.=20=E4=BD=BF=E7=94=A8DrawVectors=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E5=B1=8F=E5=B9=95=E6=B2=A1=E6=9C=89=E4=BB=BB?= =?UTF-8?q?=E4=BD=95=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=A2=9E=E5=8A=A0DrawLineV?= =?UTF-8?q?ectors=E7=BB=98=E5=88=B6=E5=A4=9A=E6=9D=A1=E7=BA=BF=E6=AE=B5?= =?UTF-8?q?=E5=92=8CDrawEndToEndVectors=E7=BB=98=E5=88=B6=E9=A6=96?= =?UTF-8?q?=E5=B0=BE=E7=9B=B8=E8=BF=9E=E7=9A=84=E7=9F=A2=E9=87=8F=E5=9B=BE?= =?UTF-8?q?=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 云傲崖-忘霄 <702099480@qq.com> --- .../ExtensionMethod/EditorEx.cs | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs b/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs index a1043d0..4df7607 100644 --- a/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs +++ b/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs @@ -602,7 +602,49 @@ public static void DrawCircle(this Editor editor, Point2d pnt, short colorIndex, editor.DrawVectors(pnts, colorIndex, true); } - + /// + /// 根据点表绘制矢量线段(每两点为一条线段的起始点和终止点) + /// + /// 用户交互对象 + /// 点表 + /// CAD颜色索引 默认-红色 + /// 是否高亮显示,默认为 + public static void DrawLineVectors(this Editor editor, IEnumerable points, int colorIndex = 1, + bool drawHighlighted = false) + { + Point3d endPoint1, endPoint2; + var itor = points.GetEnumerator(); + while (itor.MoveNext()) + { + endPoint1 = itor.Current; + if (!itor.MoveNext()) return; + endPoint2 = itor.Current; + editor.DrawVector(endPoint1, endPoint2, colorIndex, drawHighlighted); + } + } + /// + /// 根据点表绘制首尾相连的矢量 + /// + /// 用户交互对象 + /// 点表 + /// CAD颜色索引;默认:1为红色 + /// 是否闭合; 为闭合,默认: 为不闭合 + /// 是否高亮显示;为高亮显示,默认:为不高亮显示 + public static void DrawEndToEndVectors(this Editor editor, IEnumerable points, int colorIndex = 1, + bool isclose = false, bool drawHighlighted = false) + { + var itor = points.GetEnumerator(); + if (points.Count() < 1 || !itor.MoveNext()) return; + Point3d endPoint1 = itor.Current, endPoint2 = new(), firstEndPoint = endPoint1; + while (itor.MoveNext()) + { + endPoint2 = itor.Current; + editor.DrawVector(endPoint1, endPoint2, colorIndex, drawHighlighted); + endPoint1 = endPoint2; + } + if (isclose) + editor.DrawVector(endPoint2, firstEndPoint, colorIndex, drawHighlighted); + } #endregion #region 矩阵 -- Gitee From 6fca3f544b04edbf2220678cb39bcf71dc0ce247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E5=82=B2=E5=B4=96-=E5=BF=98=E9=9C=84?= <702099480@qq.com> Date: Fri, 21 Jul 2023 01:15:53 +0000 Subject: [PATCH 2/3] update src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 云傲崖-忘霄 <702099480@qq.com> --- src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs b/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs index 4df7607..c083b35 100644 --- a/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs +++ b/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs @@ -607,8 +607,8 @@ public static void DrawCircle(this Editor editor, Point2d pnt, short colorIndex, /// /// 用户交互对象 /// 点表 - /// CAD颜色索引 默认-红色 - /// 是否高亮显示,默认为 + /// CAD颜色索引;默认:1为红色 + /// 是否高亮显示;为高亮显示,默认:为不高亮显示 public static void DrawLineVectors(this Editor editor, IEnumerable points, int colorIndex = 1, bool drawHighlighted = false) { -- Gitee From 40daa5782eea4f3c5f1016d434c227bd114b9e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E5=82=B2=E5=B4=96-=E5=BF=98=E9=9C=84?= <702099480@qq.com> Date: Fri, 28 Jul 2023 08:06:08 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddrawvectors=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E9=94=99=E8=AF=AF.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 云傲崖-忘霄 <702099480@qq.com> --- src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs b/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs index c083b35..4d7915a 100644 --- a/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs +++ b/src/CAD/IFox.CAD.Shared/ExtensionMethod/EditorEx.cs @@ -534,7 +534,7 @@ public static void DrawVectors(this Editor editor, IEnumerable pnts, sh var rlst = new LispList { { LispDataType.Int16, colorIndex } }; rlst.AddRange(GetLines(pnts, isClosed)); - editor.DrawVectors(rlst, editor.CurrentUserCoordinateSystem); + editor.DrawVectors(new(rlst.ToArray()), Matrix3d.Identity); } /// @@ -577,7 +577,7 @@ public static void DrawCircles(this Editor editor, IEnumerable pnts, sh rlst.AddRange(GetLines(tpnts, true)); } - editor.DrawVectors(rlst, editor.CurrentUserCoordinateSystem); + editor.DrawVectors(new(rlst.ToArray()), editor.CurrentUserCoordinateSystem); } /// -- Gitee