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 | 95 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 85 insertions(+), 10 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 a5856e1..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 @@ -14,28 +14,38 @@ /// </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 BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(_projectId); - if (projectSite == null) + if (_projectSite == null) { return; } var relation = await BLLFactory<Yw.BLL.BimfaceFileRelation>.Instance - .GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, projectSite.ID, HStation.Xhs.Purpose.Simulation); + .GetDefaultByObjectTypeAndObjectIDOfPurpose + (HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation); if (relation == null) { return; @@ -65,20 +75,40 @@ 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> /// 鍗婇�忔槑鏋勪欢 @@ -100,5 +130,50 @@ 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