Example #1
0
        /// <summary>
        /// returns 3D layer. This is only used in LayerSummary
        /// </summary>
        internal ILayer GetILayer(int layerIndex, bool symX, bool symY)
        {
            ILayer2D currentLayer = _layerTypes[layerIndex];

            if (currentLayer is Layer2D)
            {
                Layer2D    layer2DBox = currentLayer as Layer2D;
                Layer3DBox boxLayer   = new Layer3DBox(0.0, layerIndex);
                foreach (LayerPosition layerPos in layer2DBox)
                {
                    LayerPosition layerPosTemp = AdjustLayerPosition(layerPos, symX, symY);
                    boxLayer.Add(new BoxPosition(
                                     layerPosTemp.Position + Analysis.Offset
                                     , layerPosTemp.LengthAxis
                                     , layerPosTemp.WidthAxis
                                     ));
                }
                return(boxLayer);
            }

            if (currentLayer is Layer2DCyl)
            {
                Layer2DCyl layer2DCyl = currentLayer as Layer2DCyl;
                Layer3DCyl cylLayer   = new Layer3DCyl(0.0);
                foreach (Vector2D vPos in layer2DCyl)
                {
                    cylLayer.Add(
                        AdjustPosition(new Vector3D(vPos.X, vPos.Y, 0.0), symX, symY)
                        + Analysis.Offset);
                }
                return(cylLayer);
            }
            return(null);
        }
Example #2
0
        public Layer3DCyl CreateNewLayer(double zLow)
        {
            Layer3DCyl layer = new Layer3DCyl(zLow);

            Add(layer);
            return(layer);
        }
Example #3
0
 private void GetCounts(ref int layerCount, ref int interlayerCount, ref int itemCount)
 {
     layerCount      = 0;
     interlayerCount = 0;
     itemCount       = 0;
     foreach (ILayer layer in Layers)
     {
         Layer3DBox blayer = layer as Layer3DBox;
         if (null != blayer)
         {
             ++layerCount;
             itemCount += blayer.BoxCount;
         }
         Layer3DCyl clayer = layer as Layer3DCyl;
         if (null != clayer)
         {
             ++layerCount;
             itemCount += clayer.CylinderCount;
         }
         InterlayerPos iLayer = layer as InterlayerPos;
         if (null != iLayer)
         {
             ++interlayerCount;
         }
     }
 }
Example #4
0
        private BBox3D ComputeLoadBBox3D()
        {
            BBox3D bbox   = new BBox3D();
            int    iLayer = 0;

            while (iLayer < Count)
            {
                ILayer     layer  = this[iLayer];
                Layer3DCyl blayer = layer as Layer3DCyl;
                if (null != blayer)
                {
                    bbox.Extend(blayer.BoundingBox(Analysis.CylinderProperties));
                }
                ++iLayer;
            }
            return(bbox);
        }