Ejemplo n.º 1
0
        public void Setup()
        {
            noFallOffPolicy = new NoFallOffPolicy();
            lineStringSource =
                new LineString(new[]
                                   {
                                       new Coordinate(0, 0), new Coordinate(10, 0), new Coordinate(20, 0),
                                       new Coordinate(30, 0), new Coordinate(40, 0)
                                   });
            lineStringTarget = (ILineString)lineStringSource.Clone();
            theLarch = new LineString(new[]
                                   {
                                       new Coordinate(0, 0), new Coordinate(10, 0), new Coordinate(20, 0),
                                       new Coordinate(30, 0), new Coordinate(40, 0), new Coordinate(50, 0)
                                   });

        }
Ejemplo n.º 2
0
        public override bool MoveTracker(ITrackerFeature trackerFeature, double deltaX, double deltaY, ISnapResult snapResult)
        {
            if (trackerFeature == AllTracker)
            {
                int index = -1;
                IList<int> handles = new List<int>();
                IList<IGeometry> geometries = new List<IGeometry>();

                for (int i = 0; i < trackers.Count; i++)
                {
                    geometries.Add(trackers[i].Geometry);
                    //if (trackers[i].Selected)
                    {
                        handles.Add(i);
                    }
                    if (trackers[i] == trackerFeature)
                    {
                        index = i;
                    }
                }
                if (0 == handles.Count)
                    return false;
                if (null == FallOffPolicy)
                {
                    FallOffPolicy = new NoFallOffPolicy();
                }
                FallOffPolicy.Move(TargetFeature.Geometry, geometries, handles, index, deltaX, deltaY);
                foreach (IFeatureRelationEditor topologyRule in TopologyRules)
                {
                    topologyRule.UpdateRelatedFeatures(SourceFeature, TargetFeature.Geometry, new List<int> { 0 });
                }

                return true;
            }
            return base.MoveTracker(trackerFeature, deltaX, deltaY, snapResult);
        }