使用产品:iobject net 10i 操作系统:win10 x64
数据类型: 文件型
问题详细描述:在三维场景中加载三维模型,然后通过线程实时更新模型位置报错
问题重现步骤:
报错信息:“System.AccessViolationException”类型的未经处理的异常在 SuperMap.Data.dll 中发生
报错代码:
//这是一个线程函数
private void ShowModelFun()
{
while (true)
{
try
{
foreach (UAVInfo item in GlobalInstance._uavInfos.Values)
{
GeoModel geoModel = GlobalInstance._uavGeoModel[item.ID];
TrackInfo trackInfo = GlobalInstance._uavTrackInfo[item.ID].TracInfo;
Point3D point = new Point3D(trackInfo.Longitude, trackInfo.Latitude, trackInfo.Altitude);
geoModel.Position = point;
//该区域造成报错
int index = GlobalInstance._sceneControl.Scene.TrackingLayer.IndexOf(item.ID);
GlobalInstance._sceneControl.Scene.TrackingLayer.Set(index, geoModel);
GeoLine3D geoLine = CreateGeoLine3D(point);
string lineTag = string.Format("line_{0}", item.ID);
int lineIndex = GlobalInstance._sceneControl.Scene.TrackingLayer.IndexOf(lineTag);
if (lineIndex >= 0)
{
GlobalInstance._sceneControl.Scene.TrackingLayer.Remove(lineIndex);
GlobalInstance._sceneControl.Scene.TrackingLayer.Add(geoLine, lineTag);
}
else
{
GlobalInstance._sceneControl.Scene.TrackingLayer.Add(geoLine, lineTag);
}
}
//GlobalInstance._sceneControl.Scene.Refresh();
Thread.Sleep(500);
}
catch { }
}
}