1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // GEOM GEOMGUI : GUI for Geometry component
23 // File : GEOMToolsGUI_1.cxx
24 // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
26 #include <PyConsole_Console.h>
28 #include "GEOMToolsGUI.h"
29 #include "GEOMToolsGUI_TransparencyDlg.h"
30 #include "GEOMToolsGUI_NbIsosDlg.h"
32 #include <GeometryGUI.h>
33 #include <GEOM_Displayer.h>
36 #include <GEOM_Actor.h>
38 #include <SALOME_ListIO.hxx>
39 #include <SALOME_ListIteratorOfListIO.hxx>
44 #include <SVTK_ViewModel.h>
45 #include <SVTK_ViewWindow.h>
46 #include <SVTK_View.h>
48 #include <OCCViewer_ViewModel.h>
50 #include <SUIT_ViewManager.h>
51 #include <SUIT_Desktop.h>
52 #include <SUIT_ResourceMgr.h>
53 #include <SUIT_Session.h>
54 #include <SUIT_OverrideCursor.h>
55 #include <SUIT_MessageBox.h>
57 #include <SalomeApp_Application.h>
58 #include <SalomeApp_Study.h>
59 #include <SalomeApp_Module.h>
61 #include <LightApp_SelectionMgr.h>
62 #include <LightApp_NameDlg.h>
64 #include <GEOMImpl_Types.hxx>
66 #include "utilities.h"
69 #include <AIS_Drawer.hxx>
70 #include <Prs3d_IsoAspect.hxx>
71 #include <Prs3d_PointAspect.hxx>
72 #include <Graphic3d_AspectMarker3d.hxx>
75 #include <QColorDialog>
79 #include <vtkRenderer.h>
81 void GEOMToolsGUI::OnSettingsColor()
83 SUIT_Session* sess = SUIT_Session::session();
84 SUIT_ResourceMgr* resMgr = sess->resourceMgr();
85 SUIT_Desktop* desk = sess->activeApplication()->desktop();
87 QColor anInitColor = resMgr->colorValue( "Geometry", "SettingsShadingColor", QColor( "yellow" ) );
89 QColor aDialogColor = QColorDialog::getColor(anInitColor, desk );
90 if( aDialogColor.isValid() )
92 QString type = desk->activeWindow()->getViewManager()->getType();
93 if( type != OCCViewer_Viewer::Type() && type != SVTK_Viewer::Type() )
94 MESSAGE("Settings Color is not supported for current Viewer");
96 resMgr->setValue( "Geometry", "SettingsShadingColor", aDialogColor );
100 void GEOMToolsGUI::OnRename()
102 SALOME_ListIO selected;
103 SalomeApp_Application* app =
104 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
106 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
107 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
108 if ( aSelMgr && appStudy ) {
109 aSelMgr->selectedObjects( selected );
110 if ( !selected.IsEmpty() ) {
111 _PTR(Study) aStudy = appStudy->studyDS();
113 bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
115 SUIT_MessageBox::warning ( app->desktop(),
116 QObject::tr("WRN_WARNING"),
117 QObject::tr("WRN_STUDY_LOCKED") );
121 bool isAny = false; // is there any appropriate object selected
122 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
123 Handle(SALOME_InteractiveObject) IObject = It.Value();
125 _PTR(SObject) obj ( aStudy->FindObjectID(IObject->getEntry()) );
126 _PTR(GenericAttribute) anAttr;
128 if ( obj->FindAttribute(anAttr, "AttributeName") ) {
129 _PTR(AttributeName) aName (anAttr);
131 GEOM::GEOM_Object_var anObj =
132 GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
133 if (!CORBA::is_nil(anObj)) {
135 QString newName = LightApp_NameDlg::getName( app->desktop(), aName->Value().c_str() );
136 if (!newName.isEmpty()) {
137 aName->SetValue( newName.toLatin1().data() ); // rename the SObject
138 IObject->setName( newName.toLatin1().data() );// rename the InteractiveObject
139 anObj->SetName( newName.toLatin1().data() ); // Rename the corresponding GEOM_Object
140 (dynamic_cast<SalomeApp_Module*>(app->activeModule()))->updateObjBrowser( false );
143 } // if ( name attribute )
148 SUIT_MessageBox::warning( app->desktop(),
149 QObject::tr("WRN_WARNING"),
150 QObject::tr("GEOM_WRN_NO_APPROPRIATE_SELECTION") );
157 app->updateActions(); //SRN: To update a Save button in the toolbar
160 void GEOMToolsGUI::OnCheckGeometry()
162 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
163 PyConsole_Console* pyConsole = app->pythonConsole();
166 pyConsole->exec("from GEOM_usinggeom import *");
169 void GEOMToolsGUI::OnAutoColor()
171 SALOME_ListIO selected;
172 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
176 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
177 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
178 if( !aSelMgr || !appStudy )
181 aSelMgr->selectedObjects( selected );
182 if( selected.IsEmpty() )
185 Handle(SALOME_InteractiveObject) anIObject = selected.First();
187 _PTR(Study) aStudy = appStudy->studyDS();
188 _PTR(SObject) aMainSObject( aStudy->FindObjectID( anIObject->getEntry() ) );
189 GEOM::GEOM_Object_var aMainObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aMainSObject));
190 if( CORBA::is_nil( aMainObject ) )
193 aMainObject->SetAutoColor( true );
195 QList<SALOMEDS::Color> aReservedColors;
197 GEOM_Displayer aDisp (appStudy);
199 SALOME_View* vf = aDisp.GetActiveView();
201 SUIT_ViewWindow* window = app->desktop()->activeWindow();
202 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
203 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
205 for( _PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) ); it->More(); it->Next() )
207 _PTR(SObject) aChildSObject( it->Value() );
208 GEOM::GEOM_Object_var aChildObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aChildSObject));
209 if( CORBA::is_nil( aChildObject ) )
212 if( aChildObject->GetType() != GEOM_GROUP )
215 SALOMEDS::Color aColor = GEOM_Displayer::getUniqueColor( aReservedColors );
216 aChildObject->SetColor( aColor );
217 aReservedColors.append( aColor );
219 QColor c( (int)( aColor.R * 255.0 ), (int)( aColor.G * 255.0 ), (int)( aColor.B * 255.0 ) );
221 SALOME_Prs* aPrs = vf->CreatePrs( aChildSObject->GetID().c_str() );
225 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
228 SVTK_View* aView = vtkVW->getView();
229 SUIT_OverrideCursor();
230 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
231 aView->SetColor( It.Value(), c );
235 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
236 Handle(AIS_InteractiveContext) ic = vm->getAISContext();
238 SOCC_Prs* anOCCPrs = dynamic_cast<SOCC_Prs*>( aPrs );
242 AIS_ListOfInteractive aList;
243 anOCCPrs->GetObjects( aList );
244 if( !aList.Extent() )
247 Handle(AIS_InteractiveObject) io = aList.First();
251 Quantity_Color aQuanColor( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
253 // Set color for a point
254 Handle(AIS_Drawer) aCurDrawer = io->Attributes();
255 Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
256 Quantity_Color aCurColor;
257 Standard_Real aCurScale;
258 Aspect_TypeOfMarker aCurTypeOfMarker;
259 aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
260 aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aQuanColor, aCurScale) );
261 ic->SetLocalAttributes( io, aCurDrawer );
263 io->SetColor( aQuanColor );
264 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
265 Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aQuanColor );
267 io->Redisplay( Standard_True );
271 app->updateActions(); //SRN: To update a Save button in the toolbar
274 void GEOMToolsGUI::OnDisableAutoColor()
276 SALOME_ListIO selected;
277 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
281 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
282 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
283 if( !aSelMgr || !appStudy )
286 aSelMgr->selectedObjects( selected );
287 if( selected.IsEmpty() )
290 Handle(SALOME_InteractiveObject) anIObject = selected.First();
292 _PTR(Study) aStudy = appStudy->studyDS();
293 _PTR(SObject) aMainSObject( aStudy->FindObjectID( anIObject->getEntry() ) );
294 GEOM::GEOM_Object_var aMainObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aMainSObject));
295 if( CORBA::is_nil( aMainObject ) )
298 aMainObject->SetAutoColor( false );
302 void GEOMToolsGUI::OnColor()
304 SALOME_ListIO selected;
305 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
306 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
307 if ( app && appStudy ) {
308 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
310 aSelMgr->selectedObjects( selected );
311 if ( !selected.IsEmpty() ) {
312 SUIT_ViewWindow* window = app->desktop()->activeWindow();
313 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
314 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
316 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
319 SVTK_View* aView = vtkVW->getView();
320 QColor initcolor = aView->GetColor( selected.First() );
321 QColor c = QColorDialog::getColor( initcolor, app->desktop() );
323 SUIT_OverrideCursor();
324 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
325 aView->SetColor( It.Value(), c );
330 Handle(AIS_InteractiveObject) io = GEOMBase::GetAIS( selected.First() );
331 if ( !io.IsNull() ) {
332 Quantity_Color aColor;
334 QColor initcolor( (int)( aColor.Red() * 255.0 ), (int)( aColor.Green() * 255.0 ), (int)( aColor.Blue() * 255.0 ) );
335 QColor c = QColorDialog::getColor( initcolor, app->desktop() );
337 SUIT_OverrideCursor();
338 aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
339 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
340 io = GEOMBase::GetAIS( It.Value(), true );
341 if ( !io.IsNull() ) {
342 // Set color for a point
343 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
344 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
345 Handle(AIS_Drawer) aCurDrawer = io->Attributes();
346 Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
347 Quantity_Color aCurColor;
348 Standard_Real aCurScale;
349 Aspect_TypeOfMarker aCurTypeOfMarker;
350 aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
351 aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aColor, aCurScale) );
352 ic->SetLocalAttributes(io, aCurDrawer);
354 io->SetColor( aColor );
355 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
356 Handle(GEOM_AISShape)::DownCast( io )->SetShadingColor( aColor );
358 io->Redisplay( Standard_True );
360 // store color to GEOM_Object
361 _PTR(Study) aStudy = appStudy->studyDS();
362 _PTR(SObject) aSObject( aStudy->FindObjectID( It.Value()->getEntry() ) );
363 GEOM::GEOM_Object_var anObject =
364 GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObject));
366 SALOMEDS::Color aSColor;
367 aSColor.R = (double)c.red() / 255.0;
368 aSColor.G = (double)c.green() / 255.0;
369 aSColor.B = (double)c.blue() / 255.0;
370 anObject->SetColor( aSColor );
371 anObject->SetAutoColor( false );
375 } // first IO is not null
377 } // if ( selection not empty )
381 app->updateActions(); //SRN: To update a Save button in the toolbar
384 void GEOMToolsGUI::OnTransparency()
386 GEOMToolsGUI_TransparencyDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
390 void GEOMToolsGUI::OnNbIsos()
392 SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
394 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
395 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
397 if(isOCC){ // if is OCCViewer
399 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
400 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
403 if ( ic->MoreCurrent() ) {
404 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
405 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
407 int UIso = CurDrawer->UIsoAspect()->Number();
408 int VIso = CurDrawer->VIsoAspect()->Number();
410 GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
411 new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
413 NbIsosDlg->setU( UIso );
414 NbIsosDlg->setV( VIso );
416 if ( NbIsosDlg->exec() ) {
417 SUIT_OverrideCursor();
418 for(; ic->MoreCurrent(); ic->NextCurrent()) {
419 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
420 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
422 int nbUIso = NbIsosDlg->getU();
423 int nbVIso = NbIsosDlg->getV();
425 CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbUIso) );
426 CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbVIso) );
428 ic->SetLocalAttributes(CurObject, CurDrawer);
429 ic->Redisplay(CurObject);
434 else if(isVTK){ // if is VTKViewer
436 // Warning. It's works incorrect. must be recheked.
438 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
441 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
444 SALOME_ListIO selected;
445 aSelMgr->selectedObjects( selected );
446 if ( selected.IsEmpty() )
449 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
453 SALOME_View* view = GEOM_Displayer::GetActiveView();
455 vtkActorCollection* aCollection = vtkActorCollection::New();
457 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
458 Handle(SALOME_InteractiveObject) anIObject = It.Value();
459 SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() );
460 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( aPrs );
462 vtkActorCollection* anActors = vtkPrs->GetObjects();
463 anActors->InitTraversal();
464 vtkActor* anAct = anActors->GetNextActor();
465 aCollection->AddItem(anAct);
470 aCollection->InitTraversal();
477 vtkActor* anAct = aCollection->GetNextActor();
478 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct))
479 anActor->GetNbIsos(UIso,VIso);
483 GEOMToolsGUI_NbIsosDlg* NbIsosDlg =
484 new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
486 NbIsosDlg->setU( UIso );
487 NbIsosDlg->setV( VIso );
489 if ( NbIsosDlg->exec() ) {
490 SUIT_OverrideCursor();
492 while( anAct!=NULL ) {
493 if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){
494 // There are no casting to needed actor.
495 UIso = NbIsosDlg->getU();
496 VIso = NbIsosDlg->getV();
497 int aIsos[2]={UIso,VIso};
498 anActor->SetNbIsos(aIsos);
500 anAct = aCollection->GetNextActor();
506 void GEOMToolsGUI::OnOpen()
509 SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
510 _PTR(Study) aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
512 SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
513 Handle(SALOME_InteractiveObject) anIObject;
514 for(;It.More();It.Next()) {
515 anIObject = It.Value();
516 _PTR(SObject) obj ( aStudy->FindObjectID(anIObject->getEntry()) );
517 _PTR(AttributePersistentRef) aPersist;
518 _PTR(AttributeIOR) anIOR;
520 // this SObject may be GEOM module root SObject
521 _PTR(ChildIterator) anIter ( aStudy->NewChildIterator() );
522 _PTR(GenericAttribute) anAttr;
523 bool useSubItems = false;
524 while (anIter->More() && !useSubItems) {
525 _PTR(SObject) subobj ( anIter->Value() );
526 if (subobj->FindAttribute(anAttr, "AttributePersistentRef")) {
533 obj->FindAttribute(anAttr, "AttributePersistentRef");
535 while(useSubItems?anIter->More():!anAttr->_is_nil()) {
536 if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
537 obj->FindAttribute(anAttr, "AttributePersistentRef")) {
538 _PTR(SComponent) FComp ( obj->GetFatherComponent() );
540 if (FComp->FindAttribute(anAttr, "AttributeName")) {
541 _PTR(AttributeName) aName ( anAttr );
542 QString compName = QAD_Application::getDesktop()->getComponentName(aName->Value().c_str());
543 // parent->loadComponentData(parent->getComponentName(aName->Value()));
544 Engines::Component_var comp ;
545 if ( compName.compare("SUPERV") == 0 ) {
546 comp = QAD_Application::getDesktop()->getEngine( "SuperVisionContainer", compName) ;
549 comp = QAD_Application::getDesktop()->getEngine( "FactoryServer", compName);
550 if ( comp->_is_nil() )
551 comp = QAD_Application::getDesktop()->getEngine( "FactoryServerPy", compName);
554 if (!CORBA::is_nil(comp)) {
555 SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
556 if (!CORBA::is_nil(driver)) {
557 SALOMEDS::StudyBuilder_var B = dynamic_cast<SALOMEDS_Study*>(aStudy.get())->GetStudy()->NewBuilder();
558 if (!CORBA::is_nil(B)) {
559 B->LoadWith(FComp,driver);
565 MESSAGE("loadComponentData(): Driver is null");
570 MESSAGE("loadComponentData(): Engine is null");
574 // Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
575 // if (!CORBA::is_nil(comp)) {
576 // SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
577 // SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
578 // SALOMEDS::SComponent_var SC = aStudy->FindComponent("GEOM");
579 // if (!CORBA::is_nil(SC))
580 // aStudyBuilder->LoadWith(SC,driver);
584 MESSAGE("Component is null");
589 obj.reset( anIter->Value() );
599 void GEOMToolsGUI::OnSelectOnly(int mode)
601 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
603 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
604 GEOM_Displayer aDisp (appStudy);
605 aDisp.GlobalSelection(mode);
606 getGeometryGUI()->setLocalSelectionMode(mode);
610 void GEOMToolsGUI::OnShowHideChildren( bool show )
612 SALOME_ListIO selected;
613 SalomeApp_Application* app =
614 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
616 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
617 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
618 if ( aSelMgr && appStudy ) {
619 aSelMgr->selectedObjects( selected );
620 if ( !selected.IsEmpty() ) {
621 _PTR(Study) aStudy = appStudy->studyDS();
622 _PTR(StudyBuilder) B = aStudy->NewBuilder();
624 bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
626 SUIT_MessageBox::warning( app->desktop(),
627 QObject::tr( "WRN_WARNING" ),
628 QObject::tr( "WRN_STUDY_LOCKED" ) );
632 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
633 Handle(SALOME_InteractiveObject) IObject = It.Value();
635 _PTR(SObject) obj ( aStudy->FindObjectID( IObject->getEntry() ) );
636 _PTR(GenericAttribute) anAttr;
638 _PTR(AttributeExpandable) aExp = B->FindOrCreateAttribute( obj, "AttributeExpandable" );
639 aExp->SetExpandable( show );
644 app->updateObjectBrowser( false );
645 app->updateActions();