using System; using System.Windows.Forms; using HeuristicLab.Core.Views; using HeuristicLab.MainForm; using HeuristicLab.Encodings.PackingEncoding.PackingPlan; using HeuristicLab.Problems.BinPacking.Interfaces; using HeuristicLab.Problems.BinPacking.Shapes; namespace HeuristicLab.Problems.BinPacking.Views { [View("View for a cuboid shape.")] [Content(typeof(CuboidPackingShape), true)] public partial class CuboidPackingShapeView : NamedItemView { public CuboidPackingShapeView() { InitializeComponent(); } public new CuboidPackingShape Content { get { return (CuboidPackingShape)base.Content; } set { base.Content = value; } } protected override void OnContentChanged() { base.OnContentChanged(); if (Content == null) { Redraw(); } else { Redraw(Content); Content.Name = "XX"; packingPlan3D1.StartRendering(); } } private void Redraw() { packingPlan3D1.InitializeContainer(0,0,0); } private void Redraw(CuboidPackingShape shape) { packingPlan3D1.InitializeContainer(shape.Width, shape.Height, shape.Depth); } } }