]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Get rid of deprecated OCCT methods.
authormzn <mzn@opencascade.com>
Tue, 31 Jul 2018 14:00:27 +0000 (17:00 +0300)
committermzn <mzn@opencascade.com>
Tue, 31 Jul 2018 14:00:27 +0000 (17:00 +0300)
src/GeomAPI/GeomAPI_Face.cpp
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/XGUI/XGUI_Selection.cpp

index 1541f26bca96513c57c02d6d4198c6ba8c032209..49e6db870727f50a9c20fb3ab9906f357c0faa5a 100644 (file)
@@ -82,9 +82,9 @@ bool GeomAPI_Face::isEqual(std::shared_ptr<GeomAPI_Shape> theFace) const
     return false;
 
   Handle(IntTools_Context) aContext = new IntTools_Context();
-  // Double check needed bacause BOPTools_AlgoTools::CheckSameGeom not very smart.
-  Standard_Boolean aRes = BOPTools_AlgoTools::CheckSameGeom(aMyFace, aInFace, aContext)
-    && BOPTools_AlgoTools::CheckSameGeom(aInFace, aMyFace, aContext);
+  // Double check needed because BOPTools_AlgoTools::AreFacesSameDomain not very smart.
+  Standard_Boolean aRes = BOPTools_AlgoTools::AreFacesSameDomain(aMyFace, aInFace, aContext)
+    && BOPTools_AlgoTools::AreFacesSameDomain(aInFace, aMyFace, aContext);
 
   return aRes == Standard_True;
 }
index 1646edc0d2bc230e17cfa35dc4001a2ed21285c2..c02a3e7671b1d88999ca3890ebff42663fd72d83 100755 (executable)
@@ -371,9 +371,12 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a
   AIS_Shape::ComputeSelection(aSelection, theMode);
 
   if (myAdditionalSelectionPriority > 0) {
-    for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
-      Handle(SelectBasics_EntityOwner) aBasicsOwner =
-        aSelection->Sensitive()->BaseSensitive()->OwnerId();
+    NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> anEntities = aSelection->Entities();
+    for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIt(anEntities);
+        anIt.More();
+        anIt.Next()) {
+      Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
+      Handle(SelectBasics_EntityOwner) aBasicsOwner = anEntity->BaseSensitive()->OwnerId();
       if (!aBasicsOwner.IsNull())
         aBasicsOwner->Set(aBasicsOwner->Priority() + myAdditionalSelectionPriority);
     }
@@ -397,12 +400,18 @@ bool ModuleBase_ResultPrs::appendVertexSelection(const Handle(SelectMgr_Selectio
     StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection,
                                                   aDeflection, myDrawer->HLRAngle(), 9, 500);
 
-    for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
+    
+    NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> anEntities = aSelection->Entities();
+    for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIt(anEntities);
+        anIt.More();
+        anIt.Next()) {
+      Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
       Handle(SelectMgr_EntityOwner) anOwner =
         Handle(SelectMgr_EntityOwner)
-        ::DownCast(aSelection->Sensitive()->BaseSensitive()->OwnerId());
+        ::DownCast(anEntity->BaseSensitive()->OwnerId());
       anOwner->Set(this);
     }
+
     return true;
   }
   return false;
index ed54a60a27ab034ff8100903077474cb28b4320a..ed58a97dafddafffea58b5f57884842b05ab0fd3 100644 (file)
@@ -374,11 +374,14 @@ void XGUI_Selection::entityOwners(const Handle(AIS_InteractiveObject)& theObject
       continue;
 
     Handle(SelectMgr_Selection) aSelection = theObject->Selection(aMode);
-    for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
-      Handle(SelectMgr_SensitiveEntity) anEntity = aSelection->Sensitive();
+    NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> anEntities = aSelection->Entities();
+    for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIt(anEntities);
+        anIt.More();
+        anIt.Next()) {
+      Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
       if (anEntity.IsNull())
         continue;
-      Handle(SelectMgr_EntityOwner) anOwner =
+       Handle(SelectMgr_EntityOwner) anOwner =
         Handle(SelectMgr_EntityOwner)::DownCast(anEntity->BaseSensitive()->OwnerId());
       if (!anOwner.IsNull())
         theOwners.Add(anOwner);