From 9ffb31c233f3b4891550293294c2ee716f77b42a Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期日, 22 九月 2024 19:08:49 +0800
Subject: [PATCH] 完善自动匹配

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs |  113 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 100 insertions(+), 13 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
index 854605e..e913b65 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
@@ -9,36 +9,49 @@
             this.bimfaceInterop3dContainer1.ClickInEvent += BimfaceInterop3dContainer1_ClickInEvent;
         }
 
+        /// <summary>
+        /// 鐐瑰嚮缁勪欢浜嬩欢
+        /// </summary>
         public event Action<string> ClickParterEvent;
 
-        private long _projectId;//椤圭洰id
+        private HStation.Vmo.XhsProjectVmo _project = null;
+        private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;
 
         /// <summary>
         /// 缁戝畾鏁版嵁
         /// </summary>
-        public async void SetBindingData(long projectId)
+        public async Task SetBindingData(HStation.Vmo.XhsProjectVmo project, HStation.Vmo.XhsProjectSiteVmo projectSite)
         {
-            _projectId = projectId;
+            if (project == null)
+            {
+                return;
+            }
+            _project = project;
+            _projectSite = projectSite;
+            if (_projectSite == null)
+            {
+                _projectSite = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(_project.ID);
+            }
             await this.bimfaceInterop3dContainer1.InitialContainer();
         }
 
         //椤甸潰鍔犺浇瀹屾垚鍚庤Е鍙�
         private async void BimfaceInterop3dContainer1_LoadCompletedEvent()
         {
-            var projectSite = await new BLL.XhsProjectSiteStd().GetDefaultByProjectID(_projectId);
-            if (projectSite == null)
+            if (_projectSite == null)
             {
                 return;
             }
 
-            var relation = await new Yw.BLL.BimfaceFileRelationStd()
-                .GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, projectSite.ID, Yw.Bimface.Purpose.Simulation);
+            var relation = await BLLFactory<Yw.BLL.BimfaceFileRelation>.Instance
+                .GetDefaultByObjectTypeAndObjectIDOfPurpose
+                    (HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation);
             if (relation == null)
             {
                 return;
             }
 
-            var bimfaceFile = await new Yw.BLL.BimfaceFileStd().GetByID(relation.BimfaceFileID);
+            var bimfaceFile = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.GetByID(relation.BimfaceFileID);
             if (bimfaceFile == null)
             {
                 return;
@@ -50,7 +63,6 @@
                 return;
             }
             await this.bimfaceInterop3dContainer1.LoadView(viewToken);
-
         }
 
         //鏋勪欢鐐瑰嚮
@@ -63,30 +75,105 @@
             this.ClickParterEvent?.Invoke(obj.ObjectId);
         }
 
-        public async Task HideComponents(List<string> elementIds)
-        {
-            await this.bimfaceInterop3dContainer1.HideComponents(elementIds);
-        }
+        #region 鏋勪欢鐨勬樉绀轰笌闅愯棌
 
+        /// <summary>
+        /// 鏄剧ず鏋勪欢
+        /// </summary>
+        /// <param name="elementIds">鏋勪欢id鍒楄〃</param>
+        /// <returns></returns>
         public async Task ShowComponents(List<string> elementIds)
         {
             await this.bimfaceInterop3dContainer1.ShowComponents(elementIds);
         }
 
+        /// <summary>
+        /// 闅愯棌鏋勪欢
+        /// </summary>
+        /// <param name="elementIds">鏋勪欢id鍒楄〃</param>
+        /// <returns></returns>
+        public async Task HideComponents(List<string> elementIds)
+        {
+            await this.bimfaceInterop3dContainer1.HideComponents(elementIds);
+        }
+
+        /// <summary>
+        /// 鏄剧ず鎵�鏈夋瀯浠�
+        /// </summary>
+        /// <returns></returns>
         public async Task ShowAllComponents()
         {
             await this.bimfaceInterop3dContainer1.ShowAllComponents();
         }
 
+        #endregion
+
+        #region 鏋勪欢鐨勫崐閫忔槑涓庡彇娑�
+
+        /// <summary>
+        /// 鍗婇�忔槑鏋勪欢
+        /// </summary>
+        /// <param name="elementIds">鏋勪欢id鍒楄〃</param>
+        /// <returns></returns>
         public async Task TranslucentComponents(List<string> elementIds)
         {
             await this.bimfaceInterop3dContainer1.TranslucentComponents(elementIds);
         }
 
+        /// <summary>
+        /// 鍙栨秷鏋勪欢鍗婇�忔槑
+        /// </summary>
+        /// <param name="elementIds">鏋勪欢id鍒楄〃</param>
+        /// <returns></returns>
         public async Task OpaqueComponents(List<string> elementIds)
         {
             await this.bimfaceInterop3dContainer1.OpaqueComponents(elementIds);
         }
 
+        #endregion
+
+        #region 鏋勪欢鐨勯�変腑涓庡彇娑�
+
+        /// <summary>
+        /// 璁剧疆閫夋嫨鐨勬瀯浠�
+        /// </summary>
+        /// <returns></returns>
+        public async Task SetSelectedComponents(List<string> elements)
+        {
+            await this.bimfaceInterop3dContainer1.SetSelectedComponents(elements);
+        }
+
+        /// <summary>
+        /// 澧炲姞閫夋嫨鐨勬瀯浠�
+        /// </summary>
+        /// <param name="elements"></param>
+        /// <returns></returns>
+        public async Task AddSelectedComponents(List<string> elements)
+        {
+            await this.bimfaceInterop3dContainer1.AddSelectedComponents(elements);
+        }
+
+        /// <summary>
+        /// 绉婚櫎閫夋嫨鐨勬瀯浠�
+        /// </summary>
+        /// <param name="elements"></param>
+        /// <returns></returns>
+        public async Task RemoveSelectedComponents(List<string> elements)
+        {
+            await this.bimfaceInterop3dContainer1.RemoveSelectedComponents(elements);
+        }
+
+        /// <summary>
+        /// 娓呴櫎閫夋嫨鐨勬瀯浠�
+        /// </summary>
+        /// <param name="elements"></param>
+        /// <returns></returns>
+        public async Task ClearSelectedComponents()
+        {
+            await this.bimfaceInterop3dContainer1.ClearSelectedComponents();
+        }
+
+        #endregion
+
     }
 }

--
Gitblit v1.9.3