定点查询

//1.找到要查询的图层
            //2.找到要查询的shape
            //3设置Camera的位置
            //4刷新

ILayer pLayer = axSceneControl1.SceneGraph.Scene.get_Layer(i);
            IFeatureLayer pFeatureLayer = pLayer as IFeatureLayer;
            IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
            IFeature pFeature = pFeatureClass.GetFeature(j);
            IPoint TargetPoint = pFeature.Shape as IPoint;
          
            IPoint CameraPoint = new PointClass();
           
            CameraPoint.X = TargetPoint.X - 100;
            CameraPoint.Y = TargetPoint.Y - 50;
            CameraPoint.Z = TargetPoint.Z + 100;

            ICamera PCaera = axSceneControl1.SceneViewer.Camera;
            PCaera.Target = TargetPoint;
            PCaera.Observer = CameraPoint;
            //IScene pScene = axSceneControl1.SceneGraph.Scene;
            axSceneControl1.SceneGraph.RefreshViewers();

posted @ 2014-06-23 18:33  上官瑾文  阅读(212)  评论(0编辑  收藏  举报