private PackWrapper BuildWrapper(Vector3D dimensions) { // no wrapper? if (!ParamSetPackOpt.HasWrapper) { return(null); } int[] noWalls = ParamSetPackOpt.NoWrapperWalls; double length = 0.0, width = 0.0, height = 0.0; double weight = ParamSetPackOpt.WrapperSurfMass * (noWalls[0] * width * height + noWalls[1] * length * height + noWalls[2] * length * width); switch (ParamSetPackOpt.WrapperType) { case PackWrapper.WType.WT_POLYETHILENE: return(new WrapperPolyethilene(ParamSetPackOpt.WrapperThickness, ParamSetPackOpt.WrapperWeight(dimensions), ParamSetPackOpt.WrapperColor)); case PackWrapper.WType.WT_PAPER: return(new WrapperPaper(ParamSetPackOpt.WrapperThickness, weight, ParamSetPackOpt.WrapperColor)); case PackWrapper.WType.WT_CARDBOARD: { var wrapperCardboard = new WrapperCardboard(ParamSetPackOpt.WrapperThickness, weight, ParamSetPackOpt.WrapperColor); wrapperCardboard.SetNoWalls(noWalls); return(wrapperCardboard); } default: throw new InvalidEnumArgumentException(nameof(ParamSetPackOpt.WrapperType), (int)ParamSetPackOpt.WrapperType, typeof(PackWrapper.WType)); } }
private PackTray BuildTray(Vector3D dims) { if (!ParamSetPackOpt.HasTray) { return(null); } var packTray = new PackTray(ParamSetPackOpt.TrayHeight, ParamSetPackOpt.TrayWeight(dims), ParamSetPackOpt.TrayColor); packTray.SetNoWalls(ParamSetPackOpt.NoWrapperWalls); return(packTray); }