Ejemplo n.º 1
0
 public void MultipleSelectionTestViaCoordinatesNoFallOffPolicy()
 {
     // todo write
     var mapControl = new MapControl { Map = { Size = new Size(1000, 1000) } };
     var lineStringEditor = new LineStringInteractor(new VectorLayer { Map = mapControl.Map }, sampleFeature, GetStyle(), null);
     
     var trackerFeatureAtCoordinate10 = lineStringEditor.GetTrackerAtCoordinate(new Coordinate(10, 0));
     trackerFeatureAtCoordinate10.Selected = true;
     
     var trackerFeatureAtCoordinate30 = lineStringEditor.GetTrackerAtCoordinate(new Coordinate(30, 0));
     trackerFeatureAtCoordinate30.Selected = true;
     lineStringEditor.FallOffPolicy = new NoFallOffPolicy();
     lineStringEditor.Start();
     lineStringEditor.MoveTracker(trackerFeatureAtCoordinate30, 0, 5);
     
     // both tracker at 10 and 30 is moved
     Assert.AreEqual(5.0, trackerFeatureAtCoordinate30.Geometry.Coordinates[0].Y);
     Assert.AreEqual(5.0, trackerFeatureAtCoordinate10.Geometry.Coordinates[0].Y);
     lineStringEditor.Stop();
 }
Ejemplo n.º 2
0
 public void AllTrackerTest()
 {
     var mapControl = new MapControl { Map = { Size = new Size(1000, 1000) } };
     var lineStringEditor = new LineStringInteractor(new VectorLayer { Map = mapControl.Map }, sampleFeature, GetStyle(), null);
     
     var trackerFeature = lineStringEditor.GetTrackerAtCoordinate(new Coordinate(15, 0));
     lineStringEditor.Start();
     lineStringEditor.MoveTracker(trackerFeature, 0.0, 5.0);
     
     Assert.AreEqual(5.0, lineStringEditor.TargetFeature.Geometry.Coordinates[0].Y);
     Assert.AreEqual(5.0, lineStringEditor.TargetFeature.Geometry.Coordinates[1].Y);
     Assert.AreEqual(5.0, lineStringEditor.TargetFeature.Geometry.Coordinates[2].Y);
     Assert.AreEqual(5.0, lineStringEditor.TargetFeature.Geometry.Coordinates[3].Y);
     Assert.AreEqual(5.0, lineStringEditor.TargetFeature.Geometry.Coordinates[4].Y);
     
     lineStringEditor.Stop();
 }
Ejemplo n.º 3
0
 public void SelectionTestViaCoordinates()
 {
     var mapControl = new MapControl {Map = {Size = new Size(1000, 1000)}};
     var lineStringEditor = new LineStringInteractor(new VectorLayer { Map = mapControl.Map }, sampleFeature, GetStyle(), null);
     
     var trackerFeatureAtCoordinate = lineStringEditor.GetTrackerAtCoordinate(new Coordinate(20, 0));
     var trackerFeatureAtIndex = lineStringEditor.Trackers[2];
     Assert.AreEqual(trackerFeatureAtIndex, trackerFeatureAtCoordinate);
     
     trackerFeatureAtCoordinate.Selected = true;
     Assert.AreEqual(1, lineStringEditor.Trackers.Count(t => t.Selected));
 }