Salome HOME
Remove debug output
[modules/geom.git] / src / GEOMGUI / GEOMGUI_OCCSelector.cxx
index faf21e358a184b7b52b86e77411979d78143cbf7..7ab8db1f9a4bc76ac6c2471d0936e742cb2d0563 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,6 +24,7 @@
 // Author : Alexander SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
 //
 #include "GEOMGUI_OCCSelector.h"
+#include "GEOM_Annotation.hxx"
 
 #include <LightApp_DataSubOwner.h>
 
@@ -176,7 +177,11 @@ static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
     Handle(SelectMgr_Selection) sel = theObj->Selection( m );
 
     for ( sel->Init(); sel->More(); sel->Next() ) {
-      Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
+      const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive();
+      if( aHSenEntity.IsNull() )
+        continue;
+
+      Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive();
       if ( entity.IsNull() )
         continue;
 
@@ -290,8 +295,16 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
       {
         anOwner = Handle(StdSelect_BRepOwner)::DownCast(owners( i ));
 
-        if ( anOwner.IsNull() || !anOwner->HasShape() )
+        if ( anOwner.IsNull() || !anOwner->HasShape() ) {
+          if ( globalSelMap.contains( entryStr ) ) {
+            Handle(GEOM_Annotation::GEOM_AnnotationOwner) anAnnotationOwner =
+                               Handle(GEOM_Annotation::GEOM_AnnotationOwner)::DownCast(owners( i ));
+            if ( !anAnnotationOwner.IsNull() ) {
+              ownersmap.Add( anAnnotationOwner );
+            }
+          }
           continue;
+        }
 
         // GLOBAL selection
         if ( !anOwner->ComesFromDecomposition() && globalSelMap.contains( entryStr ) )