首页 / 浏览问题 / 组件GIS / 问题详情
iobject.net 对模型进行平移或旋转时总是卡死
48EXP 2019年09月12日

在用iobject.net对模型进行平移、旋转和缩放操作时总是卡死,是代码不正确吗?

                       Geometry geometry = recordset.GetGeometry();
                        if (geometry.Type == GeometryType.GeoModel3D)
                        {
                            GeoModel3D geoModel3D = geometry as GeoModel3D;
                            if (geoModel3D != null)
                            {                               
                                double x = m_ModelPosition.X + m_modelPanXDistance;
                                double y = m_ModelPosition.Y + m_modelPanYDistance;
                                double z = m_ModelPosition.Z + m_modelPanZDistance;
                                Point3D panPositon = new Point3D(x, y, z);
                                geoModel3D.Position = panPositon ;

                                recordset.Edit();
                                recordset.SetGeometry(geoModel3D);
                                recordset.Update();
                                recordset.Refresh();

                            }
                        }                                                                                 

而通过界面直接操作时,就不会出现这种卡死现象

1个回答

您好,这是我的完整代码,能够完整运行

DatasetVector dataset = workspace1.Datasources[0].Datasets[6] as DatasetVector;
          Recordset recordset = dataset.GetRecordset(false, CursorType.Dynamic);
          Geometry geometry = recordset.GetGeometry();
          if (geometry.Type == GeometryType.GeoModel3D)
          {
              GeoModel3D geoModel3D = geometry as GeoModel3D;
              if (geoModel3D != null)
              {
                  double x = 116.452099045492;
                  double y = 39.9139976379128;
                  double z = 20;
                  Point3D panPositon = new Point3D(x, y, z);
                  geoModel3D.Position = panPositon;

                  recordset.Edit();
                  recordset.SetGeometry(geoModel3D);
                  recordset.Update();
                  recordset.Refresh();
                  sceneControl1.Scene.Refresh();

              }
          }
2,432EXP 2019年09月12日
...