public InsertRoadLaneCommand( IMouseInformation mouseInformation, RoadLayer ownr, RoadLaneBuilder roadLaneBuilder ) { this._mouseInformation = mouseInformation; this._mouseInformation.LeftButtonPressed.Subscribe( this.MousePressed ); this._owner = ownr; this._roadLaneBuilder = roadLaneBuilder; this._roadLaneBuilder.SetOwner( ownr ); this._visitator = new VisitAllChildren( this._owner ); }
public ConnectObjectCommand( IMouseInformation mouseInformation, CompositeConnectionCommand compositeConnectionCommand, RoadLayer owner ) { this._mouseInformation = mouseInformation; this._compositeConnectionCommand = compositeConnectionCommand; this._visitator = new VisitAllChildren( owner ); this._mouseInformation.LeftButtonClicked.Subscribe( this.LeftButtonClicked ); }
public Simulation(ViewModel viewModel) { this.viewModel = viewModel; model = viewModel.Model; rangerLayer = viewModel.RangerLayer; sensorLayer = viewModel.SensorLayer; roadLayer = viewModel.RoadLayer; crossingLayer = viewModel.CrossingLayer; interloperLayer = viewModel.InterloperLayer; stopwatch = new Stopwatch(); }
/// <summary> /// 检查包括数据的单元格 /// </summary> /// <param name="type">类型 0-居民地,1-道路,2-水系</param> private void CheckGrid(int type) { IPolygon grid; if (_DataGrids != null) { _DataGrids.Clear(); } else { _DataGrids = new List <Geometry.Grid>(); } foreach (Geometry.Grid g in _InitGrids) { IFeatureCursor featureCursor = null; ISpatialFilter spatialFilter = new SpatialFilter(); if (isContainedInDataGrids(g)) { continue; //如果已包含在数据单元格中了,则跳过 } grid = g.BuildPolygon(); spatialFilter.Geometry = grid as IGeometry; spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects; if (type == 0) { featureCursor = ResidentLayer.Search(spatialFilter, false); } else if (type == 1) { featureCursor = RoadLayer.Search(spatialFilter, false); } else if (type == 2) { featureCursor = HydroLayer.Search(spatialFilter, false); } //System.Diagnostics.Debug.Print("row=" + g.Row.ToString() + ",col=" + g.Col.ToString()); if (featureCursor.NextFeature() != null) { _DataGrids.Add(g); } featureCursor.Flush(); featureCursor = null; } }
public IMouseHandler Create(RoadLayer roadLayer) { return this._roadLayerMouseHandlerFactory(roadLayer); }
public RoadLayerMouseHandler( RoadLayer owner, SelectedControls selectedControls ) { this._owner = owner; this._selectedControls = selectedControls; }