/// <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;
            int  iLayer = 0, iLayerCount = 0;

            while (iLayerCount <= layerIndex && iLayer < _solution.Count)
            {
                ILayer   layer  = _solution[iLayer];
                BoxLayer blayer = layer as BoxLayer;
                if (null != blayer)
                {
                    foreach (BoxPosition bPosition in blayer)
                    {
                        graphics.AddBox(new Box(pickId++, _analysis.BProperties, bPosition));
                    }
                    ++iLayerCount;
                }
                ++iLayer;
            }
            // flush
            graphics.Flush();
        }
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();
        }
        /// <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();
        }
        /// <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;
            int iLayer = 0, iLayerCount = 0;
            while (iLayerCount <= layerIndex && iLayer < _solution.Count)
            {
                ILayer layer = _solution[iLayer];
                BoxLayer blayer = layer as BoxLayer;
                if (null != blayer)
                {
                    foreach (BoxPosition bPosition in blayer)
                        graphics.AddBox(new Box(pickId++, _analysis.BProperties, bPosition));
                    ++iLayerCount;
                }
                ++iLayer;
            }
            // flush
            graphics.Flush();
        }