]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix boulette ngo/AddFilter
authorNATHALIE GORE <ng13417n@dsp0897499.atlas.edf.fr>
Wed, 20 Nov 2019 09:54:45 +0000 (10:54 +0100)
committerNATHALIE GORE <ng13417n@dsp0897499.atlas.edf.fr>
Wed, 20 Nov 2019 09:54:45 +0000 (10:54 +0100)
src/FiltersPlugin/FiltersPlugin_SameNormalFaces.py
src/FiltersPlugin/filter-SameNormalFaces.xml

index 856d578cc43756655782d859215b2afc634a7413..6a85bf55456e85c6ccbc106562008e1a78fd8da2 100644 (file)
@@ -17,6 +17,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+import math
 
 from ModelAPI import *
 from GeomAPI import *
@@ -51,7 +52,7 @@ class FiltersPlugin_SameNormalFaces(ModelAPI_Filter):
   def isOk(self, theShape, theResult, theArgs):
     """ True if theShape is applicable for the filter """
 
-    selectedShapeAttr = modelAPI_AttributeSelection(theArgs.argument("SameNormalFaces"))
+    selectedShapeAttr = modelAPI_AttributeSelection(theArgs.argument("Face"))
     if selectedShapeAttr is None:
       return False
     selectedShape = selectedShapeAttr.value()
@@ -62,7 +63,7 @@ class FiltersPlugin_SameNormalFaces(ModelAPI_Filter):
 
     Face = GeomAPI_Face(theShape)
     if not Face.isPlanar():
-        return self.myCached[selectedShape]
+        return False
     Plane = Face.getPlane()
     Normal = Plane.direction()
     if selectedPlane.intersect(Plane) is None and selectedNormal.angle(Normal) < math.pi/360:
@@ -76,7 +77,7 @@ class FiltersPlugin_SameNormalFaces(ModelAPI_Filter):
 
   def initAttributes(self, theArgs):
     """ Initializes arguments of a filter """
-    theArgs.initAttribute("SameNormalFaces", ModelAPI_AttributeSelection_typeId())
+    theArgs.initAttribute("Face", ModelAPI_AttributeSelection_typeId())
 
   def adjacentFaces(self, theFace, theMapSA, theShapeType, theApplicableFaces, theRecursive = True):
     """ Find all faces neighbour to theFace """
index dd7a251a22b3f944c16986c7346c539825da1fc9..3ec0dd023fc088afacd919cf8b111f9a3d42affc 100644 (file)
@@ -1,5 +1,5 @@
 <filter id="SameNormalFaces">
-  <shape_selector id="SameNormalFaces__SameNormalFaces"
+  <shape_selector id="SameNormalFaces__Face"
                   label="Planes:"
                   tooltip="Select planes or planar faces."
                   shape_types="faces">