1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 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
24 // File : GEOMBase_Tools.cxx
25 // Author : Damien COQUERET
29 #include "GEOMToolsGUI.h"
30 #include "GEOMToolsGUI_DeleteDlg.h"
32 #include "GeometryGUI.h"
33 #include "GEOM_Actor.h"
36 #include "GEOM_Operation.h"
37 #include "GEOM_Displayer.h"
39 #include <SUIT_Session.h>
40 #include <SUIT_Application.h>
41 #include <SUIT_OverrideCursor.h>
42 #include <SUIT_MessageBox.h>
43 #include <SUIT_Tools.h>
44 #include <SUIT_FileDlg.h>
45 #include <SUIT_Desktop.h>
46 #include <SUIT_ViewModel.h>
48 #include <SalomeApp_Application.h>
49 #include <SalomeApp_Study.h>
50 #include <LightApp_SelectionMgr.h>
51 #include <GEOMImpl_Types.hxx>
53 #include <SALOME_ListIteratorOfListIO.hxx>
54 #include <SALOME_Prs.h>
56 #include "utilities.h"
59 #include <qapplication.h>
63 #include <TCollection_AsciiString.hxx>
67 typedef QMap<QString, QString> FilterMap;
69 //=======================================================================
70 // function : getFileName
71 // purpose : Selection of a file name for Import/Export. Returns also
72 // the selected file type code through <filter> argument.
73 //=======================================================================
74 static QString getFileName( QWidget* parent,
75 const QString& initial,
76 const FilterMap& filterMap,
77 const QStringList filters,
78 const QString& caption,
81 bool showCurrentDirInitially = false)
83 static QString lastUsedFilter;
84 //QStringList filters;
86 for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) {
87 //filters.push_back( it.key() );
89 if (it.key().contains("BREP", false)) {
90 aBrepFilter = it.key();
94 SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true );
95 if ( !caption.isEmpty() )
96 fd->setCaption( caption );
98 if ( !initial.isEmpty() )
99 fd->setSelection( initial );
101 if ( showCurrentDirInitially && SUIT_FileDlg::getLastVisitedPath().isEmpty() )
102 fd->setDir( QDir::currentDirPath() );
104 fd->setFilters( filters );
106 if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) )
107 fd->setSelectedFilter( lastUsedFilter );
109 if (!aBrepFilter.isEmpty()) {
110 fd->setSelectedFilter(aBrepFilter);
115 QString filename = fd->selectedFile();
116 format = filterMap[fd->selectedFilter()];
117 lastUsedFilter = fd->selectedFilter();
119 qApp->processEvents();
123 //=======================================================================
124 // function : getParentComponent
125 // purpose : Get object's parent component entry
126 //=======================================================================
127 static QString getParentComponent( _PTR( SObject ) obj )
130 _PTR(SComponent) comp = obj->GetFatherComponent();
132 return QString( comp->GetID().c_str() );
137 //=====================================================================================
139 // purpose : check if the object(s) passed as the the second arguments are used
140 // by the other objects in the study
141 //=====================================================================================
142 static bool inUse( _PTR(Study) study, const QString& component, const QMap<QString,QString>& objects )
144 _PTR(SObject) comp = study->FindObjectID( component.latin1() );
148 // collect all GEOM objects being deleted
149 QMap<QString, GEOM::GEOM_Object_var> gobjects;
150 QMap<QString, QString>::ConstIterator oit;
151 for ( oit = objects.begin(); oit != objects.end(); ++oit ) {
152 _PTR(SObject) so = study->FindObjectID( oit.key().latin1() );
155 CORBA::Object_var corbaObj_rem = GeometryGUI::ClientSObjectToObject( so );
156 GEOM::GEOM_Object_var geomObj_rem = GEOM::GEOM_Object::_narrow( corbaObj_rem );
157 if( CORBA::is_nil( geomObj_rem ) )
159 gobjects.insert( oit.key(), geomObj_rem );
162 // browse through all GEOM data tree
163 _PTR(ChildIterator) it ( study->NewChildIterator( comp ) );
164 for ( it->InitEx( true ); it->More(); it->Next() ) {
165 _PTR(SObject) child( it->Value() );
166 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( child );
167 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
168 if( CORBA::is_nil( geomObj ) )
171 GEOM::ListOfGO_var list = geomObj->GetDependency();
172 if( list->length() <= 1 )
173 continue; // ??? why 1?
175 for( int i = 0; i < list->length(); i++ ) {
176 bool depends = false;
177 bool deleted = false;
178 QMap<QString, GEOM::GEOM_Object_var>::Iterator git;
179 for ( git = gobjects.begin(); git != gobjects.end() && ( !depends || !deleted ); ++git ) {
180 depends = depends || list[i]->_is_equivalent( *git );
181 deleted = deleted || git.key() == child->GetID().c_str() ;//geomObj->_is_equivalent( *git );
183 if ( depends && !deleted )
191 //=======================================================================
192 // function : GEOMToolsGUI()
193 // purpose : Constructor
194 //=======================================================================
195 GEOMToolsGUI::GEOMToolsGUI( GeometryGUI* parent )
201 //=======================================================================
202 // function : ~GEOMToolsGUI()
203 // purpose : Destructor
204 //=======================================================================
205 GEOMToolsGUI::~GEOMToolsGUI()
210 //=======================================================================
211 // function : OnGUIEvent()
213 //=======================================================================
214 bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
216 getGeometryGUI()->EmitSignalDeactivateDialog();
218 switch (theCommandID)
230 case 111: // IMPORT BREP
231 case 112: // IMPORT IGES
232 case 113: // IMPORT STEP
237 case 121: // EXPORT BREP
238 case 122: // EXPORT IGES
239 case 123: // EXPORT STEP
244 case 2171: // POPUP VIEWER - SELECT ONLY - VERTEX
246 OnSelectOnly( GEOM_POINT );
249 case 2172: // POPUP VIEWER - SELECT ONLY - EDGE
251 OnSelectOnly( GEOM_EDGE );
254 case 2173: // POPUP VIEWER - SELECT ONLY - WIRE
256 OnSelectOnly( GEOM_WIRE );
259 case 2174: // POPUP VIEWER - SELECT ONLY - FACE
261 OnSelectOnly( GEOM_FACE );
264 case 2175: // POPUP VIEWER - SELECT ONLY - SHELL
266 OnSelectOnly( GEOM_SHELL );
269 case 2176: // POPUP VIEWER - SELECT ONLY - SOLID
271 OnSelectOnly( GEOM_SOLID );
274 case 2177: // POPUP VIEWER - SELECT ONLY - COMPOUND
276 OnSelectOnly( GEOM_COMPOUND );
279 case 2178: // POPUP VIEWER - SELECT ONLY - SELECT ALL
281 OnSelectOnly( GEOM_ALLOBJECTS );
284 case 411: // SETTINGS - ADD IN STUDY
286 // SAN -- TO BE REMOVED !!!
289 case 412: // SETTINGS - SHADING COLOR
294 case 804: // ADD IN STUDY - POPUP VIEWER
296 // SAN -- TO BE REMOVED !!!!
304 case 5103: // CHECK GEOMETRY
309 case 8032: // COLOR - POPUP VIEWER
314 case 8033: // TRANSPARENCY - POPUP VIEWER
319 case 8034: // ISOS - POPUP VIEWER
324 case 8035: // AUTO COLOR - POPUP VIEWER
329 case 8036: // DISABLE AUTO COLOR - POPUP VIEWER
331 OnDisableAutoColor();
334 case 9024 : // OPEN - OBJBROSER POPUP
341 SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
349 //===============================================================================
350 // function : OnEditDelete()
352 //===============================================================================
353 void GEOMToolsGUI::OnEditDelete()
355 SALOME_ListIO selected;
356 SalomeApp_Application* app =
357 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
361 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
362 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
363 if ( !aSelMgr || !appStudy )
367 aSelMgr->selectedObjects( selected, "ObjectBrowser", false );
368 if ( selected.IsEmpty() )
371 _PTR(Study) aStudy = appStudy->studyDS();
373 // check if study is locked
374 if ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() )->IsLocked() ) {
375 SUIT_MessageBox::warn1( app->desktop(),
377 tr("WRN_STUDY_LOCKED"),
379 return; // study is locked
382 // get GEOM component
383 CORBA::String_var geomIOR = app->orb()->object_to_string( GeometryGUI::GetGeomGen() );
384 QString geomComp = getParentComponent( aStudy->FindObjectIOR( geomIOR.in() ) );
386 // check each selected object: if belongs to GEOM, if not reference...
387 QMap<QString,QString> toBeDeleted;
388 QMap<QString,QString> allDeleted;
389 bool isComponentSelected = false;
390 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
391 Handle(SALOME_InteractiveObject) anIObject = It.Value();
392 if ( !anIObject->hasEntry() )
393 continue; // invalid object
395 QString entry = anIObject->getEntry();
396 _PTR(SObject) obj = aStudy->FindObjectID( entry.latin1() );
397 // check parent component
398 QString parentComp = getParentComponent( obj );
399 if ( parentComp != geomComp ) {
400 SUIT_MessageBox::warn1( app->desktop(),
401 QObject::tr("ERR_ERROR"),
402 QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ),
403 QObject::tr("BUT_OK") );
404 return; // not GEOM object selected
407 ///////////////////////////////////////////////////////
408 // if GEOM component is selected, so skip other checks
409 if ( isComponentSelected ) continue;
410 ///////////////////////////////////////////////////////
412 // check if object is reference
413 _PTR(SObject) refobj;
414 if ( obj && obj->ReferencedObject( refobj ) )
415 continue; // skip references
417 QString aName = obj->GetName().c_str();
418 if ( entry == geomComp ) {
419 // GEOM component is selected, skip other checks
420 isComponentSelected = true;
423 toBeDeleted.insert( entry, aName );
424 allDeleted.insert( entry, aName ); // skip GEOM component
425 // browse through all children recursively
426 _PTR(ChildIterator) it ( aStudy->NewChildIterator( obj ) );
427 for ( it->InitEx( true ); it->More(); it->Next() ) {
428 _PTR(SObject) child( it->Value() );
429 if ( child && child->ReferencedObject( refobj ) )
430 continue; // skip references
431 aName = child->GetName().c_str();
432 if ( !aName.isEmpty() )
433 allDeleted.insert( child->GetID().c_str(), aName );
437 // is there is anything to delete?
438 if ( !isComponentSelected && allDeleted.count() <= 0 )
439 return; // nothing to delete
441 // show confirmation dialog box
442 GEOMToolsGUI_DeleteDlg dlg( app->desktop(), allDeleted, isComponentSelected );
444 return; // operation is cancelled by user
446 // get currently opened views
447 QPtrList<SALOME_View> views;
449 ViewManagerList vmans = app->viewManagers();
450 SUIT_ViewManager* vman;
451 for ( vman = vmans.first(); vman; vman = vmans.next() ) {
452 SUIT_ViewModel* vmod = vman->getViewModel();
453 view = dynamic_cast<SALOME_View*> ( vmod ); // must work for OCC and VTK views
455 views.append( view );
458 _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
459 GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
461 if ( isComponentSelected ) {
462 // GEOM component is selected: delete all objects recursively
463 _PTR(SObject) comp = aStudy->FindObjectID( geomComp.latin1() );
466 _PTR(ChildIterator) it ( aStudy->NewChildIterator( comp ) );
467 // remove top-level objects only
468 for ( it->InitEx( false ); it->More(); it->Next() ) {
469 _PTR(SObject) child( it->Value() );
470 // remove object from GEOM engine
471 removeObjectWithChildren( child, aStudy, views, disp );
472 // remove object from study
473 aStudyBuilder->RemoveObjectWithChildren( child );
477 // GEOM component is not selected: check if selected objects are in use
478 if ( inUse( aStudy, geomComp, allDeleted ) ) {
479 SUIT_MessageBox::warn1( app->desktop(),
480 QObject::tr("WRN_WARNING"),
481 QObject::tr("DEP_OBJECT"),
482 QObject::tr("BUT_OK") );
483 return; // object(s) in use
485 // ... and then delete all objects
486 QMap<QString, QString>::Iterator it;
487 for ( it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) {
488 _PTR(SObject) obj ( aStudy->FindObjectID( it.key().latin1() ) );
489 // remove object from GEOM engine
490 removeObjectWithChildren( obj, aStudy, views, disp );
491 // remove objects from study
492 aStudyBuilder->RemoveObjectWithChildren( obj );
497 aSelMgr->setSelectedObjects( selected );
498 getGeometryGUI()->updateObjBrowser();
499 app->updateActions(); //SRN: To update a Save button in the toolbar
503 //==============================================================================
504 // function : OnEditCopy()
506 //==============================================================================
507 void GEOMToolsGUI::OnEditCopy()
510 SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection() );
511 GEOM::string_array_var listIOR = new GEOM::string_array;
513 const SALOME_ListIO& List = Sel->StoredIObjects();
515 myGeomBase->ConvertListOfIOInListOfIOR(List, listIOR);
517 Sel->ClearIObjects();
519 SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
520 int aStudyID = aStudy->StudyId();
522 for (unsigned int ind = 0; ind < listIOR->length();ind++) {
523 GEOM::GEOM_Object_var aShapeInit = myGeom->GetIORFromString(listIOR[ind]);
525 GEOM::GEOM_IInsertOperations_var IOp = myGeom->GetIInsertOperations(aStudyID);
526 GEOM::GEOM_Object_var result = IOp->MakeCopy(aShapeInit);
527 myGeomBase->Display(result);
529 catch (const SALOME::SALOME_Exception& S_ex) {
530 QtCatchCorbaException(S_ex);
534 QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
539 //=====================================================================================
541 // purpose : BRep, Iges, Step
542 //=====================================================================================
543 bool GEOMToolsGUI::Import()
545 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( getGeometryGUI()->getApp() );
546 //SUIT_Application* app = getGeometryGUI()->getApp();
547 if (! app) return false;
549 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
551 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
554 _PTR(Study) aStudy = stud->studyDS();
556 bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
558 SUIT_MessageBox::warn1 ( app->desktop(),
559 QObject::tr("WRN_WARNING"),
560 QObject::tr("WRN_STUDY_LOCKED"),
561 QObject::tr("BUT_OK") );
565 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
566 if ( CORBA::is_nil( eng ) ) {
567 SUIT_MessageBox::error1( app->desktop(),
568 QObject::tr("WRN_WARNING"),
569 QObject::tr( "GEOM Engine is not started" ),
570 QObject::tr("BUT_OK") );
574 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
575 if ( aInsOp->_is_nil() )
578 GEOM::GEOM_Object_var anObj;
580 // Obtain a list of available import formats
583 GEOM::string_array_var aFormats, aPatterns;
584 aInsOp->ImportTranslators( aFormats, aPatterns );
586 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
587 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
588 filters.push_back( (char*)aPatterns[i] );
593 QString fileName = getFileName(app->desktop(), "", aMap, filters,
594 tr("GEOM_MEN_IMPORT"), true, fileType, true);
596 if (fileType.isEmpty() )
598 // Trying to detect file type
599 QFileInfo aFileInfo( fileName );
600 QString aPossibleType = (aFileInfo.extension(false)).upper() ;
602 if ( (aMap.values()).contains(aPossibleType) )
603 fileType = aPossibleType;
606 if (fileName.isEmpty() || fileType.isEmpty())
609 GEOM_Operation* anOp = new GEOM_Operation (app, aInsOp.in());
611 SUIT_OverrideCursor wc;
613 app->putInfo(tr("GEOM_PRP_LOADING").arg(SUIT_Tools::file(fileName, /*withExten=*/true)));
617 CORBA::String_var fileN = fileName.latin1();
618 CORBA::String_var fileT = fileType.latin1();
619 anObj = aInsOp->Import(fileN, fileT);
621 if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
622 QString aPublishObjName =
623 GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true));
625 SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy(aStudy);
626 GeometryGUI::GetGeomGen()->PublishInStudy(aDSStudy,
627 SALOMEDS::SObject::_nil(),
631 GEOM_Displayer( stud ).Display( anObj.in() );
633 // update data model and object browser
634 getGeometryGUI()->updateObjBrowser( true );
641 SUIT_MessageBox::error1( app->desktop(),
642 QObject::tr( "GEOM_ERROR" ),
643 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
644 QObject::tr("BUT_OK") );
647 catch( const SALOME::SALOME_Exception& S_ex ) {
648 //QtCatchCorbaException(S_ex);
653 app->updateActions(); //SRN: To update a Save button in the toolbar
659 //=====================================================================================
661 // purpose : BRep, Iges, Step
662 //=====================================================================================
663 bool GEOMToolsGUI::Export()
665 SalomeApp_Application* app = getGeometryGUI()->getApp();
666 if (!app) return false;
668 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
670 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
673 _PTR(Study) aStudy = stud->studyDS();
675 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
676 if ( CORBA::is_nil( eng ) ) {
677 SUIT_MessageBox::error1( app->desktop(),
678 QObject::tr("WRN_WARNING"),
679 QObject::tr( "GEOM Engine is not started" ),
680 QObject::tr("BUT_OK") );
684 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
685 if ( aInsOp->_is_nil() )
688 // Obtain a list of available export formats
691 GEOM::string_array_var aFormats, aPatterns;
692 aInsOp->ExportTranslators( aFormats, aPatterns );
693 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
694 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
695 filters.push_back( (char*)aPatterns[i] );
698 // Get selected objects
699 LightApp_SelectionMgr* sm = app->selectionMgr();
703 SALOME_ListIO selectedObjects;
704 sm->selectedObjects( selectedObjects );
706 SALOME_ListIteratorOfListIO It( selectedObjects );
707 for(;It.More();It.Next()) {
708 Handle(SALOME_InteractiveObject) IObject = It.Value();
709 Standard_Boolean found;
710 GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(IObject, found);
712 if ( !found || anObj->_is_nil() )
716 QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, filters,
717 tr("GEOM_MEN_EXPORT"), false, fileType, true);
719 // User has pressed "Cancel" --> stop the operation
720 if ( file.isEmpty() || fileType.isEmpty() )
723 GEOM_Operation* anOp = new GEOM_Operation( app, aInsOp.in() );
725 SUIT_OverrideCursor wc;
727 app->putInfo( tr("GEOM_PRP_EXPORT").arg(SUIT_Tools::file( file, /*withExten=*/true )) );
732 aInsOp->Export( anObj, file, fileType.latin1() );
734 if ( aInsOp->IsDone() )
740 SUIT_MessageBox::error1( app->desktop(),
741 QObject::tr( "GEOM_ERROR" ),
742 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
743 QObject::tr("BUT_OK") );
747 catch (const SALOME::SALOME_Exception& S_ex) {
748 //QtCatchCorbaException(S_ex);
757 //=====================================================================================
758 // function : RemoveObjectWithChildren
759 // purpose : to be used by OnEditDelete() method
760 //=====================================================================================
761 void GEOMToolsGUI::removeObjectWithChildren(_PTR(SObject) obj,
763 QPtrList<SALOME_View> views,
764 GEOM_Displayer* disp)
766 // iterate through all children of obj
767 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
768 _PTR(SObject) child (it->Value());
769 removeObjectWithChildren(child, aStudy, views, disp);
772 // erase object and remove it from engine
773 _PTR(GenericAttribute) anAttr;
774 if (obj->FindAttribute(anAttr, "AttributeIOR")) {
775 _PTR(AttributeIOR) anIOR (anAttr);
777 // Delete shape in Client
778 const TCollection_AsciiString ASCIor ((char*)anIOR->Value().c_str());
779 getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCIor);
781 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj);
782 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
783 if (!CORBA::is_nil(geomObj)) {
784 // Erase graphical object
785 SALOME_View* view = views.first();
786 for (; view; view = views.next()) {
787 disp->Erase(geomObj, true, view);
790 // Remove object from Engine
791 GeometryGUI::GetGeomGen()->RemoveObject( geomObj );
796 //=================================================================================
797 // function : deactivate()
798 // purpose : Called when GEOM component is deactivated
799 //=================================================================================
800 void GEOMToolsGUI::deactivate()
802 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
804 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
805 GEOM_Displayer aDisp (appStudy);
806 aDisp.GlobalSelection();
807 getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
811 //=====================================================================================
813 //=====================================================================================
817 GEOMGUI* GetLibGUI( GeometryGUI* parent )
819 return new GEOMToolsGUI( parent );