namespace HStation.WinFrmUI
|
{
|
public partial class XhsProjectSimulationBimfaceInfoCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public XhsProjectSimulationBimfaceInfoCtrl()
|
{
|
InitializeComponent();
|
this.bimfaceInterop3dContainer1.LoadCompletedEvent += BimfaceInterop3dContainer1_LoadCompletedEvent;
|
}
|
|
|
|
private long _projectId;//项目id
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public async void SetBindingData(long projectId)
|
{
|
_projectId = projectId;
|
await this.bimfaceInterop3dContainer1.InitialContainer();
|
}
|
|
/// <summary>
|
/// 页面加载完成后触发
|
/// </summary>
|
private async void BimfaceInterop3dContainer1_LoadCompletedEvent()
|
{
|
var projectSite = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(_projectId);
|
if (projectSite == null)
|
{
|
return;
|
}
|
|
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 BLLFactory<Yw.BLL.BimfaceFile>
|
.Instance.GetByID(relation.BimfaceFileID);
|
if (bimfaceFile == null)
|
{
|
return;
|
}
|
|
var viewToken = await BimfaceHelper.GetViewToken(bimfaceFile.BimfaceId);
|
if (string.IsNullOrEmpty(viewToken))
|
{
|
return;
|
}
|
await this.bimfaceInterop3dContainer1.LoadView(viewToken);
|
|
}
|
|
}
|
}
|