使用产品:SuperMap iDesktop .NET 9D 操作系统win10 x64
软件名称:supermap-idesktop.net-9.1.1-36767-win64-zip-chs
问题详细描述:超图用C#加载的场景模型不显示
问题重述步骤:1、超图中已有osgb和水面场景,高度都设在2000米,水面是透明的,添加一个正方体,正方体在水面下面,通过调整图层顺序,在超图场景中是可以看到水面下的正方体。
2、另用C#开发一个小工具,可以加载这个场景但是不知什么原因看不到正方体???
主要代码如下:
private bool CreateSceneControl(string workspacePath, string sceneName = null)
{
bool isOpen = true;
if (null != m_sceneControl)
{
m_sceneControl.Scene.Close();
m_sceneControl.Dispose();
m_sceneControl = null;
}
m_sceneControl = new SceneControl();
if (null == m_workspace)
{
m_workspace = new Workspace();
isOpen = WorkspaceHelper.OpenWorkspace(m_workspace, m_sceneControl, workspacePath, sceneName);
}
else
{
isOpen = WorkspaceHelper.OpenScene(m_workspace, m_sceneControl, sceneName);
}
if (!isOpen) return isOpen;//打开失败
//去掉三维地图上的经纬度
m_sceneControl.IsStatusBarVisible = false;
ScenceHost.Child = m_sceneControl;
return isOpen;
}
private void btnSelect_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.OpenFileDialog openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
openFileDialog1.Filter = "超图工程文件 (*.smwu)|*.smwu";
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
openFileDialog1.Multiselect = false;
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
tbFile.Text = openFileDialog1.FileName;
filepath = openFileDialog1.FileName;
//打开三维
CreateSceneControl(filepath, null);
}
}