Last change
on this file since 11552 was
9440,
checked in by jhelm, 12 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 | |
---|
1 | using System;
|
---|
2 | using System.Windows.Forms;
|
---|
3 | using HeuristicLab.Core.Views;
|
---|
4 | using HeuristicLab.MainForm;
|
---|
5 | using HeuristicLab.Encodings.PackingEncoding.PackingPlan;
|
---|
6 | using HeuristicLab.Problems.BinPacking.Interfaces;
|
---|
7 | using HeuristicLab.Problems.BinPacking.Shapes;
|
---|
8 | using HeuristicLab.Problems.BinPacking.PackingItem;
|
---|
9 |
|
---|
10 | namespace 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.