ソースを参照

optimize the GB calculate method.

gsp 2 年 前
コミット
1b239b7980
1 ファイル変更12 行追加12 行削除
  1. 12 12
      OTSCPP/OTSRptCalculate/GBCal/GBFieldData.cpp

+ 12 - 12
OTSCPP/OTSRptCalculate/GBCal/GBFieldData.cpp

@@ -248,15 +248,15 @@ namespace OTSGBCalculate
 		for (auto pParticle : m_listParticles)
 		{	// compute length width ratio
 
-			CRect rectParticle = pParticle->GetParticleRect();
-			//check the denominator is zero or not
-			if (rectParticle.Width() == 0)
+			auto w = pParticle->GetDMin();
+		
+			if (w == 0)
 			{
 				continue;
 			}
 			//获取最大长度和最小宽度
 			double h = pParticle->GetDMax();
-			double w = pParticle->GetDMin();
+		
 			double dLengthWidthRatio = h / w;
 			if (dLengthWidthRatio < 1)
 			{
@@ -489,16 +489,16 @@ namespace OTSGBCalculate
 		for (auto pParticle : m_listParticles)
 		{
 			
-			//IdentifyPartChemicalType(pParticle);
 			//check the denominator is zero or not
-			CRect rectParticle = pParticle->GetParticleRect();
-			if (rectParticle.Width() == 0)
+			auto w = pParticle->GetDMin();
+
+			if (w == 0)
 			{
 				continue;
 			}
 			//获取最小外接矩形的宽和高
 			double h = pParticle->GetDMax();
-			double w = pParticle->GetDMin();
+		
 			double dLengthWidthRatio = h / w;
 			if (dLengthWidthRatio < 1)
 			{
@@ -654,15 +654,15 @@ namespace OTSGBCalculate
 		for (auto pParticle : m_listParticles)
 		{	// compute length width ratio
 
-			CRect rectParticle = pParticle->GetParticleRect();
-			//check the denominator is zero or not
-			if (rectParticle.Width() == 0)
+			auto w = pParticle->GetDMin();
+
+			if (w == 0)
 			{
 				continue;
 			}
 			//获取最大长度和最小宽度
 			double h = pParticle->GetDMax();
-			double w = pParticle->GetDMin();
+		
 			double dLengthWidthRatio = h / w;
 			if (dLengthWidthRatio < 1)
 			{