| | |
| | | public ViewXhsProjectBimfacePage() |
| | | { |
| | | InitializeComponent(); |
| | | this.PageTitle.Caption = "模型视图"; |
| | | this.PageTitle.HeaderSvgImage = this.svgImg32[0]; |
| | | this.PageTitle.SvgImageSize = new Size(24, 24); |
| | | } |
| | | |
| | | private HStation.Dto.XhsProjectStdDto _project = null; |
| | | private XhsProjectStdDto _project = null; |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | /// <param name="project"></param> |
| | | /// <param name="projectId">项目id</param> |
| | | public async Task SetBindingData(long projectId) |
| | | { |
| | | _project = await new BLL.XhsProjectStd().GetByID(projectId); |
| | | this.PageTitle.Caption = $"{_project?.Name}\n模型视图"; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | /// <param name="project">项目</param> |
| | | public void SetBindingData(HStation.Dto.XhsProjectStdDto project) |
| | | { |
| | | _project = project; |
| | | this.PageTitle.Caption = $"{project.Name}-模型视图"; |
| | | |
| | | this.PageTitle.Caption = $"{_project?.Name}\n模型视图"; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化数据源 |
| | | /// </summary> |
| | | public override async void InitialDataSource() |
| | | { |
| | | base.InitialDataSource(); |
| | |
| | | await this.bimfaceInterop3dContainer1.InitialContainer(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 页面加载完成后触发 |
| | | /// </summary> |
| | | private async void BimfaceInterop3dContainer1_LoadCompletedEvent() |
| | | { |
| | | if (_project == null) |
| | | { |
| | | return; |
| | | } |
| | | var allProjectSiteList = await new HStation.BLL.XhsProjectSiteStd().GetByProjectID(_project.ID); |
| | | var projectSite = allProjectSiteList?.FirstOrDefault(); |
| | | |
| | | var projectSite = await new BLL.XhsProjectSiteStd().GetDefaultByProjectID(_project.ID); |
| | | 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 new Yw.BLL.BimfaceFileRelationStd() |
| | | .GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, projectSite.ID, Yw.Bimface.Purpose.Simulation); |
| | | if (relation == null) |
| | | { |
| | | return; |
| | |
| | | } |
| | | |
| | | var viewToken = await BimfaceHelper.GetViewToken(bimfaceFile.BimfaceId); |
| | | if (string.IsNullOrEmpty(viewToken)) |
| | | { |
| | | return; |
| | | } |
| | | await this.bimfaceInterop3dContainer1.LoadView(viewToken); |
| | | |
| | | } |