-// 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
// 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
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
//
#include "GEOMGUI_OCCSelector.h"
+#include "GEOM_Annotation.hxx"
#include <LightApp_DataSubOwner.h>
#include <OCCViewer_ViewModel.h>
#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Study.h>
#include <SALOME_InteractiveObject.hxx>
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;
void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
{
OCCViewer_Viewer* vw = viewer();
- if ( !vw )
+ if ( !vw || !vw->isSelectionEnabled())
return;
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ bool anAutoBringToFront = aResourceMgr->booleanValue( "Geometry", "auto_bring_to_front", false );
+
Handle(AIS_InteractiveContext) ic = vw->getAISContext();
// "entry - list_of_int" map for LOCAL selection
{
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 ) )
else
ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
}
+
ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode
- if (n < 3000)
- ic->HilightSelected(/*updateviewer*/Standard_True);
- else
- vw->update();
+
+ //rnv: In case Automatic Bring To Front viewer will be updated later
+ if(!anAutoBringToFront) {
+ if (n < 3000)
+ ic->HilightSelected(Standard_True);
+ else
+ vw->update();
+ }
// fill extra selected
mySelectedExternals.clear();