using OpenCvSharp; using System; using System.Collections; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PaintDotNet.DedicatedAnalysis.GrainSizeStandard.IntegrationClass { class GrainSizeStandardModel { /// /// 找到当前的参数数据 /// /// /// public GrainSizeStandardModel cloneListParamModel() { GrainSizeStandardModel newMod = new GrainSizeStandardModel(); newMod.linePointList.AddRange(this.linePointList); newMod.massLabelPointsList.AddRange(this.massLabelPointsList); foreach (var itemkey in this.massLabelPoints.Keys) newMod.massLabelPoints.Add(itemkey, this.massLabelPoints[itemkey]); //newMod.ListParam = new List(); //foreach (var item in this.ListParam) // if (item.menuId == menuId) // newMod.ListParam.Add(item.cloneModel()); return newMod; } public GrainSizeStandardModel cloneModel() { GrainSizeStandardModel newMod = new GrainSizeStandardModel(); newMod.linePointList.AddRange(this.linePointList); newMod.within = this.within; newMod.massLabelPointsList.AddRange(this.massLabelPointsList); foreach (var itemkey in this.massLabelPoints.Keys) newMod.massLabelPoints.Add(itemkey, this.massLabelPoints[itemkey]); newMod.currentNccompSelectList.AddRange(this.currentNccompSelectList); newMod.currentNccompSelect.AddRange(this.currentNccompSelect); if (this.currentStatsArray != null) newMod.currentStatsArray = (Mat[])this.currentStatsArray.Clone(); if (this.currentStats != null) newMod.currentStats = this.currentStats.Clone(); if (this.currentLabelMatArray != null) newMod.currentLabelMatArray = (Mat[])this.currentLabelMatArray.Clone(); if (this.currentLabelMat != null) newMod.currentLabelMat = this.currentLabelMat.Clone(); return newMod; } /// /// 图形上所有的点 /// public List linePointList = new List(); /// /// 矩形内的连通域 /// public int within = 0; /// /// 用于编号的坐标点集合,value为: aec_length(物理长度) + [1内部] + [label_x] + [label_y] + aec(晶粒面积)-多视场 /// public List>> massLabelPointsList = new List>>(); /// /// 用于编号的坐标点集合,value为: 备用数据 + [1内部] + [label_x] + [label_y],key为label /// public Dictionary> massLabelPoints = new Dictionary>(); /// /// 视场内符合条件的连通域label集合-多视场 /// public List currentNccompSelectList = new List(); /// /// 视场内符合条件的连通域label集合 /// public ArrayList currentNccompSelect = new ArrayList(); /// /// Nx5 matrix (CV_32S) of statistics: x0, y0, width0, height0, area0-多视场 /// public Mat[] currentStatsArray; /// /// Nx5 matrix (CV_32S) of statistics: x0, y0, width0, height0, area0 /// public Mat currentStats; /// /// 存储连通域数据-多视场 /// public Mat[] currentLabelMatArray; /// /// 存储连通域数据 /// public Mat currentLabelMat; } }