Salome HOME
Make SMESH mesh not up-to-date if only group is updated. V9_5_0b1
authormpv <mikhail.ponikarov@opencascade.com>
Mon, 18 May 2020 09:58:25 +0000 (12:58 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Mon, 18 May 2020 09:58:25 +0000 (12:58 +0300)
An example: load file with SHAPER, and SMESH objects with sub-mesh on group created. Activate SHAPER, edit group, activate SMESH: no changes were required.

src/PY/SHAPERSTUDY_Object.py

index 8fc2cacc834480bb442ff4bc1c1882336409960d..c7b4ae195da7b0cfe409085a05ddbed9df7208c5 100755 (executable)
@@ -389,14 +389,19 @@ class SHAPERSTUDY_Group(SHAPERSTUDY_ORB__POA.SHAPER_Group, SHAPERSTUDY_Object):
           aMainShape = self.GetMainShape()
           if aMainShape:
             aTick = aMainShape.GetTick()
-        if aTick != self.selectionTick or aTick == -2:
+        if aTick > self.selectionTick or aTick == -2:
           self.selectionOld = self.selection
           self.selection = theSelection
           self.selectionTick = aTick
           #print("Set selection " + self.entry + " old = " + str(self.selectionOld) + " new = " + str(self.selection) + " tick = " + str(aTick))
-        else:
+        elif self.selection != theSelection:
+          self.selectionOld = self.selection
           self.selection = theSelection
-          #print("Set selection " + self.entry + " tick = " + str(aTick))
+          if self.selectionTick < 0:
+            self.selectionTick = aTick + 1
+          else:
+            self.selectionTick = self.selectionTick + 1 # when the group is changed, but the main shape stays the same, make tick + 1
+          #print("Set selection " + self.entry + " old = " + str(self.selectionOld) + " new = " + str(self.selection) + " tick = " + str(self.selectionTick))
         pass
 
     def GetSelection(self):