123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- using OTSCOMMONCLR;
- using OTSDataType;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OTSModelSharp.Measure.OTSCleanliness
- {
- class CFieldDataClean : COTSFieldData
- {
- public CFieldDataClean(CBSEImgClr a_pBSEImg, double a_dPixelSize) : base(a_pBSEImg, a_dPixelSize)
- {
- }
- List<COTSParticleClr> m_listBigParticles = new List<COTSParticleClr>();
- List<COTSParticleClr> m_listSmallParticles = new List<COTSParticleClr>();
- double m_smallParticlePercentage;//if the small particles are measured for a percentage of the whole,then this variable remember the percentage.
- public List<COTSParticleClr> ListSmallParticles { get => m_listSmallParticles; set => m_listSmallParticles = value; }
- public List<COTSParticleClr> ListBigParticles { get => m_listBigParticles; set => m_listBigParticles = value; }
- public double SmallParticlePercentage { get => m_smallParticlePercentage; set => m_smallParticlePercentage = value; }
- // particle list
- public new List<COTSParticleClr> GetTopBorderedParticles()
- {
- List<COTSParticleClr> parts = new List<COTSParticleClr>();
- foreach (var p in ListBigParticles)
- {
- var segs = p.GetFeature().GetSegmentsList();//COTSSegment
- foreach (var seg in segs)
- {
- if (seg.GetHeight() == 0)
- {
- parts.Add(p);
- break;
- }
- }
- }
- return parts;
- }
- public new List<COTSParticleClr> GetBottomBorderedParticles()
- {
- List<COTSParticleClr> parts = new List<COTSParticleClr>();
- foreach (var p in ListBigParticles)
- {
- var segs = p.GetFeature().GetSegmentsList();
- foreach (var seg in segs)
- {
- if (seg.GetHeight() == this.Height - 1)//the lowest height is 767(height-1),cause starting from 0.
- {
- parts.Add(p);
- break;
- }
- }
- }
- return parts;
- }
- public new List<COTSParticleClr> GetLeftBorderedParticles()
- {
- List<COTSParticleClr> parts = new List<COTSParticleClr>();
- foreach (var p in ListBigParticles)
- {
- var segs = p.GetFeature().GetSegmentsList();
- foreach (var seg in segs)
- {
- if (seg.GetStart() == 0)
- {
- parts.Add(p);
- break;
- }
- }
- }
- return parts;
- }
- public new List<COTSParticleClr> GetRightBorderedParticles()
- {
- List<COTSParticleClr> parts = new List<COTSParticleClr>();
- foreach (var p in ListBigParticles)
- {
- var segs = p.GetFeature().GetSegmentsList();
- foreach (var seg in segs)
- {
- if (seg.GetStart() + seg.GetLength() == this.Width)
- {
- parts.Add(p);
- break;
- }
- }
- }
- return parts;
- }
- }
- }
|