X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLightApp%2FLightApp_VTKSelector.cxx;h=70db9624fa29aab715200b7910c4fbb30dfb4e8d;hb=331294345d3e1716fbf79ae25a2851011729be79;hp=019a959ec0e5900ed6833eb814a921f3dd8eb4cc;hpb=e07448c48ea5b2127e34fc7b8c3427d01c7ce17b;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_VTKSelector.cxx b/src/LightApp/LightApp_VTKSelector.cxx index 019a959ec..70db9624f 100644 --- a/src/LightApp/LightApp_VTKSelector.cxx +++ b/src/LightApp/LightApp_VTKSelector.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 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 @@ -33,14 +33,15 @@ #include "SVTK_Functor.h" #include "VTKViewer_Algorithm.h" #include + #include "SVTK_ViewModel.h" #endif #ifndef DISABLE_SALOMEOBJECT #include "SALOME_Actor.h" - #include "SALOME_ListIteratorOfListIO.hxx" + #include "SALOME_ListIO.hxx" #endif - +#include #ifndef DISABLE_VTKVIEWER #ifndef DISABLE_SALOMEOBJECT @@ -102,7 +103,7 @@ LightApp_SVTKDataOwner } } - return -1; + return ActorSelection; // workaround for embedded VTK viewer in a module : is it safe ? } /*! @@ -186,7 +187,11 @@ void LightApp_VTKSelector ::getSelection( SUIT_DataOwnerPtrList& aList ) const { - if(myViewer){ + if( myViewer ) { + if( SVTK_Viewer* aSViewer = dynamic_cast(myViewer) ) { + if( !aSViewer->isSelectionEnabled() ) + return; + } if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){ if(SVTK_ViewManager* aViewMgr = dynamic_cast(aViewManager)){ if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ @@ -212,7 +217,8 @@ void LightApp_VTKSelector ::setSelection( const SUIT_DataOwnerPtrList& theList ) { - if(myViewer){ + SVTK_Viewer* aViewer = dynamic_cast(myViewer); + if(myViewer && aViewer && aViewer->isSelectionEnabled()){ if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){ if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ if(SVTK_Selector* aSelector = aView->GetSelector()){ @@ -222,6 +228,7 @@ LightApp_VTKSelector for(; anIter != theList.end(); ++anIter){ const SUIT_DataOwner* aDataOwner = (*anIter).get(); if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast(aDataOwner)){ + MESSAGE("aSelector->SetSelectionMode("<GetMode()<<");"); aSelector->SetSelectionMode(anOwner->GetMode()); Handle(SALOME_InteractiveObject) anIO = anOwner->IO(); @@ -231,7 +238,7 @@ LightApp_VTKSelector aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false); }else if(const LightApp_DataOwner* anOwner = dynamic_cast(aDataOwner)){ Handle(SALOME_InteractiveObject) anIO = - new SALOME_InteractiveObject(anOwner->entry().toLatin1(),""); + new SALOME_InteractiveObject(anOwner->entry().toUtf8(),""); aSelector->AddIObject(anIO); anAppendList.Append(anIO); }