Salome HOME
Merge remote-tracking branch 'origin/Dev_0.6'
[modules/shaper.git] / src / ModuleBase / ModuleBase_ViewerFilters.cpp
index 1d17c685915bf7e4e47b66f1270816345d4c21a0..94625a48094797a60e63dad02d46e11366f26907 100644 (file)
@@ -31,13 +31,17 @@ Standard_Boolean ModuleBase_ShapeDocumentFilter::IsOk(const Handle(SelectMgr_Ent
     Handle(AIS_InteractiveObject) aAisObj = 
       Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable());
     if (!aAisObj.IsNull()) {
-      boost::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
+      std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
       aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj));
       ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj);
       if (aObj) {
         DocumentPtr aDoc = aObj->document();
         SessionPtr aMgr = ModelAPI_Session::get();
-        return (aDoc == aMgr->activeDocument() /* MPV: for the current moment selection in other document is not possible || (aDoc == aMgr->moduleDocument()*/);
+        return (aDoc == aMgr->activeDocument() || aDoc == aMgr->moduleDocument());
+      }
+      else {
+        // This is not object controlled by the filter
+        return Standard_True;
       }
     }
   }
@@ -74,6 +78,10 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(const Handle(SelectMgr_Enti
           bool aD3 = myPlane.Distance(aLastPnt) < Precision::Confusion();
           return aD1 && aD2 && aD3;
         }
+      default:
+        // This is not object controlled by the filter
+        return Standard_True;
+      break;
       }
     } else {
       // This is not object controlled by the filter
@@ -96,14 +104,14 @@ Standard_Boolean ModuleBase_ObjectTypesFilter::IsOk(const Handle(SelectMgr_Entit
     Handle(AIS_InteractiveObject) aAisObj = 
       Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable());
     if (!aAisObj.IsNull()) {
-      boost::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
+      std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
       aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj));
       ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj);
 
       foreach (QString aType, myTypes) {
         if (aType.toLower() == "construction") {
           ResultConstructionPtr aConstr = 
-            boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aObj);
+            std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aObj);
           return (aConstr != NULL);
         } // ToDo: Process other types of objects
       }