Changeset 9593 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans
- Timestamp:
- 06/06/13 03:12:42 (11 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
r9495 r9593 55 55 private void Redraw(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) { 56 56 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0; 57 var bin = plan. GetPackingBinMeasuresForBinNr(currentBin);57 var bin = plan.BinPackings[currentBin].BinMeasures; 58 58 packingPlan2D.InitializeContainer(bin.Width, bin.Height); 59 int i = 0; 60 foreach (var item in plan.PackingItemMeasures) { 61 var position = plan.PackingItemPositions[i++]; 62 if (position.AssignedBin == currentBin) 59 foreach (var entry in plan.BinPackings[currentBin].ItemMeasures) { 60 var position = plan.BinPackings[currentBin].ItemPositions[entry.Key]; 63 61 packingPlan2D.AddItemToContainer( 64 position.Rotated ? item.Height : item.Width,65 position.Rotated ? item.Width : item.Height,66 position.X, position.Y, i.ToString());62 position.Rotated ? entry.Value.Height : entry.Value.Width, 63 position.Rotated ? entry.Value.Width : entry.Value.Height, 64 position.X, position.Y, entry.Key.ToString()); 67 65 } 68 66 } … … 70 68 private void binSelection_SelectedIndexChanged(object sender, EventArgs e) { 71 69 Redraw(Content); 72 packingPlan2D.Invalidate(); 73 packingPlan2D.Update(); 70 packingPlan2D.Refresh(); 71 packingPlan2D.Refresh(); 72 packingPlan2D.Refresh(); 73 packingPlan2D.Refresh(); 74 packingPlan2D.Refresh(); 74 75 } 75 76 … … 88 89 Redraw(Content); 89 90 } 90 packingPlan2D.Invalidate(); 91 packingPlan2D.Update(); 91 packingPlan2D.Refresh(); 92 packingPlan2D.Refresh(); 93 packingPlan2D.Refresh(); 94 packingPlan2D.Refresh(); 95 packingPlan2D.Refresh(); 92 96 } 93 97 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan3DView.cs
r9495 r9593 54 54 private void UpdateModel() { 55 55 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0; 56 var bin = Content. GetPackingBinMeasuresForBinNr(currentBin);56 var bin = Content.BinPackings[currentBin].BinMeasures; 57 57 packingPlan3D.InitializeContainer(bin.Width, bin.Height, bin.Depth); 58 int i = 0; 59 foreach (var item in Content.PackingItemMeasures) { 60 var position = Content.PackingItemPositions[i]; 61 if (position.AssignedBin == currentBin) 62 packingPlan3D.AddItemToContainer( 63 position.Rotated ? item.Depth : item.Width, 64 item.Height, 65 position.Rotated ? item.Width : item.Depth, 66 position.X, position.Y, position.Z, i); 67 i++; 58 foreach (var entry in Content.BinPackings[currentBin].ItemMeasures) { 59 var position = Content.BinPackings[currentBin].ItemPositions[entry.Key]; 60 packingPlan3D.AddItemToContainer( 61 position.Rotated ? entry.Value.Depth : entry.Value.Width, 62 entry.Value.Height, 63 position.Rotated ? entry.Value.Width : entry.Value.Depth, 64 position.X, position.Y, position.Z, entry.Key, entry.Value.Material); 68 65 } 69 66 } … … 75 72 itemSelection.Items.Clear(); 76 73 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0; 77 for (int i = 0; i < Content.PackingItemPositions.Count; i++) { 78 if (Content.PackingItemPositions[i].AssignedBin == currentBin) 79 itemSelection.Items.Add(i); 74 //for (int i = 0; i < Content.PackingItemPositions.Count; i++) { 75 // if (Content.PackingItemPositions[i].AssignedBin == currentBin) 76 // itemSelection.Items.Add(i); 77 //} 78 foreach (var entry in Content.BinPackings[currentBin].ItemMeasures) { 79 itemSelection.Items.Add(entry.Key); 80 80 } 81 81
Note: See TracChangeset
for help on using the changeset viewer.