Example #1
0
        public override bool Equals(object obj)
        {
            LayerDesc layerDesc = obj as LayerDesc;

            if (null == layerDesc)
            {
                return(false);
            }
            return(_patternName == layerDesc.PatternName && _swapped == layerDesc.Swapped);
        }
Example #2
0
        private int GetLayerIndexFromLayerDesc(LayerDesc layerDesc)
        {
            int index = _layerTypes.FindIndex(l => l.LayerDescriptor.ToString() == layerDesc.ToString());

            if (-1 == index)
            {
                throw new Exception("No valid layer with desc {layerDesc}");
            }
            return(index);
        }
Example #3
0
        public SolutionLayered(AnalysisLayered analysis, LayerDesc layerDesc, bool alternateLayer)
        {
            Analysis    = analysis;
            LayerEncaps = new List <LayerEncap>()
            {
                new LayerEncap(layerDesc)
            };
            AlternateLayers = alternateLayer;

            RebuildLayers();
            InitializeSolutionItemList();
        }
Example #4
0
 public override bool Equals(object obj)
 {
     if (obj is LayerEncap lObj)
     {
         if ((null == LayerDesc && null != lObj.LayerDesc) || (null != LayerDesc && null == lObj.LayerDesc))
         {
             return(false);
         }
         return((null != LayerDesc && LayerDesc.Equals(lObj.LayerDesc)) ||
                (null != Layer2D && Layer2D.Equals(lObj.Layer2D)));
     }
     return(false);
 }
Example #5
0
 public override string ToString()
 {
     if (null != LayerDesc)
     {
         return(LayerDesc.ToString());
     }
     else if (null != Layer2D)
     {
         return(Layer2D.ToString());
     }
     else
     {
         throw new Exception("Unexpected LayerEncap type!");
     }
 }
Example #6
0
 public override int GetHashCode()
 {
     if (null != LayerDesc)
     {
         return(LayerDesc.GetHashCode());
     }
     else if (null != Layer2D)
     {
         return(Layer2D.GetHashCode());
     }
     else
     {
         return(0);
     }
 }
Example #7
0
 public void AddSolution(LayerDesc layerDesc, bool alternateLayers = true)
 {
     Solution = new SolutionLayered(this, layerDesc, alternateLayers);
 }
Example #8
0
 public void AddSolution(LayerDesc layerDesc, bool mirrorLength = true, bool mirrorWidth = true)
 {
     Solution = new SolutionLayered(this, layerDesc, mirrorLength, mirrorWidth);
 }
Example #9
0
 public LayerEncap(LayerDesc layerDesc)
 {
     LayerDesc = layerDesc;
 }