Ignore:
Timestamp:
01/12/16 10:42:58 (5 years ago)
Author:
gkronber
Message:

#1966: fixed various problems: bugs in cloning, bugs in persistence, method names, various minor improvements of source code for readability.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/CenteredContainer.cs

    r13465 r13497  
    2727
    2828  public class CenteredContainer {
    29     private readonly BasicCuboidShape container;
    30     private readonly List<BasicCuboidShape> packingItems;
     29    public BasicCuboidShape Container { get; private set; }
     30    public List<BasicCuboidShape> PackingItems { get; private set; }
     31
    3132    private readonly float normalizingFactor;
    3233
    3334    public CenteredContainer(BasicCuboidShape container) {
    3435      normalizingFactor = CalculateNormalizingFactor(container);
    35       this.container = Normalize (container);
    36       packingItems = new List<BasicCuboidShape>();
     36      Container = Normalize(container);
     37      PackingItems = new List<BasicCuboidShape>();
    3738    }
    3839
     
    4546    }
    4647
    47 
    48 
    49     public BasicCuboidShape Container {
    50       get { return container; }
    51     }
    52     public List<BasicCuboidShape> PackingItems {
    53       get { return packingItems; }
    54     }
    55 
    56 
    5748    public void AddPackingItem(Vector3 size, Vector3 position, int index, int material) {
    58       Vector3 itemSize = size * normalizingFactor;
    59       Vector3 itemPosition = position * normalizingFactor;
    60       Vector3 actualPosition = container.CalculatePositionRelativeToBottomLeftBackCorner(itemSize, itemPosition);
    61       BasicCuboidShape itemShape = new BasicCuboidShape(itemSize, actualPosition, index, material);
    62       packingItems.Add(itemShape);
     49      var itemSize = size * normalizingFactor;
     50      var itemPosition = position * normalizingFactor;
     51      var actualPosition = Container.CalculatePositionRelativeToBottomLeftBackCorner(itemSize, itemPosition);
     52      var itemShape = new BasicCuboidShape(itemSize, actualPosition, index, material);
     53      PackingItems.Add(itemShape);
    6354    }
    6455  }
Note: See TracChangeset for help on using the changeset viewer.