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"
31 #include "GeometryGUI.h"
32 #include "GEOM_Actor.h"
34 #include "GEOMBase_aWarningDlg.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 ( showCurrentDirInitially && SUIT_FileDlg::getLastVisitedPath().isEmpty() )
99 fd->setSelection( QDir::currentDirPath() );
100 else if ( !initial.isEmpty() )
101 fd->setSelection( initial );
103 fd->setFilters( filters );
105 if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) )
106 fd->setSelectedFilter( lastUsedFilter );
108 if (!aBrepFilter.isEmpty()) {
109 fd->setSelectedFilter(aBrepFilter);
114 QString filename = fd->selectedFile();
115 format = filterMap[fd->selectedFilter()];
116 lastUsedFilter = fd->selectedFilter();
118 qApp->processEvents();
122 //=======================================================================
123 // function : GEOMToolsGUI()
124 // purpose : Constructor
125 //=======================================================================
126 GEOMToolsGUI::GEOMToolsGUI( GeometryGUI* parent )
132 //=======================================================================
133 // function : ~GEOMToolsGUI()
134 // purpose : Destructor
135 //=======================================================================
136 GEOMToolsGUI::~GEOMToolsGUI()
141 //=======================================================================
142 // function : OnGUIEvent()
144 //=======================================================================
145 bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
147 getGeometryGUI()->EmitSignalDeactivateDialog();
149 switch (theCommandID)
161 case 111: // IMPORT BREP
162 case 112: // IMPORT IGES
163 case 113: // IMPORT STEP
168 case 121: // EXPORT BREP
169 case 122: // EXPORT IGES
170 case 123: // EXPORT STEP
175 case 2171: // POPUP VIEWER - SELECT ONLY - VERTEX
177 OnSelectOnly( GEOM_POINT );
180 case 2172: // POPUP VIEWER - SELECT ONLY - EDGE
182 OnSelectOnly( GEOM_EDGE );
185 case 2173: // POPUP VIEWER - SELECT ONLY - WIRE
187 OnSelectOnly( GEOM_WIRE );
190 case 2174: // POPUP VIEWER - SELECT ONLY - FACE
192 OnSelectOnly( GEOM_FACE );
195 case 2175: // POPUP VIEWER - SELECT ONLY - SHELL
197 OnSelectOnly( GEOM_SHELL );
200 case 2176: // POPUP VIEWER - SELECT ONLY - SOLID
202 OnSelectOnly( GEOM_SOLID );
205 case 2177: // POPUP VIEWER - SELECT ONLY - COMPOUND
207 OnSelectOnly( GEOM_COMPOUND );
210 case 2178: // POPUP VIEWER - SELECT ONLY - SELECT ALL
212 OnSelectOnly( GEOM_ALLOBJECTS );
215 case 411: // SETTINGS - ADD IN STUDY
217 // SAN -- TO BE REMOVED !!!
220 case 412: // SETTINGS - SHADING COLOR
225 case 413: // SETTINGS - ISOS
230 case 414: // SETTINGS : STEP VALUE FOR SPIN BOXES
235 case 804: // ADD IN STUDY - POPUP VIEWER
237 // SAN -- TO BE REMOVED !!!!
245 case 5103: // CHECK GEOMETRY
250 case 8032: // COLOR - POPUP VIEWER
255 case 8033: // TRANSPARENCY - POPUP VIEWER
260 case 8034: // ISOS - POPUP VIEWER
265 case 8035: // AUTO COLOR - POPUP VIEWER
270 case 8036: // DISABLE AUTO COLOR - POPUP VIEWER
272 OnDisableAutoColor();
275 case 9024 : // OPEN - OBJBROSER POPUP
282 SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
291 //===============================================================================
292 // function : OnEditDelete()
294 //===============================================================================
295 void GEOMToolsGUI::OnEditDelete()
297 SALOME_ListIO selected;
298 SalomeApp_Application* app =
299 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
301 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
302 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
303 if ( aSelMgr && appStudy ) {
304 aSelMgr->selectedObjects( selected, QString::null, false );
305 if ( !selected.IsEmpty() ) {
306 _PTR(Study) aStudy = appStudy->studyDS();
308 bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
310 SUIT_MessageBox::warn1 ( app->desktop(),
311 QObject::tr("WRN_WARNING"),
312 QObject::tr("WRN_STUDY_LOCKED"),
313 QObject::tr("BUT_OK") );
317 // VSR 17/11/04: check if all objects selected belong to GEOM component --> start
318 // modifications of ASV 01.06.05
319 QString parentComp = getParentComponent( aStudy, selected );
320 CORBA::String_var geomIOR = app->orb()->object_to_string( GeometryGUI::GetGeomGen() );
321 QString geomComp = getParentComponent( aStudy->FindObjectIOR( geomIOR.in() ) );
323 if ( parentComp != geomComp ) {
324 SUIT_MessageBox::warn1 ( app->desktop(),
325 QObject::tr("ERR_ERROR"),
326 QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ),
327 QObject::tr("BUT_OK") );
330 // VSR 17/11/04: check if all objects selected belong to GEOM component <-- finish
333 //Get Main Objects Names
334 Handle(SALOME_InteractiveObject) anIObject;
335 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
337 QString aName = It.Value()->getName();
338 if ( aName != "" && aName.ref(0) != '*') {
339 aNameList.append(" - " + aName + "\n");
342 anIObject = It.Value();
344 // Append Child Names of Last Selected Object
345 _PTR(SObject) obj ( aStudy->FindObjectID( anIObject->getEntry() ) );
346 for (_PTR(ChildIterator) iit (aStudy->NewChildIterator(obj)); iit->More(); iit->Next()) {
347 _PTR(SObject) child (iit->Value());
348 QString aName = child->GetName();
349 if (aName != "" && aName.ref(0) != '*') {
350 aNameList.append(" - " + aName + "\n");
352 //append childs child
353 for (_PTR(ChildIterator) iitt(aStudy->NewChildIterator(child)); iitt->More(); iitt->Next()) {
354 _PTR(SObject) childchild(iitt->Value());
355 QString aName = childchild->GetName();
356 if (aName != "" && aName.ref(0) != '*') {
357 aNameList.append(" - " + aName + "\n");
359 for (_PTR(ChildIterator) itt(aStudy->NewChildIterator(childchild)); itt->More(); itt->Next())
361 _PTR(SObject) childs(itt->Value());
362 QString aName = childs->GetName();
363 if (aName != "" && aName.ref(0) != '*') {
364 aNameList.append(" - " + aName + "\n");
371 } //end of child append
373 GEOMBase_aWarningDlg* Dialog = new GEOMBase_aWarningDlg( app->desktop(), QObject::tr( "GEOM_WRN_WARNING" ), aNameList, nbSel);
374 int r = Dialog->exec();
379 // QAD_Operation* op = new SALOMEGUI_ImportOperation(.....);
382 // prepare list of SALOME_Views
383 QPtrList<SALOME_View> views;
386 ViewManagerList vmans = app->viewManagers();
387 SUIT_ViewManager* vman;
388 for ( vman = vmans.first(); vman; vman = vmans.next() ) {
389 SUIT_ViewModel* vmod = vman->getViewModel();
390 view = dynamic_cast<SALOME_View*> ( vmod ); // must work for OCC and VTK views
392 views.append( view );
395 _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
396 _PTR(GenericAttribute) anAttr;
397 GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
399 _PTR(SComponent) aGeom ( aStudy->FindComponent("GEOM") );
403 // MAIN LOOP OF SELECTED OBJECTS
404 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
406 Handle(SALOME_InteractiveObject) io = It.Value();
407 if ( !io->hasEntry() )
410 _PTR(SObject) obj ( aStudy->FindObjectID( io->getEntry() ) );
412 // disable removal of "Geometry" component object
413 if ( !strcmp( obj->GetIOR().c_str(), geomIOR ) )
416 //If the object has been used to create another one,then it can't be deleted
417 _PTR(ChildIterator) it (aStudy->NewChildIterator(aGeom));
418 for ( it->InitEx( true ); it->More(); it->Next() ) {
419 _PTR(SObject) chobj (it->Value());
420 if(CheckSubObjectInUse(chobj, obj, aStudy)) return;
422 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
423 _PTR(SObject) child (it->Value());
424 if(CheckSubObjectInUse( chobj, child, aStudy)) return;
428 RemoveObjectWithChildren(obj, aStudy, views, disp);
430 // Remove objects from Study
431 aStudyBuilder->RemoveObjectWithChildren( obj );
434 } // MAIN LOOP of selected
437 aSelMgr->setSelectedObjects( selected );
438 getGeometryGUI()->updateObjBrowser();
439 } // if ( selected not empty )
440 } // if ( selMgr && appStudy )
442 app->updateActions(); //SRN: To update a Save button in the toolbar
454 //==============================================================================
455 // function : OnEditCopy()
457 //==============================================================================
458 void GEOMToolsGUI::OnEditCopy()
461 SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection() );
462 GEOM::string_array_var listIOR = new GEOM::string_array;
464 const SALOME_ListIO& List = Sel->StoredIObjects();
466 myGeomBase->ConvertListOfIOInListOfIOR(List, listIOR);
468 Sel->ClearIObjects();
470 SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
471 int aStudyID = aStudy->StudyId();
473 for (unsigned int ind = 0; ind < listIOR->length();ind++) {
474 GEOM::GEOM_Object_var aShapeInit = myGeom->GetIORFromString(listIOR[ind]);
476 GEOM::GEOM_IInsertOperations_var IOp = myGeom->GetIInsertOperations(aStudyID);
477 GEOM::GEOM_Object_var result = IOp->MakeCopy(aShapeInit);
478 myGeomBase->Display(result);
480 catch (const SALOME::SALOME_Exception& S_ex) {
481 QtCatchCorbaException(S_ex);
485 QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
490 //=====================================================================================
492 // purpose : BRep, Iges, Step
493 //=====================================================================================
494 bool GEOMToolsGUI::Import()
496 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( getGeometryGUI()->getApp() );
497 //SUIT_Application* app = getGeometryGUI()->getApp();
498 if (! app) return false;
500 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
502 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
505 _PTR(Study) aStudy = stud->studyDS();
507 bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
509 SUIT_MessageBox::warn1 ( app->desktop(),
510 QObject::tr("WRN_WARNING"),
511 QObject::tr("WRN_STUDY_LOCKED"),
512 QObject::tr("BUT_OK") );
516 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
517 if ( CORBA::is_nil( eng ) ) {
518 SUIT_MessageBox::error1( app->desktop(),
519 QObject::tr("WRN_WARNING"),
520 QObject::tr( "GEOM Engine is not started" ),
521 QObject::tr("BUT_OK") );
525 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
526 if ( aInsOp->_is_nil() )
529 GEOM::GEOM_Object_var anObj;
531 // Obtain a list of available import formats
534 GEOM::string_array_var aFormats, aPatterns;
535 aInsOp->ImportTranslators( aFormats, aPatterns );
537 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
538 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
539 filters.push_back( (char*)aPatterns[i] );
544 QString fileName = getFileName(app->desktop(), "", aMap, filters,
545 tr("GEOM_MEN_IMPORT"), true, fileType, true);
547 if (fileType.isEmpty() )
549 // Trying to detect file type
550 QFileInfo aFileInfo( fileName );
551 QString aPossibleType = (aFileInfo.extension(false)).upper() ;
553 if ( (aMap.values()).contains(aPossibleType) )
554 fileType = aPossibleType;
557 if (fileName.isEmpty() || fileType.isEmpty())
560 GEOM_Operation* anOp = new GEOM_Operation (app, aInsOp.in());
562 SUIT_OverrideCursor wc;
564 app->putInfo(tr("GEOM_PRP_LOADING").arg(SUIT_Tools::file(fileName, /*withExten=*/true)));
568 CORBA::String_var fileN = fileName.latin1();
569 CORBA::String_var fileT = fileType.latin1();
570 anObj = aInsOp->Import(fileN, fileT);
572 if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
573 QString aPublishObjName =
574 GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true));
576 SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy(aStudy);
577 GeometryGUI::GetGeomGen()->PublishInStudy(aDSStudy,
578 SALOMEDS::SObject::_nil(),
582 GEOM_Displayer( stud ).Display( anObj.in() );
584 // update data model and object browser
585 getGeometryGUI()->updateObjBrowser( true );
592 SUIT_MessageBox::error1( app->desktop(),
593 QObject::tr( "GEOM_ERROR" ),
594 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
595 QObject::tr("BUT_OK") );
598 catch( const SALOME::SALOME_Exception& S_ex ) {
599 //QtCatchCorbaException(S_ex);
604 app->updateActions(); //SRN: To update a Save button in the toolbar
610 //=====================================================================================
612 // purpose : BRep, Iges, Step
613 //=====================================================================================
614 bool GEOMToolsGUI::Export()
616 SalomeApp_Application* app = getGeometryGUI()->getApp();
617 if (!app) return false;
619 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
621 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
624 _PTR(Study) aStudy = stud->studyDS();
626 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
627 if ( CORBA::is_nil( eng ) ) {
628 SUIT_MessageBox::error1( app->desktop(),
629 QObject::tr("WRN_WARNING"),
630 QObject::tr( "GEOM Engine is not started" ),
631 QObject::tr("BUT_OK") );
635 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
636 if ( aInsOp->_is_nil() )
639 // Obtain a list of available export formats
642 GEOM::string_array_var aFormats, aPatterns;
643 aInsOp->ExportTranslators( aFormats, aPatterns );
644 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
645 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
646 filters.push_back( (char*)aPatterns[i] );
649 // Get selected objects
650 LightApp_SelectionMgr* sm = app->selectionMgr();
654 SALOME_ListIO selectedObjects;
655 sm->selectedObjects( selectedObjects );
657 SALOME_ListIteratorOfListIO It( selectedObjects );
658 for(;It.More();It.Next()) {
659 Handle(SALOME_InteractiveObject) IObject = It.Value();
660 Standard_Boolean found;
661 GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(IObject, found);
663 if ( !found || anObj->_is_nil() )
667 QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, filters,
668 tr("GEOM_MEN_EXPORT"), false, fileType);
670 // User has pressed "Cancel" --> stop the operation
671 if ( file.isEmpty() || fileType.isEmpty() )
674 GEOM_Operation* anOp = new GEOM_Operation( app, aInsOp.in() );
676 SUIT_OverrideCursor wc;
678 app->putInfo( tr("GEOM_PRP_EXPORT").arg(SUIT_Tools::file( file, /*withExten=*/true )) );
683 aInsOp->Export( anObj, file, fileType.latin1() );
685 if ( aInsOp->IsDone() )
691 SUIT_MessageBox::error1( app->desktop(),
692 QObject::tr( "GEOM_ERROR" ),
693 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
694 QObject::tr("BUT_OK") );
698 catch (const SALOME::SALOME_Exception& S_ex) {
699 //QtCatchCorbaException(S_ex);
709 QString GEOMToolsGUI::getParentComponent( _PTR( Study ) study, const SALOME_ListIO& iobjs )
713 for ( SALOME_ListIteratorOfListIO it( iobjs ); it.More(); it.Next() ) {
715 Handle(SALOME_InteractiveObject) io = it.Value();
716 if ( !io->hasEntry() )
719 QString compName = getParentComponent( study->FindObjectID( io->getEntry() ) );
721 if ( parentComp.isNull() )
722 parentComp = compName;
723 else if ( parentComp.compare( compName) != 0 ) { // objects belonging to different components are selected
724 parentComp = QString::null;
732 QString GEOMToolsGUI::getParentComponent( _PTR( SObject ) obj )
735 _PTR(SComponent) comp = obj->GetFatherComponent();
737 _PTR(GenericAttribute) anAttr;
738 if ( comp->FindAttribute( anAttr, "AttributeName") ) {
739 _PTR(AttributeName) aName( anAttr );
740 return QString( aName->Value().c_str() );
747 //=====================================================================================
748 // function : RemoveObjectWithChildren
749 // purpose : to be used by OnEditDelete() method
750 //=====================================================================================
751 void GEOMToolsGUI::RemoveObjectWithChildren(_PTR(SObject) obj,
753 QPtrList<SALOME_View> views,
754 GEOM_Displayer* disp)
756 // iterate through all children of obj
757 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
758 _PTR(SObject) child (it->Value());
759 RemoveObjectWithChildren(child, aStudy, views, disp);
762 // erase object and remove it from engine
763 _PTR(GenericAttribute) anAttr;
764 if (obj->FindAttribute(anAttr, "AttributeIOR")) {
765 _PTR(AttributeIOR) anIOR (anAttr);
767 // Delete shape in Client
768 const TCollection_AsciiString ASCIor ((char*)anIOR->Value().c_str());
769 getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCIor);
771 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj);
772 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
773 if (!CORBA::is_nil(geomObj)) {
774 // Erase graphical object
775 SALOME_View* view = views.first();
776 for (; view; view = views.next()) {
777 disp->Erase(geomObj, true, view);
780 // Remove object from Engine
781 GeometryGUI::GetGeomGen()->RemoveObject( geomObj );
786 //=====================================================================================
787 // function : CheckSubObjectInUse
788 // purpose : to be used by OnEditDelete() method
789 //=====================================================================================
790 bool GEOMToolsGUI::CheckSubObjectInUse(_PTR(SObject) checkobj,
791 _PTR(SObject) remobj,
794 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(checkobj);
795 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
796 if( CORBA::is_nil(geomObj) )
799 GEOM::ListOfGO_var list = geomObj->GetDependency();
800 if( list->length() > 1 )
801 for(int i = 0; i < list->length(); i++ ){
802 CORBA::Object_var corbaObj_rem = GeometryGUI::ClientSObjectToObject(remobj);
803 GEOM::GEOM_Object_var geomObj_rem = GEOM::GEOM_Object::_narrow( corbaObj_rem );
804 if( list[i]->_is_equivalent( geomObj_rem ) ){
805 SalomeApp_Application* app =
806 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
808 SUIT_MessageBox::warn1 ( app->desktop(),
809 QObject::tr("WRN_WARNING"),
810 QObject::tr("DEP_OBJECT"),
811 QObject::tr("BUT_OK") );
819 //=================================================================================
820 // function : deactivate()
821 // purpose : Called when GEOM component is deactivated
822 //=================================================================================
823 void GEOMToolsGUI::deactivate()
825 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
827 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
828 GEOM_Displayer aDisp (appStudy);
829 aDisp.GlobalSelection();
830 getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
834 //=====================================================================================
836 //=====================================================================================
840 GEOMGUI* GetLibGUI( GeometryGUI* parent )
842 return new GEOMToolsGUI( parent );