Beispiel #1
0
        public void Draw(Graphics3D graphics)
        {
            if (null == _solution)
            {
                return;
            }
            // initialize Graphics3D object
            if (!graphics.ShowBoxIds)
            {
                // draw pallet
                Pallet pallet = new Pallet(_analysis.PalletProperties);
                pallet.Draw(graphics, Transform3D.Identity);
            }
            // draw solution
            uint pickId = 0;

            foreach (CylPosition pos in _solution)
            {
                graphics.AddCylinder(new Cylinder(pickId++, _analysis.CylinderProperties, pos));
            }

            if (_showDimensions)
            {
                graphics.AddDimensions(
                    new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol1)
                                      , Color.Black, false));
                graphics.AddDimensions(
                    new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol2)
                                      , Color.Red, true));
            }
        }
Beispiel #2
0
        /// <summary>
        /// Draw layers
        /// Images are used during report generation
        /// </summary>
        public void DrawLayers(Graphics3D graphics, bool showPallet, int layerIndex)
        {
            if (null == _solution)
            {
                throw new Exception("No solution defined!");
            }

            if (!graphics.ShowBoxIds) // -> if box ids are drawn, we do not draw pallet
            {
                // draw pallet
                Pallet pallet = new Pallet(_analysis.PalletProperties);
                pallet.Draw(graphics, Transform3D.Identity);
            }
            // draw solution
            uint          pickId   = 0;
            CylinderLayer cylLayer = _solution.CylinderLayerFirst;

            if (cylLayer != null)
            {
                foreach (Vector3D pos in cylLayer)
                {
                    graphics.AddCylinder(new Cylinder(pickId++, _analysis.CylinderProperties, new CylPosition(pos, HalfAxis.HAxis.AXIS_Z_P)));
                }
            }
            // flush
            graphics.Flush();
        }
