Преглед на файлове

FIX corrige l'erreur de recherche des duplicats graphiques

omassot преди 7 години
родител
ревизия
32448733e1
променени са 2 файла, в които са добавени 20 реда и са изтрити 10 реда
  1. 10 5
      schemas/mn1_rec.py
  2. 10 5
      schemas/mn2_rec.py

+ 10 - 5
schemas/mn1_rec.py

@@ -395,28 +395,33 @@ class Mn1Checker(BaseChecker):
             
         for i, tranchee in enumerate(self.tranchees):
             for other in self.tranchees[i+1:]:
-                if tranchee.geom.asLine() == other.geom.asLine():
+                if tranchee.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=tranchee)
+                    continue
                     
         for i, artere in enumerate(self.arteres):
             for other in self.arteres[i+1:]:
-                if artere.geom.asLine() == other.geom.asLine():
+                if artere.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=artere)
+                    continue
 
         for i, cable in enumerate(self.cables):
             for other in self.cables[i+1:]:
-                if cable.geom.asLine() == other.geom.asLine() and cable.CA_EQ_A == other.CA_EQ_A and cable.CA_EQ_B == other.CA_EQ_B:
+                if cable.geom.equals(other.geom) and cable.CA_EQ_A == other.CA_EQ_A and cable.CA_EQ_B == other.CA_EQ_B:
                     self.log_error("Une entité graphique est dupliquée", item=cable)
+                    continue
         
         for i, noeud in enumerate(self.noeuds):
             for other in self.noeuds[i+1:]:
-                if noeud.geom.asPoint() == other.geom.asPoint():
+                if noeud.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=noeud)
+                    continue
         
         for i, zapbo in enumerate(self.zapbos):
             for other in self.zapbos[i+1:]:
-                if zapbo.geom.asPoint() == other.geom.asPoint():
+                if zapbo.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=zapbo)
+                    continue
         
     def test_positions_noeuds(self):
         """ Topologie: Noeuds / Artères

+ 10 - 5
schemas/mn2_rec.py

@@ -423,28 +423,33 @@ class Mn2Checker(BaseChecker):
             
         for i, tranchee in enumerate(self.tranchees):
             for other in self.tranchees[i+1:]:
-                if tranchee.geom.asLine() == other.geom.asLine():
+                if tranchee.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=tranchee)
+                    continue
                     
         for i, artere in enumerate(self.arteres):
             for other in self.arteres[i+1:]:
-                if artere.geom.asLine() == other.geom.asLine():
+                if artere.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=artere)
+                    continue
 
         for i, cable in enumerate(self.cables):
             for other in self.cables[i+1:]:
-                if cable.geom.asLine() == other.geom.asLine() and cable.CA_EQ_A == other.CA_EQ_A and cable.CA_EQ_B == other.CA_EQ_B:
+                if cable.geom.equals(other.geom) and cable.CA_EQ_A == other.CA_EQ_A and cable.CA_EQ_B == other.CA_EQ_B:
                     self.log_error("Une entité graphique est dupliquée", item=cable)
+                    continue
         
         for i, noeud in enumerate(self.noeuds):
             for other in self.noeuds[i+1:]:
-                if noeud.geom.asPoint() == other.geom.asPoint():
+                if noeud.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=noeud)
+                    continue
         
         for i, zapbo in enumerate(self.zapbos):
             for other in self.zapbos[i+1:]:
-                if zapbo.geom.asPoint() == other.geom.asPoint():
+                if zapbo.geom.equals(other.geom):
                     self.log_error("Une entité graphique est dupliquée", item=zapbo)
+                    continue
         
     def test_positions_noeuds(self):
         """ Topologie: Noeuds / Artères