Explorar el Código

improve RemoveDuplicateOverlapParticles algorithm

gsp hace 1 año
padre
commit
b73491b5a9
Se han modificado 1 ficheros con 17 adiciones y 4 borrados
  1. 17 4
      OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSField.cs

+ 17 - 4
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSField.cs

@@ -407,7 +407,11 @@ namespace OTSDataType
                     p.GetOTSRect(ref left, ref top, ref right, ref bottom);
                     if ((right - this.GetOTSRect().GetTopLeft().X) < 2 * overlap)
                     {
-                        sideparts.Add(p);
+                        if (left != this.GetOTSRect().GetTopLeft().X)//not on the border
+                        {
+                            sideparts.Add(p);
+                        }
+                        
                     }
 
                 }
@@ -421,7 +425,10 @@ namespace OTSDataType
                     p.GetOTSRect(ref left, ref top, ref right, ref bottom);
                     if ((this.GetOTSRect().GetBottomRight().X-left) < 2 * overlap)
                     {
-                        sideparts.Add(p);
+                        if (right != this.GetOTSRect().GetBottomRight().X)//not on the border
+                        {
+                            sideparts.Add(p);
+                        }
                     }
 
                 }
@@ -435,7 +442,10 @@ namespace OTSDataType
                     p.GetOTSRect(ref left, ref top, ref right, ref bottom);
                     if ((this.GetOTSRect().GetTopLeft().Y - bottom) < 2 * overlap)
                     {
-                        sideparts.Add(p);
+                        if (top != this.GetOTSRect().GetTopLeft().Y)//not on the border
+                        {
+                            sideparts.Add(p);
+                        }
                     }
 
                 }
@@ -449,7 +459,10 @@ namespace OTSDataType
                     p.GetOTSRect(ref left, ref top, ref right, ref bottom);
                     if ((top-this.GetOTSRect().GetBottomRight().Y ) < 2 * overlap)
                     {
-                        sideparts.Add(p);
+                        if (bottom != this.GetOTSRect().GetBottomRight().Y)//not on the border
+                        {
+                            sideparts.Add(p);
+                        }
                     }
 
                 }