Changeset 15488 for branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Geometry/Vector3D.cs
- Timestamp:
- 11/28/17 16:10:31 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Geometry/Vector3D.cs
r15454 r15488 6 6 7 7 namespace HeuristicLab.Problems.BinPacking3D.Geometry { 8 internalclass Vector3D {8 public class Vector3D { 9 9 10 10 public int X { get; set; } … … 23 23 Z = pos.Z; 24 24 } 25 26 public PackingPosition ToPackingPosition(int assignedBin) { 27 return new PackingPosition(assignedBin, X, Y, Z); 28 } 29 25 30 public static Vector3D AlongX(Vector3D pos, PackingItem item) { 26 31 return new Vector3D( … … 86 91 return new Vector3D(a * b.X, a * b.Y, a * b.Z); 87 92 } 93 94 public static Vector3D operator *(double a, Vector3D b) { 95 return new Vector3D((int)(a * b.X), (int)(a * b.Y), (int)(a * b.Z)); 96 } 97 88 98 public static Vector3D operator *(Vector3D a, int b) { 89 99 return new Vector3D(a.X * b, a.Y * b, a.Z * b); 90 100 } 101 102 public static Vector3D operator *(Vector3D a, double b) { 103 return new Vector3D((int)(b * a.X), (int)(b * a.Y), (int)(b * a.Z)); 104 } 105 91 106 public static Vector3D operator +(Vector3D a, Vector3D b) { 92 107 return new Vector3D(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
Note: See TracChangeset
for help on using the changeset viewer.