Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        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());
        }
Ejemplo n.º 5
0
 public AreaTypeAttributes(FTPT.Area area)
 {
     mArea = area;
 }
Ejemplo n.º 6
0
 public SurfaceTypeAttributes(FTPT.Area area)
 {
     mArea = area;
 }
Ejemplo n.º 7
0
 public IntersectionAttributes(FTPT.Area area)
 {
     mArea = area;
 }