Changeset 14048 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/CuboidPackingShape.cs
- Timestamp:
- 07/12/16 19:54:35 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/CuboidPackingShape.cs
r14046 r14048 31 31 [Item("CuboidPackingShape", "Represents the cuboid measures (width, height, depth) of a three-dimensional cuboidic bin-packing object.")] 32 32 [StorableClass] 33 public class CuboidPackingShape : PackingShape< ThreeDimensionalPacking>, IComparable<CuboidPackingShape> {33 public class CuboidPackingShape : PackingShape<PackingPosition>, IComparable<CuboidPackingShape> { 34 34 public IFixedValueParameter<IntValue> HeightParameter { 35 35 get { return (IFixedValueParameter<IntValue>)Parameters["Height"]; } … … 128 128 public int y2; 129 129 public int z2; 130 public CuboidDiagonal(CuboidPackingShape myShape) : this(new ThreeDimensionalPacking(0, 0, 0, 0), myShape) { }131 public CuboidDiagonal( ThreeDimensionalPackingmyPosition, CuboidPackingShape myShape) {130 public CuboidDiagonal(CuboidPackingShape myShape) : this(new PackingPosition(0, 0, 0, 0), myShape) { } 131 public CuboidDiagonal(PackingPosition myPosition, CuboidPackingShape myShape) { 132 132 x1 = myPosition.X; 133 133 y1 = myPosition.Y; … … 141 141 142 142 #region Helpers 143 public override ThreeDimensionalPacking Origin { get { return new ThreeDimensionalPacking(0, 0, 0, 0); } }143 public override PackingPosition Origin { get { return new PackingPosition(0, 0, 0, 0); } } 144 144 public override int Volume { get { return Width * Height * Depth; } } 145 145 146 public override bool EnclosesPoint( ThreeDimensionalPacking myPosition, ThreeDimensionalPackingcheckedPoint) {146 public override bool EnclosesPoint(PackingPosition myPosition, PackingPosition checkedPoint) { 147 147 return (myPosition.X <= checkedPoint.X && 148 148 (myPosition.X + (myPosition.Rotated ? Depth : Width) - 1) >= checkedPoint.X && … … 152 152 (myPosition.Z + (myPosition.Rotated ? Width : Depth) - 1) >= checkedPoint.Z); 153 153 } 154 public override bool Encloses( ThreeDimensionalPacking checkedPosition, PackingShape<ThreeDimensionalPacking> checkedShape) {154 public override bool Encloses(PackingPosition checkedPosition, PackingShape<PackingPosition> checkedShape) { 155 155 return Encloses(checkedPosition, (CuboidPackingShape)checkedShape); 156 156 } 157 private bool Encloses( ThreeDimensionalPackingcheckedPosition, CuboidPackingShape checkedShape) {157 private bool Encloses(PackingPosition checkedPosition, CuboidPackingShape checkedShape) { 158 158 return Encloses(new CuboidDiagonal(this), new CuboidDiagonal(checkedPosition, checkedShape)); 159 159 } … … 167 167 } 168 168 169 public override bool Overlaps( ThreeDimensionalPacking myPosition, ThreeDimensionalPacking checkedPosition, PackingShape<ThreeDimensionalPacking> checkedShape) {169 public override bool Overlaps(PackingPosition myPosition, PackingPosition checkedPosition, PackingShape<PackingPosition> checkedShape) { 170 170 return Overlaps(myPosition, checkedPosition, (CuboidPackingShape)checkedShape); 171 171 } 172 private bool Overlaps( ThreeDimensionalPacking myPosition, ThreeDimensionalPackingcheckedPosition, CuboidPackingShape checkedShape) {172 private bool Overlaps(PackingPosition myPosition, PackingPosition checkedPosition, CuboidPackingShape checkedShape) { 173 173 return Overlaps(new CuboidDiagonal(myPosition, this), new CuboidDiagonal(checkedPosition, checkedShape)); 174 174 }
Note: See TracChangeset
for help on using the changeset viewer.