Changeset 13466


Ignore:
Timestamp:
12/14/15 20:34:00 (5 years ago)
Author:
gkronber
Message:

#1966: docking of controls in (Cuboid|Rectangular)(PackingShape|PackingItem)View

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  
    199199    </ProjectReference>
    200200  </ItemGroup>
    201   <ItemGroup />
    202201  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    203202  <PropertyGroup>
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/PackingPlans/PackingPlan2DView.cs

    r13465 r13466  
    3535    public PackingPlan2DView() {
    3636      InitializeComponent();
    37     }       
     37    }
    3838
    3939    protected override void DeregisterContentEvents() {
     
    5757      binSelection.Items.Clear();
    5858      if (Content == null) {
    59         Redraw();
     59        ClearState();
    6060      } else {
    6161        for (int i = 0; i < Content.NrOfBins; i++)
    6262          binSelection.Items.Add(i);
    63         Redraw(Content);
     63        UpdateState(Content);
    6464      }
    6565    }
    6666
    6767
    68     private void Redraw() {
     68    private void ClearState() {
    6969      packingPlan2D.InitializeContainer(0, 0);
    7070    }
    7171
    72     private void Redraw(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) {     
     72    private void UpdateState(PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> plan) {     
    7373      int currentBin = (binSelection != null && binSelection.SelectedItem != null) ? (int)(binSelection.SelectedItem) : 0;
    7474      var bin = plan.BinPackings[currentBin].BinMeasures;
     
    8484
    8585    private void binSelection_SelectedIndexChanged(object sender, EventArgs e) {
    86       Redraw(Content);
     86      UpdateState(Content);
    8787      packingPlan2D.Refresh();
    8888    }
     
    9696        binSelection.Items.Clear();
    9797        if (Content == null) {
    98           Redraw();
     98          ClearState();
    9999        } else {
    100100          for (int i = 0; i < Content.NrOfBins; i++)
    101101            binSelection.Items.Add(i);
    102           Redraw(Content);
     102          UpdateState(Content);
    103103        }
    104104        packingPlan2D.Refresh();
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingItemView.Designer.cs

    r13461 r13466  
    4848    /// </summary>
    4949    private void InitializeComponent() {
    50       this.packingPlan3D1 = new PackingPlanVisualizations.PackingPlan3D();
     50      this.packingPlan3D = new PackingPlanVisualizations.PackingPlan3D();
    5151      this.SuspendLayout();
    5252      //
    53       // packingPlan3D1
     53      // packingPlan3D
    5454      //
    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;
    6260      //
    63       // CuboidPackingShapeView
     61      // CuboidPackingItemView
    6462      //
    6563      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    66       this.Controls.Add(this.packingPlan3D1);
    67       this.Name = "CuboidPackingShapeView";
     64      this.Controls.Add(this.packingPlan3D);
     65      this.Name = "CuboidPackingItemView";
    6866      this.Size = new System.Drawing.Size(351, 299);
    69       this.Controls.SetChildIndex(this.packingPlan3D1, 0);
    7067      this.ResumeLayout(false);
    71       this.PerformLayout();
    7268
    7369    }
     
    7571    #endregion
    7672
    77     private PackingPlanVisualizations.PackingPlan3D packingPlan3D1;
     73    private PackingPlanVisualizations.PackingPlan3D packingPlan3D;
    7874
    7975  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingItemView.cs

    r13464 r13466  
    4343      } else {
    4444        Redraw(Content);
    45         packingPlan3D1.StartRendering();
     45        packingPlan3D.StartRendering();
    4646      }
    4747    }
    4848
    4949    private void Redraw() {
    50       packingPlan3D1.InitializeContainer(0, 0, 0);
     50      packingPlan3D.InitializeContainer(0, 0, 0);
    5151    }
    5252
    5353    private void Redraw(CuboidPackingItem item) {
    54       packingPlan3D1.InitializeContainer(item.TargetBin.Width, item.TargetBin.Height, item.TargetBin.Depth);
    55       packingPlan3D1.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);
    5656    }
    5757  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingShapeView.Designer.cs

    r13461 r13466  
    4848    /// </summary>
    4949    private void InitializeComponent() {
    50       this.packingPlan3D1 = new PackingPlanVisualizations.PackingPlan3D();
     50      this.packingPlan3D = new PackingPlanVisualizations.PackingPlan3D();
    5151      this.SuspendLayout();
    5252      //
    53       // packingPlan3D1
     53      // packingPlan3D
    5454      //
    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;
    6260      //
    6361      // CuboidPackingShapeView
    6462      //
    6563      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    66       this.Controls.Add(this.packingPlan3D1);
     64      this.Controls.Add(this.packingPlan3D);
    6765      this.Name = "CuboidPackingShapeView";
    6866      this.Size = new System.Drawing.Size(351, 299);
    69       this.Controls.SetChildIndex(this.packingPlan3D1, 0);
    7067      this.ResumeLayout(false);
    71       this.PerformLayout();
    7268
    7369    }
     
    7571    #endregion
    7672
    77     private PackingPlanVisualizations.PackingPlan3D packingPlan3D1;
     73    private PackingPlanVisualizations.PackingPlan3D packingPlan3D;
    7874
    7975  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingShapeView.cs

    r13464 r13466  
    4343      } else {
    4444        Redraw(Content);
    45         packingPlan3D1.StartRendering();
     45        packingPlan3D.StartRendering();
    4646      }
    4747    }
    4848
    4949    private void Redraw() {
    50       packingPlan3D1.InitializeContainer(0, 0, 0);
     50      packingPlan3D.InitializeContainer(0, 0, 0);
    5151    }
    5252
    5353    private void Redraw(CuboidPackingShape shape) {
    54       packingPlan3D1.InitializeContainer(shape.Width, shape.Height, shape.Depth);
     54      packingPlan3D.InitializeContainer(shape.Width, shape.Height, shape.Depth);
    5555    }
    5656  }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingItemView.Designer.cs

    r13461 r13466  
    5050      // packingPlan2D
    5151      //
    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);
    5654      this.packingPlan2D.Name = "packingPlan2D";
    57       this.packingPlan2D.Size = new System.Drawing.Size(345, 270);
     55      this.packingPlan2D.Size = new System.Drawing.Size(351, 299);
    5856      this.packingPlan2D.TabIndex = 4;
    5957      //
    60       // PackingPlanView
     58      // RectangularPackingItemView
    6159      //
    6260      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    6361      this.Controls.Add(this.packingPlan2D);
    64       this.Name = "PackingPlanView";
     62      this.Name = "RectangularPackingItemView";
    6563      this.Size = new System.Drawing.Size(351, 299);
    66       this.Controls.SetChildIndex(this.packingPlan2D, 0);
    6764      this.ResumeLayout(false);
    68       this.PerformLayout();
    6965
    7066    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingItemView.cs

    r13464 r13466  
    4040      base.OnContentChanged();
    4141      if (Content == null) {
    42         Redraw();
     42        ClearState();
    4343      } else {
    44         Redraw(Content);
     44        UpdateState(Content);
    4545      }
    4646    }
    4747
    48     private void Redraw() {
     48    private void ClearState() {
    4949      packingPlan2D.InitializeContainer(0, 0);
    5050    }
    5151
    52     private void Redraw(RectangularPackingItem item) {
     52    private void UpdateState(RectangularPackingItem item) {
    5353      packingPlan2D.InitializeContainer(item.TargetBin.Width, item.TargetBin.Height);
    5454      packingPlan2D.AddItemToContainer(item.Width, item.Height, 0, 0, "0");
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingShapeView.Designer.cs

    r13461 r13466  
    5050      // packingPlan2D
    5151      //
    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);
    5654      this.packingPlan2D.Name = "packingPlan2D";
    57       this.packingPlan2D.Size = new System.Drawing.Size(345, 270);
     55      this.packingPlan2D.Size = new System.Drawing.Size(351, 299);
    5856      this.packingPlan2D.TabIndex = 4;
    5957      //
    60       // PackingPlanView
     58      // RectangularPackingShapeView
    6159      //
    6260      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    6361      this.Controls.Add(this.packingPlan2D);
    64       this.Name = "PackingPlanView";
     62      this.Name = "RectangularPackingShapeView";
    6563      this.Size = new System.Drawing.Size(351, 299);
    66       this.Controls.SetChildIndex(this.packingPlan2D, 0);
    6764      this.ResumeLayout(false);
    68       this.PerformLayout();
    6965
    7066    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/RectangularPackingShapeView.cs

    r13465 r13466  
    4040      base.OnContentChanged();
    4141      if (Content == null) {
    42         Redraw();
     42        ClearState();
    4343      } else {
    44         Redraw(Content);
     44        UpdateState(Content);
    4545      }
    4646    }
    4747
    48 
    49     private void Redraw() {
     48    private void ClearState() {
    5049      packingPlan2D.InitializeContainer(0, 0);
    5150    }
    5251
    53     private void Redraw(RectangularPackingShape shape) {
     52    private void UpdateState(RectangularPackingShape shape) {
    5453      packingPlan2D.InitializeContainer(shape.Width, shape.Height);
    5554    }
Note: See TracChangeset for help on using the changeset viewer.