]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Origin selection as Rotation center of Sketch Rotation feature.
authornds <nds@opencascade.com>
Fri, 7 Apr 2017 09:12:11 +0000 (12:12 +0300)
committernds <nds@opencascade.com>
Fri, 7 Apr 2017 09:12:30 +0000 (12:12 +0300)
src/ModuleBase/ModuleBase_ViewerFilters.cpp

index 03d24a4693071b58352a3828cabaca3ca25f6a16..31a8e9be31ada34075fc4008ab8ce7be2cad6cb9 100644 (file)
@@ -87,7 +87,10 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(
 
   if (myPlane.get()) {
     aValid = Standard_False;
-    if (theOwner->HasSelectable()) {
+    // selectable may be empty if the object is selected in Object Browser and is not visualized
+    // in the viewer(virtual owner is created for this case)
+    //if (theOwner->HasSelectable())
+    {
       gp_Pln aPlane = myPlane->impl<gp_Pln>();
       Handle(StdSelect_BRepOwner) aShapeOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
       if (!aShapeOwner.IsNull() && aShapeOwner->HasShape()) {
@@ -112,6 +115,7 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(
         break;
         }
       } else {
+        if (theOwner->HasSelectable()) {
         // Check Trihedron sub-objects
         Handle(SelectMgr_SelectableObject) aSelObj = theOwner->Selectable();
         Handle(Standard_Type) aType = aSelObj->DynamicType();
@@ -156,6 +160,7 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(
 #endif
         // This is not object controlled by the filter
         aValid = Standard_True;
+        }
       }
     }
   }