Beispiel #1
0
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (0 == Mode)
     {
         Pallet pallet = new Pallet(PalletProperties);
         pallet.Draw(graphics, Transform3D.Identity);
         graphics.AddDimensions(new DimensionCube(PalletLength, PalletWidth, PalletHeight));
     }
     else
     {
         Truck truck = new Truck(TruckProperties);
         truck.DrawBegin(graphics);
         truck.DrawEnd(graphics);
         graphics.AddDimensions(new DimensionCube(TruckLength, TruckWidth, TruckHeight));
     }
 }
Beispiel #2
0
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (null == SelectedAnalysis)
     {
         return;
     }
     try
     {
         AnalysisCasePallet analysis = SelectedAnalysis;
         if (graphCtrlPack == ctrl)
         {
             bool showDimensions = true;
             // build pack
             if (analysis.Content is PackProperties packProperties)
             {
                 var pack = new Pack(0, packProperties)
                 {
                     ForceTransparency = true
                 };
                 graphics.AddBox(pack);
                 if (showDimensions)
                 {
                     graphics.AddDimensions(new DimensionCube(Vector3D.Zero, pack.Length, pack.Width,
                                                              pack.Height, Color.Black, true));
                     if (packProperties.Wrap.Transparent)
                     {
                         graphics.AddDimensions(
                             new DimensionCube(
                                 packProperties.InnerOffset
                                 , packProperties.InnerLength, packProperties.InnerWidth,
                                 packProperties.InnerHeight
                                 , Color.Red, false));
                     }
                 }
             }
         }
         else if (graphCtrlSolution == ctrl)
         {
             var sv = new ViewerSolution(SelectedAnalysis.SolutionLay);
             sv.Draw(graphics, Transform3D.Identity);
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex.Message);
     }
 }
Beispiel #3
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            InterlayerProperties interlayerProperties = new InterlayerProperties(
                null, tbName.Text, tbDescription.Text
                , InterlayerLength, InterlayerWidth, Thickness, Weight, Color);

            graphics.AddBox(new Box(0, interlayerProperties));
            graphics.AddDimensions(new DimensionCube(InterlayerLength, InterlayerWidth, Thickness));
        }
Beispiel #4
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            BundleProperties bundleProperties = new BundleProperties(
                null, BundleName, Description
                , BundleLength, BundleWidth, UnitThickness, UnitWeight, NoFlats, Color);
            Box box = new Box(0, bundleProperties);

            graphics.AddBox(box);
            graphics.AddDimensions(new DimensionCube(BundleLength, BundleWidth, UnitThickness * NoFlats));
        }
Beispiel #5
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            BoxProperties boxProperties = new BoxProperties(null, uCtrlDimensionsOuter.ValueX, uCtrlDimensionsOuter.ValueY, uCtrlDimensionsOuter.ValueZ);

            boxProperties.SetAllColors(_faceColors);
            boxProperties.TextureList = _textures;
            boxProperties.TapeWidth   = TapeWidth;
            boxProperties.TapeColor   = TapeColor;
            graphics.AddBox(new Box(0, boxProperties));
            graphics.AddDimensions(new DimensionCube(uCtrlDimensionsOuter.ValueX, uCtrlDimensionsOuter.ValueY, uCtrlDimensionsOuter.ValueZ));
        }
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     try
     {
         graphics.AddBox(new Box(0, CaseProperties));
         graphics.AddDimensions(new DimensionCube(CaseDimensions.X, CaseDimensions.Y, CaseDimensions.Z));
     }
     catch (Exception ex)
     {
         _log.Error(ex.Message);
     }
 }
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (graphCtrlPallet == ctrl)
     {
         Pallet pallet = new Pallet(_palletProperties);
         pallet.Draw(graphics, Transform3D.Identity);
         DimensionCube dc = new DimensionCube(_palletProperties.Length, _palletProperties.Width, _palletProperties.Height)
         {
             FontSize = 6.0f
         };
         graphics.AddDimensions(dc);
     }
 }
Beispiel #8
0
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (TruckLength == 0 || TruckWidth == 0 || TruckHeight == 0)
         return;
     TruckProperties truckProperties = new TruckProperties(null, TruckLength, TruckWidth, TruckHeight)
     {
         Color = TruckColor
     };
     Truck truck = new Truck(truckProperties);
     truck.DrawBegin(graphics);
     truck.DrawEnd(graphics);
     graphics.AddDimensions(new DimensionCube(TruckLength, TruckWidth, TruckHeight));
 }
Beispiel #9
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            if (null == DestinationPallet)
            {
                return;
            }



            Pallet pallet = new Pallet(DestinationPallet);

            pallet.Draw(graphics, Transform3D.Identity);
            graphics.AddDimensions(new DimensionCube(DestinationPallet.Length, DestinationPallet.Width, DestinationPallet.Height));
        }
