OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Title = "打开 OSGB 文件";
openFileDialog.Filter = "OSGB文件(*.osgb;*.osg)|*.osgb;*osg|All files (*.*)|*.*";
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
try
{
Layer3Ds layers = m_layersControlCopy.Scene.Layers;
layers.Add(openFileDialog.FileName, Layer3DType.OSGB, true);
}
catch (Exception ex)
{
MessageBox.Show("OSGB图层添加失败:" + ex.Message);
}
}