Changeset 13558 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans
- Timestamp:
- 01/20/16 13:08:13 (9 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/PackingPlan3DView.Designer.cs
r13532 r13558 82 82 this.elementHost.Size = new System.Drawing.Size(229, 290); 83 83 this.elementHost.TabIndex = 6; 84 this.elementHost.Text = "elementHost 1";84 this.elementHost.Text = "elementHost"; 85 85 this.elementHost.Child = this.packingPlan3D; 86 86 // -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan3DView.cs
r13532 r13558 37 37 } 38 38 39 40 protected override void DeregisterContentEvents() {41 base.DeregisterContentEvents();42 }43 protected override void RegisterContentEvents() {44 base.RegisterContentEvents();45 }46 47 39 public new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> Content { 48 40 get { return (PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>)base.Content; } … … 55 47 binSelection.Items.Clear(); 56 48 if (Content == null) { 57 packingPlan3D.Clear();49 packingPlan3D.Packing = null; 58 50 } else { 59 51 int i = 0; … … 62 54 63 55 binSelection.SelectedIndex = 0; 64 UpdateModel(); 65 packingPlan3D.Focus(); // for mouse wheel? 66 // packingPlan3D.StartRendering(); 56 ShowSelectedPacking(); 67 57 } 68 58 } 69 59 70 private void UpdateModel() {60 private void ShowSelectedPacking() { 71 61 int currentBin = (binSelection != null) ? (int)(binSelection.SelectedIndex) : 0; 72 packingPlan3D.ShowContainer(Content.BinPackings[currentBin]); 73 // var bin = Content.BinPackings[currentBin].BinMeasures; 74 // // packingPlan3D.InitializeContainer(bin.Width, bin.Height, bin.Depth); 75 // foreach (var entry in Content.BinPackings[currentBin].ItemMeasures) { 76 // var position = Content.BinPackings[currentBin].ItemPositions[entry.Key]; 77 // packingPlan3D.AddItemToContainer( 78 // position.Rotated ? entry.Value.Depth : entry.Value.Width, 79 // entry.Value.Height, 80 // position.Rotated ? entry.Value.Width : entry.Value.Depth, 81 // position.X, position.Y, position.Z, entry.Key, entry.Value.Material); 82 // } 62 packingPlan3D.Packing = Content.BinPackings[currentBin]; 83 63 } 84 64 85 65 private void binSelection_SelectedIndexChanged(object sender, EventArgs e) { 86 UpdateModel();87 88 66 itemSelection.SelectedIndex = -1; 89 67 itemSelection.Items.Clear(); 68 69 // add items of this container 90 70 int currentBin = (binSelection != null) ? (int)(binSelection.SelectedIndex) : 0; 91 packingPlan3D.ShowContainer(Content.BinPackings[currentBin]); 71 var packing = Content.BinPackings[currentBin]; 72 foreach (var item in packing.ItemMeasures) { 73 itemSelection.Items.Add(item.Key); 74 } 92 75 76 ShowSelectedPacking(); 93 77 } 94 78 95 79 private void itemSelection_SelectedIndexChanged(object sender, EventArgs e) { 96 UpdateModel();97 98 80 int selectedItem = -1; 99 81 if ((itemSelection != null && itemSelection.SelectedItem != null) && Int32.TryParse(itemSelection.SelectedItem.ToString(), out selectedItem)) { … … 102 84 packingPlan3D.ClearSelection(); 103 85 } 104 105 // private void Content_QualityChanged(object sender, EventArgs e) {106 // if (InvokeRequired)107 // Invoke(new EventHandler(Content_QualityChanged), sender, e);108 // else {109 // binSelection.Items.Clear();110 // if (Content == null) {111 // packingPlan3D.InitializeContainer(0, 0, 0);112 // } else {113 // int i = 0;114 // foreach (var bp in Content.BinPackings)115 // binSelection.Items.Add(i++ + " (" + Math.Round(bp.PackingDensity * 100, 2) + "%)");116 // binSelection.SelectedIndex = 0;117 // UpdateModel();118 // // packingPlan3D.StartRendering();119 // }120 // }121 // }122 86 } 123 87 }
Note: See TracChangeset
for help on using the changeset viewer.