WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
@@ -1,4 +1,5 @@ using Yw.WinFrmUI.Bimface; using DevExpress.Xpo.Helpers; using Yw.WinFrmUI.Bimface; namespace HStation.WinFrmUI { @@ -417,9 +418,12 @@ #region ä¸å¡ #region è¿æ¥æä»¶é¢è² private const string _linkComponentColor = "#008B00"; private const string _linkComponentColor = "#008B00";//è¿æ¥æä»¶é¢è² private const string _linkStartComponentColor = "#094EF7";//è¿æ¥å¼å§æä»¶é¢è² private const string _linkEndComponentColor = "#ECBF08";//è¿æ¥ç»ææä»¶é¢è² private const double _linkComponentTransparency = 0.8; private List<string> _linkComponentIds = null;//è¿æ¥æä»¶idå表 @@ -428,24 +432,64 @@ /// </summary> public async Task SetLinkComponentsColor(List<string> elementIds) { if (_linkComponentIds != null && _linkComponentIds.Count > 0) { await _bimfaceInteropContainer.RestoreComponentsColor(_linkComponentIds); } await RestoreLinkComponentsColor(); _linkComponentIds = elementIds; if (_linkComponentIds == null || _linkComponentIds.Count < 1) { return; } await _bimfaceInteropContainer?.OverrideComponentsColor(_linkComponentIds, _linkComponentColor, _linkComponentTransparency); } /// <summary> /// æ¢å¤è¿æ¥æä»¶é¢è² /// </summary> public async Task RestoreLinkComponentsColor() { if (_linkComponentIds == null || _linkComponentIds.Count < 1) { return; } await _bimfaceInteropContainer?.RestoreComponentsColor(_linkComponentIds); } /// <summary> /// è®¾ç½®è¿æ¥å¼å§æä»¶é¢è² /// </summary> public async Task SetLinkStartComponentsColor(List<string> elementIds) { if (elementIds == null || elementIds.Count < 1) { return; } if (_bimfaceInteropContainer == null) if (_linkComponentIds == null) { _linkComponentIds = new List<string>(); } _linkComponentIds.AddRange(elementIds); await _bimfaceInteropContainer?.OverrideComponentsColor(elementIds, _linkStartComponentColor, _linkComponentTransparency); } /// <summary> /// è®¾ç½®è¿æ¥ç»ææä»¶é¢è² /// </summary> public async Task SetLinkEndComponentsColor(List<string> elementIds) { if (elementIds == null || elementIds.Count < 1) { return; } await _bimfaceInteropContainer.OverrideComponentsColor(elementIds, _linkComponentColor, _linkComponentTransparency); if (_linkComponentIds == null) { _linkComponentIds = new List<string>(); } _linkComponentIds.AddRange(elementIds); await _bimfaceInteropContainer?.OverrideComponentsColor(elementIds, _linkEndComponentColor, _linkComponentTransparency); } #endregion #region 设置Openæä»¶é¢è² private const string _openComponentColor = "#2E8B57"; WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -1,5 +1,7 @@ global using Yw.EPAnet; using DevExpress.XtraMap.Drawing; using NetTaste; using Org.BouncyCastle.Crypto.Engines; namespace HStation.WinFrmUI { @@ -108,8 +110,6 @@ //bimfaceæ§ä»¶ private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null; //设置Bimfaceè¿æ¥é¢è² private async void SetBimfaceLinkColor() { @@ -117,48 +117,58 @@ { return; } var elementIds = new List<string>(); if (_parter != null) { if (_parter is Yw.Model.HydroLinkInfo linker) if (_parter is Yw.Model.HydroLinkInfo link) { var allParterList = _hydroInfo.GetAllParters(); var allLinkerList = _hydroInfo.GetAllLinks(); var startParter = allParterList?.Find(x => x.Code == linker.StartCode); await _bimfaceCtrl?.RestoreLinkComponentsColor(); var allVisualList = _hydroInfo.GetAllVisuals(); var allLinkList = _hydroInfo.GetAllLinks(); var startParter = allVisualList?.Find(x => x.Code == link.StartCode); if (startParter != null) { var startElementIds = new List<string>(); if (startParter.GetType() == typeof(Yw.Model.HydroJunctionInfo)) { var startLinkList = allLinkerList?.Where(x => x.StartCode == startParter.Code || x.EndCode == startParter.Code).ToList(); if (startLinkList != null) var startLinkList = allLinkList?.Where(x => x.StartCode == startParter.Code || x.EndCode == startParter.Code && x.Code != _parter.Code).ToList(); if (startLinkList != null && startLinkList.Count > 0) { elementIds.AddRange(startLinkList.Select(x => x.Code).Where(x => x != _parter.Code)); startElementIds.AddRange(startLinkList.Select(x => x.Code)); } } else { elementIds.Add(linker.StartCode); startElementIds.Add(startParter.Code); } if (startElementIds.Count > 0) { await _bimfaceCtrl?.SetLinkStartComponentsColor(startElementIds); } } var endParter = allParterList?.Find(x => x.Code == linker.EndCode); var endParter = allVisualList?.Find(x => x.Code == link.EndCode); if (endParter != null) { var endElementIds = new List<string>(); if (endParter.GetType() == typeof(Yw.Model.HydroJunctionInfo)) { var endLinkList = allLinkerList?.Where(x => x.StartCode == endParter.Code || x.EndCode == endParter.Code).ToList(); if (endLinkList != null) var endLinkList = allLinkList?.Where(x => x.StartCode == endParter.Code || x.EndCode == endParter.Code && x.Code != _parter.Code).ToList(); if (endLinkList != null && endLinkList.Count > 0) { elementIds.AddRange(endLinkList.Select(x => x.Code).Where(x => x != _parter.Code)); endElementIds.AddRange(endLinkList.Select(x => x.Code)); } } else { elementIds.Add(linker.EndCode); endElementIds.Add(endParter.Code); } if (endElementIds.Count > 0) { await _bimfaceCtrl?.SetLinkEndComponentsColor(endElementIds); } } } } await _bimfaceCtrl?.SetLinkComponentsColor(elementIds); } #endregion WinFrmUI/Yw.WinFrmUI.Bimface.Core/Yw.WinFrmUI.Bimface.Core.csproj
@@ -40,6 +40,7 @@ <None Remove="bimface\js\GetComponents.js" /> <None Remove="bimface\js\Layer.js" /> <None Remove="bimface\js\Panel.js" /> <None Remove="bimface\js\PipeFlow.js" /> <None Remove="bimface\js\SelectedComponents.js" /> <None Remove="bimface\js\WalkThrough.js" /> <None Remove="bimface\js\Zoom.js" /> @@ -91,6 +92,9 @@ <Content Include="bimface\js\Panel.js"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Content Include="bimface\js\PipeFlow.js"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Content Include="bimface\js\WalkThrough.js"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/PipeFlow.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ // æµåå¨ç»è®¾ç½® function setFlowAnimation(data) { // viewer.getModel().isolateComponentsById(components, Glodon.Bimface.Viewer.IsolateOption.MakeOthersTranslucent); // å¨ç» flowEffectConfig1 = new Glodon.Bimface.Plugins.Animation.FlowEffectConfig(); // æé æ°´æµå¨ç»å¯¹è±¡ flowEffect1 flowEffectConfig1.material = data; flowEffectConfig1.speed = [0.01, 0]; flowEffectConfig1.viewer = _viewer; flowEffect1 = new Glodon.Bimface.Plugins.Animation.FlowEffect(flowEffectConfig1); flowEffect1.play(); }