Beispiel #10
0
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (CapLength > 0 && CapWidth > 0 && CapHeight > 0)
     {
         // draw
         PalletCapProperties palletCapProperties = new PalletCapProperties(
             null, ItemName, ItemDescription, CapLength, CapWidth, CapHeight,
             CapInnerLength, CapInnerWidth, CapInnerHeight,
             CapWeight, CapColor);
         PalletCap palletCap = new PalletCap(0, palletCapProperties, BoxPosition.Zero);
         palletCap.Draw(graphics);
         graphics.AddDimensions(new DimensionCube(CapLength, CapWidth, CapHeight));
     }
 }
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            if (0 == cbType.Items.Count)
            {
                return;
            }
            PalletProperties palletProperties = new PalletProperties(null, PalletTypeName, PalletLength, PalletWidth, PalletHeight);

            palletProperties.Color = PalletColor;
            Pallet pallet = new Pallet(palletProperties);

            pallet.Draw(graphics, Transform3D.Identity);
            graphics.AddDimensions(new DimensionCube(PalletLength, PalletWidth, PalletHeight));
        }
Beispiel #12
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            BoxProperties boxProperties = new BoxProperties(null, (double)nudLength.Value, (double)nudWidth.Value, (double)nudHeight.Value);

            boxProperties.SetAllColors(_faceColors);
            boxProperties.TextureList = _textures;
            boxProperties.ShowTape    = ShowTape;
            boxProperties.TapeColor   = TapeColor;
            boxProperties.TapeWidth   = TapeWidth;
            Box box = new Box(0, boxProperties);

            graphics.AddBox(box);
            graphics.AddDimensions(new DimensionCube((double)nudLength.Value, (double)nudWidth.Value, (double)nudHeight.Value));
        }
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (_dt is DataCase dtCase)
     {
         Box b = new Box(0, ToCase(dtCase));
         graphics.AddBox(b);
         graphics.AddDimensions(new DimensionCube(dtCase.OuterDimensions));
     }
     else if (_dt is DataBox dtBox)
     {
         Box b = new Box(0, ToBox(dtBox));
         graphics.AddBox(b);
         graphics.AddDimensions(new DimensionCube(dtBox.Dimensions));
     }
     else if (_dt is DataPallet dtPallet)
     {
         Pallet pallet = new Pallet(ToPallet(dtPallet));
         pallet.Draw(graphics, Sharp3D.Math.Core.Transform3D.Identity);
         graphics.AddDimensions(new DimensionCube(dtPallet.Dimensions));
     }
     else if (_dt is DataInterlayer dtInterlayer)
     {
         graphics.AddBox(new Box(0, ToInterlayer(dtInterlayer)));
         graphics.AddDimensions(new DimensionCube(dtInterlayer.Dimensions));
     }
     else if (_dt is DataPalletCap dtPalletCap)
     {
         PalletCap palletCap = new PalletCap(0, ToPalletCap(dtPalletCap), BoxPosition.Zero);
         palletCap.Draw(graphics);
         graphics.AddDimensions(new DimensionCube(dtPalletCap.Dimensions));
     }
     else if (_dt is DataCylinder dtCylinder)
     {
         Cylinder cyl = new Cylinder(0, ToCylinder(dtCylinder));
         graphics.AddCylinder(cyl);
     }
 }
Beispiel #14
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            // build pack
            PackProperties packProperties = new PackProperties(null, SelectedBox, Arrangement, BoxOrientation, Wrapper);

            if (uCtrlOuterDimensions.Checked)
            {
                packProperties.ForceOuterDimensions(
                    new Vector3D(uCtrlOuterDimensions.X, uCtrlOuterDimensions.Y, uCtrlOuterDimensions.Z));
            }
            Pack pack = new Pack(0, packProperties);

            pack.ForceTransparency = true;
            graphics.AddBox(pack);
            graphics.AddDimensions(new DimensionCube(Vector3D.Zero, pack.Length, pack.Width, pack.Height, Color.Black, true));
            if (packProperties.Wrap.Transparent)
            {
                graphics.AddDimensions(
                    new DimensionCube(
                        packProperties.InnerOffset
                        , packProperties.InnerLength, packProperties.InnerWidth, packProperties.InnerHeight
                        , Color.Red, false));
            }
        }
