iobject.net 对模型进行平移或旋转时总是卡死

0 投票

在用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();

                            }
                        }                                                                                 

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

9月 12, 2019 分类:  143次浏览 | 用户: supermap三维小小白 初出茅庐 (44 分)

1个回答

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

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();

              }
          }
9月 12, 2019 用户: 邬袁凯 名扬四海 (2,432 分)
...