Beispiel #3
0
        /// <summary>
        /// Use this method when drawing a solution that belongs an analysis
        /// </summary>
        public void Draw(Graphics3D graphics)
        {
            if (null == _solution)
            {
                return;
            }
            // initialize Graphics3D object
            if (!graphics.ShowBoxIds)
            {
                // draw pallet
                Pallet pallet = new Pallet(_analysis.PalletProperties);
                pallet.Draw(graphics, Transform3D.Identity);
            }
            // draw solution
            uint pickId = 0;

            foreach (ILayer layer in _solution)
            {
                CylinderLayer cylLayer = layer as CylinderLayer;
                if (null != cylLayer)
                {
                    foreach (Vector3D pos in cylLayer)
                    {
                        graphics.AddCylinder(
                            new Cylinder(pickId++, _analysis.CylinderProperties, new CylPosition(pos, HalfAxis.HAxis.AXIS_Z_P))
                            );
                    }
                }

                InterlayerPos interlayerPos = layer as InterlayerPos;
                if (null != interlayerPos)
                {
                    Box box = new Box(pickId++, _analysis.InterlayerProperties);
                    // set position
                    box.Position = new Vector3D(
                        0.5 * (_analysis.PalletProperties.Length - _analysis.InterlayerProperties.Length)
                        , 0.5 * (_analysis.PalletProperties.Width - _analysis.InterlayerProperties.Width)
                        , interlayerPos.ZLow);
                    // draw
                    graphics.AddBox(box);
                }
            }
            if (_showDimensions)
            {
                if (_showDimensions)
                {
                    graphics.AddDimensions(
                        new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol1)
                                          , Color.Black, false));
                    graphics.AddDimensions(
                        new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol2)
                                          , Color.Red, true));
                }
            }
        }
        /// <summary>
        /// Use this method when drawing a solution that belongs an analysis
        /// </summary>
        public void Draw(Graphics3D graphics)
        {
            if (null == _solution)
                return;
            // initialize Graphics3D object
            if (!graphics.ShowBoxIds)
            {
                // draw pallet
                Pallet pallet = new Pallet(_analysis.PalletProperties);
                pallet.Draw(graphics, Transform3D.Identity);
            }
            // draw solution
            uint pickId = 0;
            foreach (ILayer layer in _solution)
            {
                CylinderLayer cylLayer = layer as CylinderLayer;
                if (null != cylLayer)
                {
                    foreach (Vector3D pos in cylLayer)
                        graphics.AddCylinder(
                            new Cylinder(pickId++, _analysis.CylinderProperties, new CylPosition(pos, HalfAxis.HAxis.AXIS_Z_P))
                            );
                }

                InterlayerPos interlayerPos = layer as InterlayerPos;
                if (null != interlayerPos)
                {
                    Box box = new Box(pickId++, _analysis.InterlayerProperties);
                    // set position
                    box.Position = new Vector3D(
                        0.5 * (_analysis.PalletProperties.Length - _analysis.InterlayerProperties.Length)
                        , 0.5 * (_analysis.PalletProperties.Width - _analysis.InterlayerProperties.Width)
                        , interlayerPos.ZLow);
                    // draw
                    graphics.AddBox(box);
                }
            }
            if (_showDimensions)
            {
                if (_showDimensions)
                {
                    graphics.AddDimensions(
                        new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol1)
                        , Color.Black, false));
                    graphics.AddDimensions(
                        new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol2)
                        , Color.Red, true));
                }
            }
        }
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            if (null == _dt)
                return;
            DataCase dtCase = _dt as DataCase;
            if (null != dtCase)
            {
                Box b = new Box(0, ToCase(dtCase));
                graphics.AddBox(b);
                graphics.AddDimensions(new DimensionCube(dtCase.OuterDimensions));
            }
            DataBox dtBox = _dt as DataBox;
            if (null != dtBox)
            {
                Box b = new Box(0, ToBox(dtBox));
                graphics.AddBox(b);
                graphics.AddDimensions(new DimensionCube(dtBox.Dimensions));
            }
            DataPallet dtPallet = _dt as DataPallet;
            if (null != dtPallet)
            {
                Pallet pallet = new Pallet(ToPallet(dtPallet));
                pallet.Draw(graphics, Sharp3D.Math.Core.Transform3D.Identity);
                graphics.AddDimensions(new DimensionCube(dtPallet.Dimensions));
            }
            DataInterlayer dtInterlayer = _dt as DataInterlayer;
            if (null != dtInterlayer)
            {
                graphics.AddBox(new Box(0, ToInterlayer(dtInterlayer)));
                graphics.AddDimensions(new DimensionCube(dtInterlayer.Dimensions));
            }

            DataPalletCap dtPalletCap = _dt as DataPalletCap;
            if (null != dtPalletCap)
            {
                PalletCap palletCap = new PalletCap(0, ToPalletCap(dtPalletCap), Sharp3D.Math.Core.Vector3D.Zero);
                palletCap.Draw(graphics);
                graphics.AddDimensions(new DimensionCube(dtPalletCap.Dimensions));
            }

            DataCylinder dtCylinder = _dt as DataCylinder;
            if (null != dtCylinder)
            {
                Cylinder cyl = new Cylinder(0, ToCylinder(dtCylinder));
                graphics.AddCylinder(cyl);
            }
        }
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     CylinderProperties cylProperties = new CylinderProperties(
         null, CylinderName, Description
         , RadiusOuter, RadiusInner, CylinderHeight, Weight
         , ColorTop, ColorWallOuter, ColorWallInner);
     Cylinder cyl = new Cylinder(0, cylProperties);
     graphics.AddCylinder(cyl);
 }
        public void Draw(Graphics3D graphics)
        {
            if (null == _solution)
                return;
            // initialize Graphics3D object
            if (!graphics.ShowBoxIds)
            {
                // draw pallet
                Pallet pallet = new Pallet(_analysis.PalletProperties);
                pallet.Draw(graphics, Transform3D.Identity);
            }
            // draw solution
            uint pickId = 0;
            foreach (CylPosition pos in _solution)
                graphics.AddCylinder(new Cylinder(pickId++, _analysis.CylinderProperties, pos));

            if (_showDimensions)
            {
                graphics.AddDimensions(
                    new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol1)
                    , Color.Black, false));
                graphics.AddDimensions(
                    new DimensionCube(BoundingBoxDim(Properties.Settings.Default.DimCasePalletSol2)
                    , Color.Red, true));
            }
        }
        /// <summary>
        /// Draw layers
        /// Images are used during report generation
        /// </summary>
        public void DrawLayers(Graphics3D graphics, bool showPallet, int layerIndex)
        {
            if (null == _solution)
                throw new Exception("No solution defined!");

            if (!graphics.ShowBoxIds) // -> if box ids are drawn, we do not draw pallet
            {
                // draw pallet
                Pallet pallet = new Pallet(_analysis.PalletProperties);
                pallet.Draw(graphics, Transform3D.Identity);
            }
            // draw solution
            uint pickId = 0;
            CylinderLayer cylLayer = _solution.CylinderLayerFirst;
            if (cylLayer != null)
            {
                foreach (Vector3D pos in cylLayer)
                    graphics.AddCylinder(new Cylinder(pickId++, _analysis.CylinderProperties, new CylPosition(pos, HalfAxis.HAxis.AXIS_Z_P)));
            }
            // flush
            graphics.Flush();
        }