Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingItemView.cs @ 9440

Last change on this file since 9440 was 9440, checked in by jhelm, 11 years ago

#1966: Implemented new encoding (MultiComponentVector/MCV); Implemented move-operators for MCV and GV encodings; Implemented new decoding-methods for PS, GV and MCV encodings (ExtremePoint-based packing);

File size: 1.3 KB
Line 
1using System;
2using System.Windows.Forms;
3using HeuristicLab.Core.Views;
4using HeuristicLab.MainForm;
5using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
6using HeuristicLab.Problems.BinPacking.Interfaces;
7using HeuristicLab.Problems.BinPacking.Shapes;
8using HeuristicLab.Problems.BinPacking.PackingItem;
9
10namespace HeuristicLab.Problems.BinPacking.Views {
11  [View("View for a cuboid packing item.")]
12  [Content(typeof(CuboidPackingItem), true)]
13  public partial class CuboidPackingItemView : NamedItemView {
14    public CuboidPackingItemView() {
15      InitializeComponent();
16    }
17
18
19    public new CuboidPackingItem Content {
20      get { return (CuboidPackingItem)base.Content; }
21      set { base.Content = value; }
22    }
23
24
25    protected override void OnContentChanged() {
26      base.OnContentChanged();
27      if (Content == null) {
28        Redraw();
29      } else {
30        Redraw(Content);
31        packingPlan3D1.StartRendering();
32      }
33    }
34
35
36    private void Redraw() {
37      packingPlan3D1.InitializeContainer(0,0,0);
38    }
39
40    private void Redraw(CuboidPackingItem item) {
41      packingPlan3D1.InitializeContainer(item.TargetBin.Width, item.TargetBin.Height, item.TargetBin.Depth);
42      packingPlan3D1.AddItemToContainer(item.Width, item.Height, item.Depth, 0, 0, 0, 0);
43    }
44  }
45}
Note: See TracBrowser for help on using the repository browser.