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
22 // File : GEOMBase_Tools.cxx
23 // Author : Damien COQUERET, Open CASCADE S.A.S.
26 #include "GEOMToolsGUI.h"
27 #include "GEOMToolsGUI_DeleteDlg.h"
29 #include <GeometryGUI.h>
31 #include <GEOM_Operation.h>
32 #include <GEOM_Displayer.h>
34 #include <SUIT_Session.h>
35 #include <SUIT_OverrideCursor.h>
36 #include <SUIT_MessageBox.h>
37 #include <SUIT_Tools.h>
38 #include <SUIT_FileDlg.h>
39 #include <SUIT_Desktop.h>
40 #include <SUIT_ViewModel.h>
41 #include <SUIT_ViewManager.h>
43 #include <SalomeApp_Application.h>
44 #include <SalomeApp_Study.h>
45 #include <LightApp_SelectionMgr.h>
46 #include <GEOMImpl_Types.hxx>
48 #include <SALOME_ListIO.hxx>
49 #include <SALOME_ListIteratorOfListIO.hxx>
50 #include <SALOME_Prs.h>
53 #include <QApplication>
57 #include <TCollection_AsciiString.hxx>
61 typedef QMap<QString, QString> FilterMap;
63 //=======================================================================
64 // function : getFileName
65 // purpose : Selection of a file name for Import/Export. Returns also
66 // the selected file type code through <filter> argument.
67 //=======================================================================
68 static QString getFileName( QWidget* parent,
69 const QString& initial,
70 const FilterMap& filterMap,
71 const QStringList& filters,
72 const QString& caption,
76 static QString lastUsedFilter;
77 //QStringList filters;
79 for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) {
80 //filters.push_back( it.key() );
81 if ( it.key().contains( "BREP", Qt::CaseInsensitive ) )
82 aBrepFilter = it.key();
85 SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true );
86 if ( !caption.isEmpty() )
87 fd->setWindowTitle( caption );
89 if ( !initial.isEmpty() )
90 fd->selectFile( initial );
92 fd->setFilters( filters );
94 if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) ) {
95 fd->selectFilter( lastUsedFilter );
97 else if ( !aBrepFilter.isEmpty() ) {
98 fd->selectFilter( aBrepFilter );
102 if ( fd->exec() == QDialog::Accepted ) {
103 filename = fd->selectedFile();
104 format = filterMap[fd->selectedFilter()];
105 lastUsedFilter = fd->selectedFilter();
109 qApp->processEvents();
113 //=======================================================================
114 // function : getParentComponent
115 // purpose : Get object's parent component entry
116 //=======================================================================
117 static QString getParentComponent( _PTR( SObject ) obj )
120 _PTR(SComponent) comp = obj->GetFatherComponent();
122 return QString( comp->GetID().c_str() );
127 //=====================================================================================
129 // purpose : check if the object(s) passed as the the second arguments are used
130 // by the other objects in the study
131 //=====================================================================================
132 static bool inUse( _PTR(Study) study, const QString& component, const QMap<QString,QString>& objects )
134 _PTR(SObject) comp = study->FindObjectID( component.toLatin1().data() );
138 // collect all GEOM objects being deleted
139 QMap<QString, GEOM::GEOM_Object_var> gobjects;
140 QMap<QString, QString>::ConstIterator oit;
141 for ( oit = objects.begin(); oit != objects.end(); ++oit ) {
142 _PTR(SObject) so = study->FindObjectID( oit.key().toLatin1().data() );
145 CORBA::Object_var corbaObj_rem = GeometryGUI::ClientSObjectToObject( so );
146 GEOM::GEOM_Object_var geomObj_rem = GEOM::GEOM_Object::_narrow( corbaObj_rem );
147 if( CORBA::is_nil( geomObj_rem ) )
149 gobjects.insert( oit.key(), geomObj_rem );
152 // browse through all GEOM data tree
153 _PTR(ChildIterator) it ( study->NewChildIterator( comp ) );
154 for ( it->InitEx( true ); it->More(); it->Next() ) {
155 _PTR(SObject) child( it->Value() );
156 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( child );
157 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
158 if( CORBA::is_nil( geomObj ) )
161 GEOM::ListOfGO_var list = geomObj->GetDependency();
162 if( list->length() <= 1 )
163 continue; // ??? why 1?
165 for( int i = 0; i < list->length(); i++ ) {
166 bool depends = false;
167 bool deleted = false;
168 QMap<QString, GEOM::GEOM_Object_var>::Iterator git;
169 for ( git = gobjects.begin(); git != gobjects.end() && ( !depends || !deleted ); ++git ) {
170 depends = depends || list[i]->_is_equivalent( *git );
171 deleted = deleted || git.key() == child->GetID().c_str() ;//geomObj->_is_equivalent( *git );
173 if ( depends && !deleted )
180 //=======================================================================
181 // function : GEOMToolsGUI()
182 // purpose : Constructor
183 //=======================================================================
184 GEOMToolsGUI::GEOMToolsGUI( GeometryGUI* parent )
190 //=======================================================================
191 // function : ~GEOMToolsGUI()
192 // purpose : Destructor
193 //=======================================================================
194 GEOMToolsGUI::~GEOMToolsGUI()
199 //=======================================================================
200 // function : OnGUIEvent()
202 //=======================================================================
203 bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
205 getGeometryGUI()->EmitSignalDeactivateDialog();
207 switch (theCommandID)
219 case 111: // IMPORT BREP
220 case 112: // IMPORT IGES
221 case 113: // IMPORT STEP
226 case 121: // EXPORT BREP
227 case 122: // EXPORT IGES
228 case 123: // EXPORT STEP
233 case 2171: // POPUP VIEWER - SELECT ONLY - VERTEX
235 OnSelectOnly( GEOM_POINT );
238 case 2172: // POPUP VIEWER - SELECT ONLY - EDGE
240 OnSelectOnly( GEOM_EDGE );
243 case 2173: // POPUP VIEWER - SELECT ONLY - WIRE
245 OnSelectOnly( GEOM_WIRE );
248 case 2174: // POPUP VIEWER - SELECT ONLY - FACE
250 OnSelectOnly( GEOM_FACE );
253 case 2175: // POPUP VIEWER - SELECT ONLY - SHELL
255 OnSelectOnly( GEOM_SHELL );
258 case 2176: // POPUP VIEWER - SELECT ONLY - SOLID
260 OnSelectOnly( GEOM_SOLID );
263 case 2177: // POPUP VIEWER - SELECT ONLY - COMPOUND
265 OnSelectOnly( GEOM_COMPOUND );
268 case 2178: // POPUP VIEWER - SELECT ONLY - SELECT ALL
270 OnSelectOnly( GEOM_ALLOBJECTS );
273 case 411: // SETTINGS - ADD IN STUDY
275 // SAN -- TO BE REMOVED !!!
278 case 412: // SETTINGS - SHADING COLOR
283 case 804: // ADD IN STUDY - POPUP VIEWER
285 // SAN -- TO BE REMOVED !!!!
293 case 5103: // CHECK GEOMETRY
298 case 8032: // COLOR - POPUP VIEWER
303 case 8033: // TRANSPARENCY - POPUP VIEWER
308 case 8034: // ISOS - POPUP VIEWER
313 case 8035: // AUTO COLOR - POPUP VIEWER
318 case 8036: // DISABLE AUTO COLOR - POPUP VIEWER
320 OnDisableAutoColor();
323 case 9024 : // OPEN - OBJBROSER POPUP
330 SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
339 //===============================================================================
340 // function : OnEditDelete()
342 //===============================================================================
343 void GEOMToolsGUI::OnEditDelete()
345 SALOME_ListIO selected;
346 SalomeApp_Application* app =
347 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
351 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
352 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
353 if ( !aSelMgr || !appStudy )
357 aSelMgr->selectedObjects( selected, "ObjectBrowser", false );
358 if ( selected.IsEmpty() )
361 _PTR(Study) aStudy = appStudy->studyDS();
363 // check if study is locked
364 if ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() )->IsLocked() ) {
365 SUIT_MessageBox::warning( app->desktop(),
367 tr("WRN_STUDY_LOCKED"),
369 return; // study is locked
372 // get GEOM component
373 CORBA::String_var geomIOR = app->orb()->object_to_string( GeometryGUI::GetGeomGen() );
374 QString geomComp = getParentComponent( aStudy->FindObjectIOR( geomIOR.in() ) );
376 // check each selected object: if belongs to GEOM, if not reference...
377 QMap<QString,QString> toBeDeleted;
378 QMap<QString,QString> allDeleted;
379 bool isComponentSelected = false;
380 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
381 Handle(SALOME_InteractiveObject) anIObject = It.Value();
382 if ( !anIObject->hasEntry() )
383 continue; // invalid object
385 QString entry = anIObject->getEntry();
386 _PTR(SObject) obj = aStudy->FindObjectID( entry.toLatin1().data() );
387 // check parent component
388 QString parentComp = getParentComponent( obj );
389 if ( parentComp != geomComp ) {
390 SUIT_MessageBox::warning ( app->desktop(),
391 QObject::tr("ERR_ERROR"),
392 QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ),
393 QObject::tr("BUT_OK") );
394 return; // not GEOM object selected
397 ///////////////////////////////////////////////////////
398 // if GEOM component is selected, so skip other checks
399 if ( isComponentSelected ) continue;
400 ///////////////////////////////////////////////////////
402 // check if object is reference
403 _PTR(SObject) refobj;
404 if ( obj && obj->ReferencedObject( refobj ) )
405 continue; // skip references
407 QString aName = obj->GetName().c_str();
408 if ( entry == geomComp ) {
409 // GEOM component is selected, skip other checks
410 isComponentSelected = true;
413 toBeDeleted.insert( entry, aName );
414 allDeleted.insert( entry, aName ); // skip GEOM component
415 // browse through all children recursively
416 _PTR(ChildIterator) it ( aStudy->NewChildIterator( obj ) );
417 for ( it->InitEx( true ); it->More(); it->Next() ) {
418 _PTR(SObject) child( it->Value() );
419 if ( child && child->ReferencedObject( refobj ) )
420 continue; // skip references
421 aName = child->GetName().c_str();
422 if ( !aName.isEmpty() )
423 allDeleted.insert( child->GetID().c_str(), aName );
427 // is there is anything to delete?
428 if ( !isComponentSelected && allDeleted.count() <= 0 )
429 return; // nothing to delete
431 // show confirmation dialog box
432 GEOMToolsGUI_DeleteDlg dlg( app->desktop(), allDeleted, isComponentSelected );
434 return; // operation is cancelled by user
436 // get currently opened views
437 QList<SALOME_View*> views;
439 ViewManagerList vmans = app->viewManagers();
440 SUIT_ViewManager* vman;
441 QListIterator<SUIT_ViewManager*> vit( vmans );
442 while ( vit.hasNext() && (vman = vit.next()) ) {
443 SUIT_ViewModel* vmod = vman->getViewModel();
444 view = dynamic_cast<SALOME_View*> ( vmod ); // must work for OCC and VTK views
446 views.append( view );
449 _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
450 GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
452 if ( isComponentSelected ) {
453 // GEOM component is selected: delete all objects recursively
454 _PTR(SObject) comp = aStudy->FindObjectID( geomComp.toLatin1().data() );
457 _PTR(ChildIterator) it ( aStudy->NewChildIterator( comp ) );
458 // remove top-level objects only
459 for ( it->InitEx( false ); it->More(); it->Next() ) {
460 _PTR(SObject) child( it->Value() );
461 // remove object from GEOM engine
462 removeObjectWithChildren( child, aStudy, views, disp );
463 // remove object from study
464 aStudyBuilder->RemoveObjectWithChildren( child );
468 // GEOM component is not selected: check if selected objects are in use
469 if ( inUse( aStudy, geomComp, allDeleted ) ) {
470 SUIT_MessageBox::warning ( app->desktop(),
471 QObject::tr("WRN_WARNING"),
472 QObject::tr("DEP_OBJECT"),
473 QObject::tr("BUT_OK") );
474 return; // object(s) in use
476 // ... and then delete all objects
477 QMap<QString, QString>::Iterator it;
478 for ( it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) {
479 _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
480 // remove object from GEOM engine
481 removeObjectWithChildren( obj, aStudy, views, disp );
482 // remove objects from study
483 aStudyBuilder->RemoveObjectWithChildren( obj );
488 aSelMgr->setSelectedObjects( selected );
489 getGeometryGUI()->updateObjBrowser();
490 app->updateActions(); //SRN: To update a Save button in the toolbar
494 //==============================================================================
495 // function : OnEditCopy()
497 //==============================================================================
498 void GEOMToolsGUI::OnEditCopy()
501 SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection() );
502 GEOM::string_array_var listIOR = new GEOM::string_array;
504 const SALOME_ListIO& List = Sel->StoredIObjects();
506 myGeomBase->ConvertListOfIOInListOfIOR(List, listIOR);
508 Sel->ClearIObjects();
510 SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
511 int aStudyID = aStudy->StudyId();
513 for (unsigned int ind = 0; ind < listIOR->length();ind++) {
514 GEOM::GEOM_Object_var aShapeInit = myGeom->GetIORFromString(listIOR[ind]);
516 GEOM::GEOM_IInsertOperations_var IOp = myGeom->GetIInsertOperations(aStudyID);
517 GEOM::GEOM_Object_var result = IOp->MakeCopy(aShapeInit);
518 myGeomBase->Display(result);
520 catch (const SALOME::SALOME_Exception& S_ex) {
521 QtCatchCorbaException(S_ex);
525 QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
530 //=====================================================================================
532 // purpose : BRep, Iges, Step
533 //=====================================================================================
534 bool GEOMToolsGUI::Import()
536 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( getGeometryGUI()->getApp() );
537 //SUIT_Application* app = getGeometryGUI()->getApp();
538 if (! app) return false;
540 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
542 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
545 _PTR(Study) aStudy = stud->studyDS();
547 bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
549 SUIT_MessageBox::warning ( app->desktop(),
550 QObject::tr("WRN_WARNING"),
551 QObject::tr("WRN_STUDY_LOCKED"),
552 QObject::tr("BUT_OK") );
556 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
557 if ( CORBA::is_nil( eng ) ) {
558 SUIT_MessageBox::critical( app->desktop(),
559 QObject::tr("WRN_WARNING"),
560 QObject::tr( "GEOM Engine is not started" ),
561 QObject::tr("BUT_OK") );
565 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
566 if ( aInsOp->_is_nil() )
569 GEOM::GEOM_Object_var anObj;
571 // Obtain a list of available import formats
574 GEOM::string_array_var aFormats, aPatterns;
575 aInsOp->ImportTranslators( aFormats, aPatterns );
577 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
578 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
579 filters.push_back( (char*)aPatterns[i] );
584 QString fileName = getFileName(app->desktop(), "", aMap, filters,
585 tr("GEOM_MEN_IMPORT"), true, fileType);
587 if (fileName.isEmpty())
590 if (fileType.isEmpty() )
592 // Trying to detect file type
593 QFileInfo aFileInfo( fileName );
594 QString aPossibleType = (aFileInfo.suffix()).toUpper() ;
596 if ( (aMap.values()).contains(aPossibleType) )
597 fileType = aPossibleType;
600 if (fileType.isEmpty())
603 GEOM_Operation* anOp = new GEOM_Operation (app, aInsOp.in());
605 SUIT_OverrideCursor wc;
607 app->putInfo(tr("GEOM_PRP_LOADING").arg(SUIT_Tools::file(fileName, /*withExten=*/true)));
611 CORBA::String_var fileN = CORBA::string_dup(fileName.toLatin1().data());
612 CORBA::String_var fileT = CORBA::string_dup(fileType.toLatin1().data());
613 anObj = aInsOp->Import(fileN, fileT);
615 if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
616 QString aPublishObjName =
617 GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true));
619 SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy(aStudy);
620 GeometryGUI::GetGeomGen()->PublishInStudy(aDSStudy,
621 SALOMEDS::SObject::_nil(),
623 aPublishObjName.toStdString().c_str());
625 GEOM_Displayer( stud ).Display( anObj.in() );
627 // update data model and object browser
628 getGeometryGUI()->updateObjBrowser( true );
635 SUIT_MessageBox::critical( app->desktop(),
636 QObject::tr( "GEOM_ERROR" ),
637 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
638 QObject::tr("BUT_OK") );
641 catch( const SALOME::SALOME_Exception& S_ex ) {
642 //QtCatchCorbaException(S_ex);
647 app->updateActions(); //SRN: To update a Save button in the toolbar
653 //=====================================================================================
655 // purpose : BRep, Iges, Step
656 //=====================================================================================
657 bool GEOMToolsGUI::Export()
659 SalomeApp_Application* app = getGeometryGUI()->getApp();
660 if (!app) return false;
662 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
664 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
667 _PTR(Study) aStudy = stud->studyDS();
669 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
670 if ( CORBA::is_nil( eng ) ) {
671 SUIT_MessageBox::critical( app->desktop(),
672 QObject::tr("WRN_WARNING"),
673 QObject::tr( "GEOM Engine is not started" ),
674 QObject::tr("BUT_OK") );
678 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
679 if ( aInsOp->_is_nil() )
682 // Obtain a list of available export formats
685 GEOM::string_array_var aFormats, aPatterns;
686 aInsOp->ExportTranslators( aFormats, aPatterns );
687 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
688 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
689 filters.push_back( (char*)aPatterns[i] );
692 // Get selected objects
693 LightApp_SelectionMgr* sm = app->selectionMgr();
697 SALOME_ListIO selectedObjects;
698 sm->selectedObjects( selectedObjects );
700 SALOME_ListIteratorOfListIO It( selectedObjects );
701 for(;It.More();It.Next()) {
702 Handle(SALOME_InteractiveObject) IObject = It.Value();
703 Standard_Boolean found;
704 GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(IObject, found);
706 if ( !found || anObj->_is_nil() )
710 QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, filters,
711 tr("GEOM_MEN_EXPORT"), false, fileType);
713 // User has pressed "Cancel" --> stop the operation
714 if ( file.isEmpty() || fileType.isEmpty() )
717 GEOM_Operation* anOp = new GEOM_Operation( app, aInsOp.in() );
719 SUIT_OverrideCursor wc;
721 app->putInfo( tr("GEOM_PRP_EXPORT").arg(SUIT_Tools::file( file, /*withExten=*/true )) );
726 aInsOp->Export( anObj, file.toStdString().c_str(), fileType.toLatin1().constData() );
728 if ( aInsOp->IsDone() )
734 SUIT_MessageBox::critical( app->desktop(),
735 QObject::tr( "GEOM_ERROR" ),
736 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
737 QObject::tr("BUT_OK") );
741 catch (const SALOME::SALOME_Exception& S_ex) {
742 //QtCatchCorbaException(S_ex);
751 //=====================================================================================
752 // function : RemoveObjectWithChildren
753 // purpose : to be used by OnEditDelete() method
754 //=====================================================================================
755 void GEOMToolsGUI::removeObjectWithChildren(_PTR(SObject) obj,
757 QList<SALOME_View*> views,
758 GEOM_Displayer* disp)
760 // iterate through all children of obj
761 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
762 _PTR(SObject) child (it->Value());
763 removeObjectWithChildren(child, aStudy, views, disp);
766 // erase object and remove it from engine
767 _PTR(GenericAttribute) anAttr;
768 if (obj->FindAttribute(anAttr, "AttributeIOR")) {
769 _PTR(AttributeIOR) anIOR (anAttr);
771 // Delete shape in Client
772 const TCollection_AsciiString ASCIor ((char*)anIOR->Value().c_str());
773 getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCIor);
775 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj);
776 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
777 if (!CORBA::is_nil(geomObj)) {
778 // Erase graphical object
779 QListIterator<SALOME_View*> it( views );
780 while ( it.hasNext() )
781 if ( SALOME_View* view = it.next() )
782 disp->Erase(geomObj, true, view);
784 // Remove object from Engine
785 GeometryGUI::GetGeomGen()->RemoveObject( geomObj );
790 //=================================================================================
791 // function : deactivate()
792 // purpose : Called when GEOM component is deactivated
793 //=================================================================================
794 void GEOMToolsGUI::deactivate()
796 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
798 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
799 GEOM_Displayer aDisp (appStudy);
800 aDisp.GlobalSelection();
801 getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
805 //=====================================================================================
807 //=====================================================================================
811 __declspec( dllexport )
813 GEOMGUI* GetLibGUI( GeometryGUI* parent )
815 return new GEOMToolsGUI( parent );