public static DbModel.Location.AreaAndDev.Bound ToDbModel(this Location.TModel.Location.AreaAndDev.Bound item1) { if (item1 == null) { return(null); } var item2 = new DbModel.Location.AreaAndDev.Bound(); item2.Update(item1); return(item2); }
private List <Point> GetPoints(double scale, Location.TModel.Location.AreaAndDev.Bound bound, double roomOffX, double roomOffY) { List <Point> points = new List <Point>(); foreach (var item in bound.GetPoints2D()) { double x = (item.X - OffsetX + roomOffX) * scale; double y = (item.Y - OffsetY + roomOffY) * scale; points.Add(new Point(x, y)); } return(points); }
public static Location.TModel.Location.AreaAndDev.Bound ToTModel(this DbModel.Location.AreaAndDev.Bound item1) { if (item1 == null) { return(null); } var item2 = new Location.TModel.Location.AreaAndDev.Bound(); item2.Id = item1.Id; item2.MinX = item1.MinX; item2.MaxX = item1.MaxX; item2.MinY = item1.MinY; item2.MaxY = item1.MaxY; item2.MinZ = item1.MinZ; item2.MaxZ = item1.MaxZ; item2.ZeroX = item1.ZeroX; item2.ZeroY = item1.ZeroY; item2.Shape = item1.Shape; item2.IsRelative = item1.IsRelative; item2.Points = item1.Points.ToTModel(); return(item2); }