Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.Views/3.3/Shapes/CuboidPackingShapeView.cs @ 9584

Last change on this file since 9584 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.2 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;
8
9namespace HeuristicLab.Problems.BinPacking.Views {
10  [View("View for a cuboid shape.")]
11  [Content(typeof(CuboidPackingShape), true)]
12  public partial class CuboidPackingShapeView : NamedItemView {
13    public CuboidPackingShapeView() {
14      InitializeComponent();
15    }
16
17
18    public new CuboidPackingShape Content {
19      get { return (CuboidPackingShape)base.Content; }
20      set { base.Content = value; }
21    }
22
23
24    protected override void OnContentChanged() {
25      base.OnContentChanged();
26      if (Content == null) {
27        Redraw();
28      } else {
29        Redraw(Content);
30        Content.Name = "XX";
31        packingPlan3D1.StartRendering();
32      }
33    }
34
35
36    private void Redraw() {
37      packingPlan3D1.InitializeContainer(0,0,0);
38    }
39
40    private void Redraw(CuboidPackingShape shape) {
41      packingPlan3D1.InitializeContainer(shape.Width, shape.Height, shape.Depth);
42    }
43  }
44}
Note: See TracBrowser for help on using the repository browser.