コード例 #1
0
 public void RemoveMe()
 {
     Measurement.RemoveMeasurementPoint(PointId);
 }
コード例 #2
0
 public void LookAtMeasurement()
 {
     Measurement?.LookAtMeasurement(ApiPoint);
 }
コード例 #3
0
 public void OpenNearestImage()
 {
     Measurement?.OpenNearestImage(ApiPoint);
 }
コード例 #4
0
        public async Task UpdatePointAsync(ApiMeasurementPoint measurementPoint, int index)
        {
            if (!_updatePoint)
            {
                _updatePoint = true;
                Index        = index;

                ApiPoint = measurementPoint;
                double x = measurementPoint.x;
                double y = measurementPoint.y;
                double z = measurementPoint.z;
                Point = await CoordSystemUtils.CycloramaToMapPointAsync(x, y, z);

                LastPoint = LastPoint ?? Point;

                MapView  thisView = MapView.Active;
                Geometry geometry = await thisView.GetCurrentSketchAsync();

                if (geometry != null)
                {
                    var ptColl = await Measurement.ToPointCollectionAsync(geometry);

                    int nrPoints = Measurement.PointNr;

                    if ((ptColl != null) && Measurement.IsSketch)
                    {
                        if (_intId <= nrPoints)
                        {
                            MapPoint pointC = ptColl[_intId - 1];

                            if (!IsSame(pointC))
                            {
                                await QueuedTask.Run(() =>
                                {
                                    MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Point.M,
                                                                                    geometry.SpatialReference);

                                    if (Measurement.IsPointMeasurement)
                                    {
                                        thisView.SetCurrentSketchAsync(point);
                                    }
                                    else
                                    {
                                        ptColl[_intId - 1] = point;

                                        if ((_intId == 1) && ((nrPoints + 1) == ptColl.Count))
                                        {
                                            ptColl[ptColl.Count - 1] = point;
                                        }

                                        if (Measurement.IsGeometryType(GeometryType.Polygon))
                                        {
                                            geometry = PolygonBuilder.CreatePolygon(ptColl, geometry.SpatialReference);
                                        }
                                        else if (Measurement.IsGeometryType(GeometryType.Polyline))
                                        {
                                            if (ptColl.Count == 1)
                                            {
                                                ptColl.Add(ptColl[0]);
                                            }

                                            geometry = PolylineBuilder.CreatePolyline(ptColl, geometry.SpatialReference);
                                        }

                                        thisView.SetCurrentSketchAsync(geometry);
                                    }
                                });
                            }
                        }
                        else
                        {
                            await QueuedTask.Run(() =>
                            {
                                MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Point.M,
                                                                                geometry.SpatialReference);
                                int nrPoints2 = ptColl.Count;

                                switch (nrPoints2)
                                {
                                case 0:
                                    ptColl.Add(point);

                                    if (geometry is Polygon)
                                    {
                                        ptColl.Add(point);
                                    }

                                    break;

                                case 1:
                                    ptColl.Add(point);
                                    break;

                                default:
                                    if (_intId <= (nrPoints + 1))
                                    {
                                        if ((_intId - 1) != nrPoints2)
                                        {
                                            ptColl.Insert((_intId - 1), point);
                                        }
                                        else
                                        {
                                            ptColl.Add(point);
                                        }
                                    }

                                    break;
                                }

                                if (Measurement.IsGeometryType(GeometryType.Polygon))
                                {
                                    geometry = PolygonBuilder.CreatePolygon(ptColl, geometry.SpatialReference);
                                }
                                else if (Measurement.IsGeometryType(GeometryType.Polyline))
                                {
                                    if (ptColl.Count == 1)
                                    {
                                        ptColl.Add(ptColl[0]);
                                    }

                                    geometry = PolylineBuilder.CreatePolyline(ptColl, geometry.SpatialReference);
                                }
                                else if ((Measurement.IsPointMeasurement) && (ptColl.Count == 1))
                                {
                                    geometry = ptColl[0];
                                }

                                thisView.SetCurrentSketchAsync(geometry);
                            });
                        }
                    }
                    else
                    {
                        if (geometry is MapPoint)
                        {
                            await QueuedTask.Run(() =>
                            {
                                if (geometry.IsEmpty)
                                {
                                    if ((!double.IsNaN(Point.X)) && (!double.IsNaN(Point.Y)))
                                    {
                                        if (!_added)
                                        {
                                            _added         = true;
                                            MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Index);
                                            thisView.SetCurrentSketchAsync(point);
                                            _added = false;
                                        }
                                    }
                                }
                                else
                                {
                                    var pointC = geometry as MapPoint;

                                    if (!IsSame(pointC))
                                    {
                                        if ((!double.IsNaN(Point.X)) && (!double.IsNaN(Point.Y)))
                                        {
                                            MapPoint point = MapPointBuilder.CreateMapPoint(Point.X, Point.Y, Point.Z, Index);
                                            thisView.SetCurrentSketchAsync(point);
                                        }
                                    }
                                }
                            });
                        }
                    }
                }

                _updatePoint = false;
            }

            await RedrawPointAsync();
        }
コード例 #5
0
 public void OpenPoint()
 {
     Open = true;
     Measurement?.OpenPoint(PointId);
     SetDetailPane();
 }
コード例 #6
0
 public void RemoveObservation(MeasurementObservation observation)
 {
     Measurement.RemoveObservation(PointId, observation?.ImageId);
 }