Beispiel #15
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            if (CornerLength > 0 && CornerWidth > 0 && CornerThickness > 0 &&
                CornerThickness < CornerWidth)
            {
                // draw
                PalletCornerProperties palletCornerProperties = new PalletCornerProperties(
                    null, ItemName, ItemDescription, CornerLength, CornerWidth, CornerThickness,
                    CornerWeight, CornerColor);

                Corner palletCorner = new Corner(0, palletCornerProperties);
                palletCorner.Draw(graphics);
                graphics.AddDimensions(new DimensionCube(CornerWidth, CornerWidth, CornerLength));
            }
        }
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            CylinderProperties cylProperties = new CylinderProperties(
                null, ItemName, ItemDescription
                , RadiusOuter, RadiusInner, CylinderHeight, Weight
                , ColorTop, ColorWallOuter, ColorWallInner);
            Cylinder cyl = new Cylinder(0, cylProperties);

            graphics.AddCylinder(cyl);
            graphics.AddDimensions(new DimensionCube(
                                       new Vector3D(-RadiusOuter, -RadiusOuter, 0.0),
                                       2.0 * RadiusOuter, 2.0 * RadiusOuter, CylinderHeight,
                                       Color.Black, false)
                                   );
        }
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (graphCtrlBoxCase == ctrl)
     {
         BoxProperties boxProperties = new BoxProperties(null
                                                         , _caseOfBoxesProperties.Length, _caseOfBoxesProperties.Width, _caseOfBoxesProperties.Height);
         boxProperties.SetAllColors(_faceColors);
         boxProperties.TextureList = _textures;
         Box box = new Box(0, boxProperties);
         graphics.AddBox(box);
         graphics.AddDimensions(new DimensionCube(_caseOfBoxesProperties.Length, _caseOfBoxesProperties.Width, _caseOfBoxesProperties.Height));
     }
     else if (graphCtrlCaseDefinition == ctrl)
     {
         CaseDefinitionViewer viewer = new CaseDefinitionViewer(_caseOfBoxesProperties.CaseDefinition, _caseOfBoxesProperties.InsideBoxProperties, _caseOfBoxesProperties.CaseOptimConstraintSet);
         viewer.CaseProperties = _caseOfBoxesProperties;
         viewer.Orientation    = new Basics.Orientation(HalfAxis.HAxis.AXIS_X_P, HalfAxis.HAxis.AXIS_Y_P);
         viewer.Draw(graphics);
     }
 }
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (ctrl == graphCtrlPallet)
     {
         PalletProperties pp     = CurrentPallet;
         Pallet           pallet = new Pallet(pp);
         pallet.Draw(graphics, Transform3D.Identity);
         DimensionCube dc = new DimensionCube(pp.Length, pp.Width, pp.Height)
         {
             FontSize = 6.0f
         };
         graphics.AddDimensions(dc);
     }
     else if (ctrl == graphCtrlSolution)
     {
         if (null == CurrentSolution)
         {
             return;
         }
         CasePalletSolutionViewer sv = new CasePalletSolutionViewer(CurrentSolution);
         sv.Draw(graphics);
     }
 }
Beispiel #19
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            if (null == _selectedItem)
            {
                return;
            }
            // get unit system
            UnitsManager.UnitSystem us = (UnitsManager.UnitSystem)_selectedItem.UnitSystem;
            // pallet
            if (_selectedItem is DCSBPallet dcsbPallet)
            {
                double palletLength = UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M0, us);
                double palletWidth  = UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M1, us);
                double palletHeight = UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M2, us);

                PalletProperties palletProperties = new PalletProperties(null, dcsbPallet.PalletType, palletLength, palletWidth, palletHeight)
                {
                    Color = Color.FromArgb(dcsbPallet.Color)
                };
                Pallet pallet = new Pallet(palletProperties);
                pallet.Draw(graphics, Transform3D.Identity);
                graphics.AddDimensions(new DimensionCube(palletLength, palletWidth, palletHeight));
            }
        }
Beispiel #20
0
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     // ### draw pallet
     if (graphCtrlPallet == ctrl)
     {
         PalletProperties pp     = SelectedPallet;
         Pallet           pallet = new Pallet(pp);
         pallet.Draw(graphics, Transform3D.Identity);
         DimensionCube dc = new DimensionCube(pp.Length, pp.Width, pp.Height)
         {
             FontSize = 6.0f
         };
         graphics.AddDimensions(dc);
     }
     // ### draw case definition
     else if (ctrl == graphCtrlBoxesLayout)
     {
         // ### draw case definition
         try
         {
             // get selected solution
             CaseOptimSolution solution = SelectedSolution;
             if (null == solution)
             {
                 return;
             }
             // instantiate case definition viewer
             CaseDefinitionViewer cdv = new CaseDefinitionViewer(SelectedSolution.CaseDefinition, SelectedBox, BuildCaseOptimConstraintSet());
             cdv.Orientation = SelectedSolution.PalletSolution.FirstCaseOrientation;
             cdv.Draw(graphics);
         }
         catch (Exception ex)
         {
             _log.Error(ex.ToString());
         }
     }
     // ### draw associated pallet solution
     else if (ctrl == graphCtrlPalletLayout)
     {
         try
         {
             // get selected solution
             CaseOptimSolution solution = SelectedSolution;
             // get selected box
             BoxProperties boxProperties = SelectedBox;
             // get selected pallet
             PalletProperties palletProperties = SelectedPallet;
             if (null != solution && null != boxProperties && null != palletProperties)
             {
                 Vector3D      outerDim       = solution.CaseDefinition.OuterDimensions(boxProperties, BuildCaseOptimConstraintSet());
                 BoxProperties caseProperties = new BoxProperties(null, outerDim.X, outerDim.Y, outerDim.Z);
                 caseProperties.SetColor(Color.Chocolate);
                 CasePalletSolutionViewer.Draw(graphics, solution.PalletSolution, caseProperties, null, palletProperties);
             }
         }
         catch (Exception ex)
         {
             _log.Error(ex.ToString());
         }
     }
 }