Changeset 9440 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans
- Timestamp:
- 05/04/13 17:51:14 (12 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan2DView.cs
r9348 r9440 3 3 using HeuristicLab.Core.Views; 4 4 using HeuristicLab.MainForm; 5 using HeuristicLab. Problems.BinPacking.PackingPlans;5 using HeuristicLab.Encodings.PackingEncoding.PackingPlan; 6 6 using HeuristicLab.Problems.BinPacking.Interfaces; 7 7 using HeuristicLab.Problems.BinPacking.PackingItem; … … 13 13 namespace HeuristicLab.Problems.BinPacking.Views { 14 14 [View("2-dimensional packing plan View")] 15 [Content(typeof( RegularSimpleRotationPackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>), true)]15 [Content(typeof(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>), true)] 16 16 public partial class PackingPlan2DView : NamedItemView { 17 17 … … 21 21 22 22 23 public new RegularSimpleRotationPackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> Content {24 get { return ( RegularSimpleRotationPackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>)base.Content; }23 public new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> Content { 24 get { return (PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>)base.Content; } 25 25 set { base.Content = value; } 26 26 } … … 44 44 } 45 45 46 private void Redraw( RegularSimpleRotationPackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) {46 private void Redraw(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) { 47 47 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0; 48 48 var bin = plan.PackingBinMeasures; … … 52 52 var position = plan.PackingItemPositions[i++]; 53 53 if (position.AssignedBin == currentBin) 54 packingPlan2D.AddItemToContainer(item.Width, item.Height, position.X, position.Y, i.ToString()); 54 packingPlan2D.AddItemToContainer( 55 position.Rotated ? item.Height : item.Width, 56 position.Rotated ? item.Width : item.Height, 57 position.X, position.Y, i.ToString()); 55 58 } 56 59 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan3DView.cs
r9348 r9440 3 3 using HeuristicLab.Core.Views; 4 4 using HeuristicLab.MainForm; 5 using HeuristicLab. Problems.BinPacking.PackingPlans;5 using HeuristicLab.Encodings.PackingEncoding.PackingPlan; 6 6 using HeuristicLab.Problems.BinPacking.Interfaces; 7 7 using HeuristicLab.Problems.BinPacking.PackingItem; … … 13 13 namespace HeuristicLab.Problems.BinPacking.Views { 14 14 [View("3-dimensional packing plan View")] 15 [Content(typeof( RegularSimpleRotationPackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>), true)]15 [Content(typeof(PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>), true)] 16 16 public partial class PackingPlan3DView : NamedItemView { 17 17 … … 22 22 23 23 24 public new RegularSimpleRotationPackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Content {25 get { return ( RegularSimpleRotationPackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>)base.Content; }24 public new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Content { 25 get { return (PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>)base.Content; } 26 26 set { base.Content = value; } 27 27 } … … 51 51 var position = Content.PackingItemPositions[i]; 52 52 if (position.AssignedBin == currentBin) 53 packingPlan3D.AddItemToContainer(item.Width, item.Height, item.Depth, position.X, position.Y, position.Z, i); 53 packingPlan3D.AddItemToContainer( 54 position.Rotated ? item.Depth : item.Width, 55 item.Height, 56 position.Rotated ? item.Width : item.Depth, 57 position.X, position.Y, position.Z, i); 54 58 i++; 55 59 } … … 76 80 itemSelection.Items.Add(i); 77 81 } 78 itemSelection.Items.Add("enum");82 //itemSelection.Items.Add("enum"); 79 83 80 84 packingPlan3D.Invalidate();
Note: See TracChangeset
for help on using the changeset viewer.