Changeset 13466
- Timestamp:
- 12/14/15 20:34:00 (9 years ago)
- Location:
- branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/HeuristicLab.Problems.BinPacking.Views-3.3.csproj
r13464 r13466 199 199 </ProjectReference> 200 200 </ItemGroup> 201 <ItemGroup />202 201 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 203 202 <PropertyGroup> -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan2DView.cs
r13465 r13466 35 35 public PackingPlan2DView() { 36 36 InitializeComponent(); 37 } 37 } 38 38 39 39 protected override void DeregisterContentEvents() { … … 57 57 binSelection.Items.Clear(); 58 58 if (Content == null) { 59 Redraw();59 ClearState(); 60 60 } else { 61 61 for (int i = 0; i < Content.NrOfBins; i++) 62 62 binSelection.Items.Add(i); 63 Redraw(Content);63 UpdateState(Content); 64 64 } 65 65 } 66 66 67 67 68 private void Redraw() {68 private void ClearState() { 69 69 packingPlan2D.InitializeContainer(0, 0); 70 70 } 71 71 72 private void Redraw(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) {72 private void UpdateState(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) { 73 73 int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0; 74 74 var bin = plan.BinPackings[currentBin].BinMeasures; … … 84 84 85 85 private void binSelection_SelectedIndexChanged(object sender, EventArgs e) { 86 Redraw(Content);86 UpdateState(Content); 87 87 packingPlan2D.Refresh(); 88 88 } … … 96 96 binSelection.Items.Clear(); 97 97 if (Content == null) { 98 Redraw();98 ClearState(); 99 99 } else { 100 100 for (int i = 0; i < Content.NrOfBins; i++) 101 101 binSelection.Items.Add(i); 102 Redraw(Content);102 UpdateState(Content); 103 103 } 104 104 packingPlan2D.Refresh(); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingItemView.Designer.cs
r13461 r13466 48 48 /// </summary> 49 49 private void InitializeComponent() { 50 this.packingPlan3D 1= new PackingPlanVisualizations.PackingPlan3D();50 this.packingPlan3D = new PackingPlanVisualizations.PackingPlan3D(); 51 51 this.SuspendLayout(); 52 52 // 53 // packingPlan3D 153 // packingPlan3D 54 54 // 55 this.packingPlan3D1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 56 | System.Windows.Forms.AnchorStyles.Left) 57 | System.Windows.Forms.AnchorStyles.Right))); 58 this.packingPlan3D1.Location = new System.Drawing.Point(6, 20); 59 this.packingPlan3D1.Name = "packingPlan3D1"; 60 this.packingPlan3D1.Size = new System.Drawing.Size(342, 276); 61 this.packingPlan3D1.TabIndex = 3; 55 this.packingPlan3D.Dock = System.Windows.Forms.DockStyle.Fill; 56 this.packingPlan3D.Location = new System.Drawing.Point(0, 0); 57 this.packingPlan3D.Name = "packingPlan3D"; 58 this.packingPlan3D.Size = new System.Drawing.Size(351, 299); 59 this.packingPlan3D.TabIndex = 3; 62 60 // 63 // CuboidPacking ShapeView61 // CuboidPackingItemView 64 62 // 65 63 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 66 this.Controls.Add(this.packingPlan3D 1);67 this.Name = "CuboidPacking ShapeView";64 this.Controls.Add(this.packingPlan3D); 65 this.Name = "CuboidPackingItemView"; 68 66 this.Size = new System.Drawing.Size(351, 299); 69 this.Controls.SetChildIndex(this.packingPlan3D1, 0);70 67 this.ResumeLayout(false); 71 this.PerformLayout();72 68 73 69 } … … 75 71 #endregion 76 72 77 private PackingPlanVisualizations.PackingPlan3D packingPlan3D 1;73 private PackingPlanVisualizations.PackingPlan3D packingPlan3D; 78 74 79 75 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingItemView.cs
r13464 r13466 43 43 } else { 44 44 Redraw(Content); 45 packingPlan3D 1.StartRendering();45 packingPlan3D.StartRendering(); 46 46 } 47 47 } 48 48 49 49 private void Redraw() { 50 packingPlan3D 1.InitializeContainer(0, 0, 0);50 packingPlan3D.InitializeContainer(0, 0, 0); 51 51 } 52 52 53 53 private void Redraw(CuboidPackingItem item) { 54 packingPlan3D 1.InitializeContainer(item.TargetBin.Width, item.TargetBin.Height, item.TargetBin.Depth);55 packingPlan3D 1.AddItemToContainer(item.Width, item.Height, item.Depth, 0, 0, 0, 0);54 packingPlan3D.InitializeContainer(item.TargetBin.Width, item.TargetBin.Height, item.TargetBin.Depth); 55 packingPlan3D.AddItemToContainer(item.Width, item.Height, item.Depth, 0, 0, 0, 0); 56 56 } 57 57 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingShapeView.Designer.cs
r13461 r13466 48 48 /// </summary> 49 49 private void InitializeComponent() { 50 this.packingPlan3D 1= new PackingPlanVisualizations.PackingPlan3D();50 this.packingPlan3D = new PackingPlanVisualizations.PackingPlan3D(); 51 51 this.SuspendLayout(); 52 52 // 53 // packingPlan3D 153 // packingPlan3D 54 54 // 55 this.packingPlan3D1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 56 | System.Windows.Forms.AnchorStyles.Left) 57 | System.Windows.Forms.AnchorStyles.Right))); 58 this.packingPlan3D1.Location = new System.Drawing.Point(6, 20); 59 this.packingPlan3D1.Name = "packingPlan3D1"; 60 this.packingPlan3D1.Size = new System.Drawing.Size(342, 276); 61 this.packingPlan3D1.TabIndex = 3; 55 this.packingPlan3D.Dock = System.Windows.Forms.DockStyle.Fill; 56 this.packingPlan3D.Location = new System.Drawing.Point(0, 0); 57 this.packingPlan3D.Name = "packingPlan3D"; 58 this.packingPlan3D.Size = new System.Drawing.Size(351, 299); 59 this.packingPlan3D.TabIndex = 3; 62 60 // 63 61 // CuboidPackingShapeView 64 62 // 65 63 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 66 this.Controls.Add(this.packingPlan3D 1);64 this.Controls.Add(this.packingPlan3D); 67 65 this.Name = "CuboidPackingShapeView"; 68 66 this.Size = new System.Drawing.Size(351, 299); 69 this.Controls.SetChildIndex(this.packingPlan3D1, 0);70 67 this.ResumeLayout(false); 71 this.PerformLayout();72 68 73 69 } … … 75 71 #endregion 76 72 77 private PackingPlanVisualizations.PackingPlan3D packingPlan3D 1;73 private PackingPlanVisualizations.PackingPlan3D packingPlan3D; 78 74 79 75 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingShapeView.cs
r13464 r13466 43 43 } else { 44 44 Redraw(Content); 45 packingPlan3D 1.StartRendering();45 packingPlan3D.StartRendering(); 46 46 } 47 47 } 48 48 49 49 private void Redraw() { 50 packingPlan3D 1.InitializeContainer(0, 0, 0);50 packingPlan3D.InitializeContainer(0, 0, 0); 51 51 } 52 52 53 53 private void Redraw(CuboidPackingShape shape) { 54 packingPlan3D 1.InitializeContainer(shape.Width, shape.Height, shape.Depth);54 packingPlan3D.InitializeContainer(shape.Width, shape.Height, shape.Depth); 55 55 } 56 56 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingItemView.Designer.cs
r13461 r13466 50 50 // packingPlan2D 51 51 // 52 this.packingPlan2D.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 53 | System.Windows.Forms.AnchorStyles.Left) 54 | System.Windows.Forms.AnchorStyles.Right))); 55 this.packingPlan2D.Location = new System.Drawing.Point(3, 29); 52 this.packingPlan2D.Dock = System.Windows.Forms.DockStyle.Fill; 53 this.packingPlan2D.Location = new System.Drawing.Point(0, 0); 56 54 this.packingPlan2D.Name = "packingPlan2D"; 57 this.packingPlan2D.Size = new System.Drawing.Size(3 45, 270);55 this.packingPlan2D.Size = new System.Drawing.Size(351, 299); 58 56 this.packingPlan2D.TabIndex = 4; 59 57 // 60 // PackingPlanView58 // RectangularPackingItemView 61 59 // 62 60 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 63 61 this.Controls.Add(this.packingPlan2D); 64 this.Name = " PackingPlanView";62 this.Name = "RectangularPackingItemView"; 65 63 this.Size = new System.Drawing.Size(351, 299); 66 this.Controls.SetChildIndex(this.packingPlan2D, 0);67 64 this.ResumeLayout(false); 68 this.PerformLayout();69 65 70 66 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingItemView.cs
r13464 r13466 40 40 base.OnContentChanged(); 41 41 if (Content == null) { 42 Redraw();42 ClearState(); 43 43 } else { 44 Redraw(Content);44 UpdateState(Content); 45 45 } 46 46 } 47 47 48 private void Redraw() {48 private void ClearState() { 49 49 packingPlan2D.InitializeContainer(0, 0); 50 50 } 51 51 52 private void Redraw(RectangularPackingItem item) {52 private void UpdateState(RectangularPackingItem item) { 53 53 packingPlan2D.InitializeContainer(item.TargetBin.Width, item.TargetBin.Height); 54 54 packingPlan2D.AddItemToContainer(item.Width, item.Height, 0, 0, "0"); -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingShapeView.Designer.cs
r13461 r13466 50 50 // packingPlan2D 51 51 // 52 this.packingPlan2D.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 53 | System.Windows.Forms.AnchorStyles.Left) 54 | System.Windows.Forms.AnchorStyles.Right))); 55 this.packingPlan2D.Location = new System.Drawing.Point(3, 29); 52 this.packingPlan2D.Dock = System.Windows.Forms.DockStyle.Fill; 53 this.packingPlan2D.Location = new System.Drawing.Point(0, 0); 56 54 this.packingPlan2D.Name = "packingPlan2D"; 57 this.packingPlan2D.Size = new System.Drawing.Size(3 45, 270);55 this.packingPlan2D.Size = new System.Drawing.Size(351, 299); 58 56 this.packingPlan2D.TabIndex = 4; 59 57 // 60 // PackingPlanView58 // RectangularPackingShapeView 61 59 // 62 60 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 63 61 this.Controls.Add(this.packingPlan2D); 64 this.Name = " PackingPlanView";62 this.Name = "RectangularPackingShapeView"; 65 63 this.Size = new System.Drawing.Size(351, 299); 66 this.Controls.SetChildIndex(this.packingPlan2D, 0);67 64 this.ResumeLayout(false); 68 this.PerformLayout();69 65 70 66 } -
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingShapeView.cs
r13465 r13466 40 40 base.OnContentChanged(); 41 41 if (Content == null) { 42 Redraw();42 ClearState(); 43 43 } else { 44 Redraw(Content);44 UpdateState(Content); 45 45 } 46 46 } 47 47 48 49 private void Redraw() { 48 private void ClearState() { 50 49 packingPlan2D.InitializeContainer(0, 0); 51 50 } 52 51 53 private void Redraw(RectangularPackingShape shape) {52 private void UpdateState(RectangularPackingShape shape) { 54 53 packingPlan2D.InitializeContainer(shape.Width, shape.Height); 55 54 }
Note: See TracChangeset
for help on using the changeset viewer.