Ejemplo n.º 1
0
 public PackProperties(Document doc
                       , Packable packable
                       , PackArrangement arrangement
                       , HalfAxis.HAxis orientation, EnuRevSolidLayout revSolidLayout
                       , PackWrapper wrapper
                       , PackTray tray)
     : base(doc)
 {
     Content = packable;
     if (null != doc)
     {
         Content.AddDependancy(this);
     }
     Arrangement    = arrangement;
     BoxOrientation = orientation;
     RevSolidLayout = revSolidLayout;
     Wrap           = wrapper;
     Tray           = tray;
 }
Ejemplo n.º 2
0
        public static void GetDimensions(
            RevSolidProperties revSolid
            , EnuRevSolidLayout revSolidLayout
            , PackArrangement arrangement
            , ref double length, ref double width, ref double height)
        {
            if (null == revSolid)
            {
                return;
            }

            switch (revSolidLayout)
            {
            case EnuRevSolidLayout.ALIGNED:
                length = arrangement.Length * revSolid.Diameter;
                width  = arrangement.Width * revSolid.Diameter;
                break;

            case EnuRevSolidLayout.STAGGERED_REGULAR:
                length = (arrangement.Length + 0.5) * revSolid.Diameter;
                width  = ((arrangement.Width - 1) * 0.5 * Math.Sqrt(3.0) + 1) * revSolid.Diameter;
                break;

            case EnuRevSolidLayout.STAGGERED_MINUS1:
                length = arrangement.Length * revSolid.Diameter;
                width  = ((arrangement.Width - 1) * 0.5 * Math.Sqrt(3.0) + 1) * revSolid.Diameter;
                break;

            case EnuRevSolidLayout.STAGGERED_PLUS1:
                length = (arrangement.Length + 1) * revSolid.Diameter;
                width  = ((arrangement.Width - 1) * 0.5 * Math.Sqrt(3.0) + 1) * revSolid.Diameter;
                break;

            default:
                length = 0.0; width = 0.0;
                break;
            }

            height = arrangement.Height * revSolid.Height;
        }