]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix small issues found by regressions in unit tests
authorazv <azv@opencascade.com>
Thu, 8 Nov 2018 13:53:56 +0000 (16:53 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/BuildPlugin/Test/TestInterpolation.py
src/BuildPlugin/Test/TestWire.py
src/Model/Model_AttributeSelection.cpp
src/ModelHighAPI/ModelHighAPI_Tools.cpp
test.models/plug.py

index ddde2e5095f6b548c60f3d30175058059edc53fb..b3d8684441a34e933fe4533172866a5eed9f4b92 100644 (file)
@@ -175,4 +175,4 @@ model.end()
 # =============================================================================
 # Test 12. Check Python dump
 # =============================================================================
-assert(model.checkPythonDump())
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
index 5b9fdfc54a3efac8cf30bae9b7f9b1eb0d1b3edf..a489904432033f0ecd2f4d927ffe05a9f420adaa 100644 (file)
@@ -177,4 +177,4 @@ aSession.startOperation()
 aPart.removeFeature(aWireFeature3)
 aSession.finishOperation()
 
-assert(model.checkPythonDump())
+assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
index 77f6bb5fa5de16052e0f2c6f789966247f3876ef..90e39662bd8f946217c6b3ed684de039441298fb 100644 (file)
@@ -934,25 +934,22 @@ void Model_AttributeSelection::selectSubShape(
           aShapeToBeSelected->setImpl<TopoDS_Shape>(new TopoDS_Shape(aSelectorShape));
           // make the context result the latest existing
           aContext = newestContext(aContext, aShapeToBeSelected);
-          if (myIsGeometricalSelection) { // store the currently generated name
+          if (myIsGeometricalSelection || aCenterType == NOT_CENTER) { // store the currently generated name
             selectionLabel().ForgetAllAttributes(true);
             bool aToUnblock = false;
             aToUnblock = !owner()->data()->blockSendAttributeUpdated(true);
             myRef.setValue(aContext);
             aSelector.store();
+            aSelector.solve(aContextShape);
             owner()->data()->sendAttributeUpdated(this);
             if (aToUnblock)
               owner()->data()->blockSendAttributeUpdated(false);
             return;
-          } else { // re-select by context and value
-            if (aCenterType != NOT_CENTER) {
-              if (!aShapeToBeSelected->isEdge())
-                continue;
-              std::shared_ptr<GeomAPI_Edge> aSelectedEdge(new GeomAPI_Edge(aShapeToBeSelected));
-              setValueCenter(aContext, aSelectedEdge, aCenterType);
-            }
-            else
-              setValue(aContext, aShapeToBeSelected);
+          } else { // re-select center of circle/arc by context and value
+            if (!aShapeToBeSelected->isEdge())
+              continue;
+            std::shared_ptr<GeomAPI_Edge> aSelectedEdge(new GeomAPI_Edge(aShapeToBeSelected));
+            setValueCenter(aContext, aSelectedEdge, aCenterType);
           }
           return;
         }
index a8a2ffcf3a7d00854d934f2e372980f8cdba3843..d658206b4edd234876920cff8be3b980f14f9052 100644 (file)
@@ -548,7 +548,7 @@ bool checkPythonDump(const checkDumpType theCheckType)
     return false;
   }
 
-  bool isOk;
+  bool isOk = true;
   if (theCheckType & CHECK_NAMING) {
     // check dump with the selection by names
     isOk = checkDump(aSession, aFileForNamingDump, aStore, anErrorByNaming);
index 8915f5316d7aac1eb6ccd5f89d5c0e1fa527fdee..b390aced68340e8a64ee8f8d909f4156f45a4ed5 100644 (file)
@@ -437,11 +437,6 @@ model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
 model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
 model.testResultsVolumes(Result, [14144.443128843522572424262762070])
 
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "(Plug/Modified_Face&Sketch_1/SketchLine_4)(Plug/Modified_Face&Sketch_2/SketchCircle_1_2)(Plug/Modified_Face&Sketch_1/SketchLine_28)(Plug/Modified_Face&Sketch_1/SketchLine_3)(Plug/Modified_Face&Sketch_1/SketchLine_29)(Plug/Modified_Face&Sketch_1/SketchLine_30)(Plug/Modified_Face&Sketch_1/SketchLine_31)(Plug/Modified_Face&Sketch_1/SketchLine_33)(Plug/Modified_Face&Sketch_1/SketchLine_34)(Plug/Modified_Face&Sketch_1/SketchLine_1)(Plug/Modified_Face&Sketch_1/SketchLine_2)(Plug/Modified_Face&Sketch_1/SketchLine_32)"), model.selection("FACE", "(Plug/Modified_Face&Sketch_1/SketchLine_10)(Plug/Modified_Face&Sketch_1/SketchLine_9)(Plug/Modified_Face&Sketch_1/SketchArc_1_2)(Plug/Modified_Face&Sketch_1/SketchLine_7)(Plug/Modified_Face&Sketch_5/SketchLine_64)(Plug/Modified_Face&Sketch_1/SketchLine_8)(Plug/Modified_Face&Sketch_1/SketchLine_11)(Plug/Modified_Face&Sketch_1/SketchLine_12)(Plug/Modified_Face&Sketch_1/SketchLine_13)(Plug/Modified_Face&Sketch_1/SketchLine_14)(Plug/Modified_Face&Sketch_1/SketchLine_15)(Plug/Modified_Face&Sketch_1/SketchLine_16)(Plug/Modified_Face&Sketch_1/SketchLine_17)(Plug/Modified_Face&Sketch_1/SketchLine_18)(Plug/Modified_Face&Sketch_1/SketchLine_19)(Plug/Modified_Face&Sketch_1/SketchLine_20)(Plug/Modified_Face&Sketch_1/SketchLine_6)(Plug/Modified_Face&Sketch_1/SketchLine_5)(Plug/Modified_Face&Sketch_1/SketchLine_4)(Plug/Modified_Face&Sketch_2/SketchCircle_1_2)(Plug/Modified_Face&Sketch_1/SketchLine_28)(Plug/Modified_Face&Sketch_1/SketchLine_27)(Plug/Modified_Face&Sketch_1/SketchLine_26)(Plug/Modified_Face&Sketch_1/SketchLine_25)(Plug/Modified_Face&Sketch_1/SketchLine_24)(Plug/Modified_Face&Sketch_1/SketchLine_23)(Plug/Modified_Face&Sketch_1/SketchLine_22)(Plug/Modified_Face&Sketch_1/SketchLine_21)"), model.selection("FACE", "(Plug/Modified_Face&Sketch_1/SketchArc_1_2)(Plug/Modified_Face&Sketch_4/SketchLine_57)(Plug/Modified_Face&Sketch_4/SketchLine_58)(Plug/Modified_Face&Sketch_4/SketchArc_2_2)(Plug/Modified_Face&Sketch_4/SketchLine_55)(Plug/Modified_Face&Sketch_1/SketchLine_6)(Plug/Modified_Face&Sketch_1/SketchLine_5)(Plug/Modified_Face&Sketch_1/SketchLine_4)(Plug/Modified_Face&Sketch_1/SketchLine_28)(Plug/Modified_Face&Sketch_1/SketchLine_27)(Plug/Modified_Face&Sketch_1/SketchLine_26)(Plug/Modified_Face&Sketch_1/SketchLine_25)(Plug/Modified_Face&Sketch_1/SketchLine_24)(Plug/Modified_Face&Sketch_1/SketchLine_23)(Plug/Modified_Face&Sketch_1/SketchLine_22)(Plug/Modified_Face&Sketch_1/SketchLine_21)(Plug/Modified_Face&Sketch_1/SketchLine_3)(Plug/Modified_Face&Sketch_1/SketchLine_29)(Plug/Modified_Face&Sketch_1/SketchLine_30)(Plug/Modified_Face&Sketch_1/SketchLine_31)(Plug/Modified_Face&Sketch_3/SketchLine_42)(Plug/Modified_Face&Sketch_3/SketchLine_41)(Plug/Modified_Face&Sketch_3/SketchLine_40)(Plug/Modified_Face&Sketch_1/SketchLine_33)(Plug/Modified_Face&Sketch_1/SketchLine_34)(Plug/Modified_Face&Sketch_1/SketchLine_1)(Plug/Modified_Face&Sketch_1/SketchLine_2)"), model.selection("FACE", "(Plug/Modified_Face&Sketch_1/SketchLine_10)(Plug/Modified_Face&Sketch_1/SketchLine_9)(Plug/Modified_Face&Sketch_1/SketchArc_1_2)(Plug/Modified_Face&Sketch_1/SketchLine_7)(Plug/Modified_Face&Sketch_5/SketchLine_64)(Plug/Modified_Face&Sketch_1/SketchLine_8)(Plug/Modified_Face&Sketch_1/SketchLine_11)(Plug/Modified_Face&Sketch_1/SketchLine_12)(Plug/Modified_Face&Sketch_1/SketchLine_13)(Plug/Modified_Face&Sketch_1/SketchLine_14)(Plug/Modified_Face&Sketch_1/SketchLine_15)(Plug/Modified_Face&Sketch_1/SketchLine_16)(Plug/Modified_Face&Sketch_1/SketchLine_17)(Plug/Modified_Face&Sketch_1/SketchLine_18)(Plug/Modified_Face&Sketch_1/SketchLine_19)(Plug/Modified_Face&Sketch_1/SketchLine_20)(Plug/Modified_Face&Sketch_4/SketchLine_57)(Plug/Modified_Face&Sketch_4/SketchLine_58)(Plug/Modified_Face&Sketch_4/SketchArc_2_2)(Plug/Modified_Face&Sketch_4/SketchLine_55)")])
-Group_1.result().setColor(68, 68, 68)
-# check Group_1
-model.checkGroup(Group_1, GeomAPI_Shape.FACE)
-
 model.do()
 
 # change parameters of the model
@@ -519,8 +514,6 @@ model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
 model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
 model.testResultsVolumes(Result, [23373.503259112552768783643841743])
 
-model.checkGroup(Group_1, GeomAPI_Shape.FACE)
-
 model.end()
 
 assert(model.checkPythonDump())