public override bool Equals(object obj) { LayerDesc layerDesc = obj as LayerDesc; if (null == layerDesc) { return(false); } return(_patternName == layerDesc.PatternName && _swapped == layerDesc.Swapped); }
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); }
public SolutionLayered(AnalysisLayered analysis, LayerDesc layerDesc, bool alternateLayer) { Analysis = analysis; LayerEncaps = new List <LayerEncap>() { new LayerEncap(layerDesc) }; AlternateLayers = alternateLayer; RebuildLayers(); InitializeSolutionItemList(); }
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); }
public override string ToString() { if (null != LayerDesc) { return(LayerDesc.ToString()); } else if (null != Layer2D) { return(Layer2D.ToString()); } else { throw new Exception("Unexpected LayerEncap type!"); } }
public override int GetHashCode() { if (null != LayerDesc) { return(LayerDesc.GetHashCode()); } else if (null != Layer2D) { return(Layer2D.GetHashCode()); } else { return(0); } }
public void AddSolution(LayerDesc layerDesc, bool alternateLayers = true) { Solution = new SolutionLayered(this, layerDesc, alternateLayers); }
public void AddSolution(LayerDesc layerDesc, bool mirrorLength = true, bool mirrorWidth = true) { Solution = new SolutionLayered(this, layerDesc, mirrorLength, mirrorWidth); }
public LayerEncap(LayerDesc layerDesc) { LayerDesc = layerDesc; }