Exemplo n.º 1
0
        public override void Stop()
        {
            IList <int> indices = new List <int>();

            for (int i = 0; i < SourceFeature.Geometry.Coordinates.Length; i++)
            {
                // TODO add support for Alltracker
                if (Trackers[i].Selected)
                {
                    indices.Add(i);
                }
            }
            foreach (IFeatureRelationInteractor topologyRule in FeatureRelationEditors)
            {
                topologyRule.StoreRelatedFeatures(SourceFeature, TargetFeature.Geometry, indices);
            }
            FeatureRelationEditors.Clear();
            // copy targetfeature geometry to source
            //#$#
            SourceFeature.Geometry = (IGeometry)TargetFeature.Geometry.Clone();
            //for (int i = 0; i < TargetFeature.Geometry.Coordinates.Length; i++)
            //{
            //    SourceFeature.Geometry.Coordinates[i] = (Coordinate) TargetFeature.Geometry.Coordinates[i].Clone();
            //}
            //SourceFeature.Geometry.GeometryChangedAction();
            // #$#

            //base.Stop();
            branchNodeTopology.Branches = Network.Branches;
            branchNodeTopology.Nodes    = Network.Nodes;
            branchNodeTopology.Layer    = Layer;
            branchNodeTopology.OnBranchAdded((IBranch)SourceFeature);
        }
Exemplo n.º 2
0
 public virtual void Start()
 {
     TargetFeature = CreateTargetFeature();
     foreach (var featureRelationInteractor in GetFeatureRelationInteractors(SourceFeature))
     {
         var activeRule = featureRelationInteractor.Activate(SourceFeature, TargetFeature, AddRelatedFeature, 0,
                                                             FallOffPolicy);
         if (activeRule != null)
         {
             FeatureRelationEditors.Add(activeRule);
         }
     }
 }
Exemplo n.º 3
0
        public virtual void Stop()
        {
            if (null == TargetFeature)
            {
                return;
            }

            foreach (var topologyRule in FeatureRelationEditors)
            {
                topologyRule.StoreRelatedFeatures(SourceFeature, TargetFeature.Geometry, new List <int> {
                    0
                });
            }

            SourceFeature.Geometry = (IGeometry)TargetFeature.Geometry.Clone();

            FeatureRelationEditors.Clear();
        }