GrainSizeStandardModel.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using OpenCvSharp;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace PaintDotNet.DedicatedAnalysis.GrainSizeStandard.IntegrationClass
  10. {
  11. class GrainSizeStandardModel
  12. {
  13. /// <summary>
  14. /// 找到当前的参数数据
  15. /// </summary>
  16. /// <param name="menuId"></param>
  17. /// <returns></returns>
  18. public GrainSizeStandardModel cloneListParamModel()
  19. {
  20. GrainSizeStandardModel newMod = new GrainSizeStandardModel();
  21. newMod.linePointList.AddRange(this.linePointList);
  22. newMod.massLabelPointsList.AddRange(this.massLabelPointsList);
  23. foreach (var itemkey in this.massLabelPoints.Keys)
  24. newMod.massLabelPoints.Add(itemkey, this.massLabelPoints[itemkey]);
  25. //newMod.ListParam = new List<GrainSizeAnalysisModel>();
  26. //foreach (var item in this.ListParam)
  27. // if (item.menuId == menuId)
  28. // newMod.ListParam.Add(item.cloneModel());
  29. return newMod;
  30. }
  31. public GrainSizeStandardModel cloneModel()
  32. {
  33. GrainSizeStandardModel newMod = new GrainSizeStandardModel();
  34. newMod.linePointList.AddRange(this.linePointList);
  35. newMod.within = this.within;
  36. newMod.massLabelPointsList.AddRange(this.massLabelPointsList);
  37. foreach (var itemkey in this.massLabelPoints.Keys)
  38. newMod.massLabelPoints.Add(itemkey, this.massLabelPoints[itemkey]);
  39. newMod.currentNccompSelectList.AddRange(this.currentNccompSelectList);
  40. newMod.currentNccompSelect.AddRange(this.currentNccompSelect);
  41. if (this.currentStatsArray != null)
  42. newMod.currentStatsArray = (Mat[])this.currentStatsArray.Clone();
  43. if (this.currentStats != null)
  44. newMod.currentStats = this.currentStats.Clone();
  45. if (this.currentLabelMatArray != null)
  46. newMod.currentLabelMatArray = (Mat[])this.currentLabelMatArray.Clone();
  47. if (this.currentLabelMat != null)
  48. newMod.currentLabelMat = this.currentLabelMat.Clone();
  49. return newMod;
  50. }
  51. /// <summary>
  52. /// 图形上所有的点
  53. /// </summary>
  54. public List<PointF> linePointList = new List<PointF>();
  55. /// <summary>
  56. /// 矩形内的连通域
  57. /// </summary>
  58. public int within = 0;
  59. /// <summary>
  60. /// 用于编号的坐标点集合,value为: aec_length(物理长度) + [1内部] + [label_x] + [label_y] + aec(晶粒面积)-多视场
  61. /// </summary>
  62. public List<Dictionary<int, List<double>>> massLabelPointsList = new List<Dictionary<int, List<double>>>();
  63. /// <summary>
  64. /// 用于编号的坐标点集合,value为: 备用数据 + [1内部] + [label_x] + [label_y],key为label
  65. /// </summary>
  66. public Dictionary<int, List<double>> massLabelPoints = new Dictionary<int, List<double>>();
  67. /// <summary>
  68. /// 视场内符合条件的连通域label集合-多视场
  69. /// </summary>
  70. public List<ArrayList> currentNccompSelectList = new List<ArrayList>();
  71. /// <summary>
  72. /// 视场内符合条件的连通域label集合
  73. /// </summary>
  74. public ArrayList currentNccompSelect = new ArrayList();
  75. /// <summary>
  76. /// Nx5 matrix (CV_32S) of statistics: x0, y0, width0, height0, area0-多视场
  77. /// </summary>
  78. public Mat[] currentStatsArray;
  79. /// <summary>
  80. /// Nx5 matrix (CV_32S) of statistics: x0, y0, width0, height0, area0
  81. /// </summary>
  82. public Mat currentStats;
  83. /// <summary>
  84. /// 存储连通域数据-多视场
  85. /// </summary>
  86. public Mat[] currentLabelMatArray;
  87. /// <summary>
  88. /// 存储连通域数据
  89. /// </summary>
  90. public Mat currentLabelMat;
  91. }
  92. }