private void AddFootprintArea(FTPT.Area area) { area = NewArea(area); mFootprint.FootprintAreas.Add(area); area = mFootprint.FootprintAreas.Last(); var vm = new AreaViewModel(this, area); mFootprintAreas.Add(vm); SelectedArea = vm; }
private FTPT.Area NewArea(FTPT.Area basis) { FTPT.Area area = null; if (basis == null) { area = new FTPT.Area(0, null, mFootprint.Version); } else { area = new FTPT.Area(0, null, mFootprint.Version, basis.Name, basis.Priority, basis.AreaTypeFlags, basis.ClosedPolygon.Select(x => x.Clone(null)).Cast <FTPT.PolygonPoint>().ToList(), basis.AllowIntersectionFlags, basis.SurfaceTypeFlags, basis.SurfaceAttributeFlags, basis.LevelOffset, basis.Lower, basis.Upper); } return(area); }
public AreaViewModel(FootprintEditorViewModel parent, FTPT.Area area) { mParent = parent; mArea = area; mAreaTypeAttributes = new AreaTypeAttributes(mArea); mSurfaceTypeAttributes = new SurfaceTypeAttributes(mArea); mSurfaceAttributes = new SurfaceAttributes(mArea); mIntersectionAttributes = new IntersectionAttributes(mArea); mPoints = new ObservableCollection <PointViewModel>(); foreach (FTPT.PolygonPoint pt in area.ClosedPolygon) { Add(new PointViewModel(this, pt)); } SelectedPoint = Points.FirstOrDefault(); mDeletePointCommand = new UserCommand <AreaViewModel>(x => x != null && x.SelectedPoint != null && x.Points.Contains(x.SelectedPoint), x => x.Remove(x.SelectedPoint)); mAddPointCommand = new UserCommand <AreaViewModel>(x => x != null && true, x => x.Add()); }
public AreaViewModel(FootprintEditorViewModel parent, FTPT.Area area) { mParent = parent; mArea = area; mAreaTypeAttributes = new AreaTypeAttributes(mArea); mSurfaceTypeAttributes = new SurfaceTypeAttributes(mArea); mSurfaceAttributes = new SurfaceAttributes(mArea); mIntersectionAttributes = new IntersectionAttributes(mArea); mPoints = new ObservableCollection<PointViewModel>(); foreach (FTPT.PolygonPoint pt in area.ClosedPolygon) { Add(new PointViewModel(this, pt)); } SelectedPoint = Points.FirstOrDefault(); mDeletePointCommand = new UserCommand<AreaViewModel>(x => x != null && x.SelectedPoint != null && x.Points.Contains(x.SelectedPoint), x => x.Remove(x.SelectedPoint)); mAddPointCommand = new UserCommand<AreaViewModel>(x => x != null && true, x => x.Add()); }
public AreaTypeAttributes(FTPT.Area area) { mArea = area; }
public SurfaceTypeAttributes(FTPT.Area area) { mArea = area; }
public IntersectionAttributes(FTPT.Area area) { mArea = area; }