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() ) {
420 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(aGeom)); it->More(); it->Next()) {
421 _PTR(SObject) chobj (it->Value());
422 if(CheckSubObjectInUse(chobj, obj, aStudy)) return;
424 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
425 _PTR(SObject) child (it->Value());
426 if(CheckSubObjectInUse( chobj, child, aStudy)) return;
427 //check subchildobject
428 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(child)); it->More(); it->Next()) {
429 _PTR(SObject) subchildobj (it->Value());
430 if(CheckSubObjectInUse( chobj, subchildobj, aStudy)) return;
435 RemoveObjectWithChildren(obj, aStudy, views, disp);
437 // Remove objects from Study
438 aStudyBuilder->RemoveObjectWithChildren( obj );
441 } // MAIN LOOP of selected
444 aSelMgr->setSelectedObjects( selected );
445 getGeometryGUI()->updateObjBrowser();
446 } // if ( selected not empty )
447 } // if ( selMgr && appStudy )
449 app->updateActions(); //SRN: To update a Save button in the toolbar
461 //==============================================================================
462 // function : OnEditCopy()
464 //==============================================================================
465 void GEOMToolsGUI::OnEditCopy()
468 SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection() );
469 GEOM::string_array_var listIOR = new GEOM::string_array;
471 const SALOME_ListIO& List = Sel->StoredIObjects();
473 myGeomBase->ConvertListOfIOInListOfIOR(List, listIOR);
475 Sel->ClearIObjects();
477 SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
478 int aStudyID = aStudy->StudyId();
480 for (unsigned int ind = 0; ind < listIOR->length();ind++) {
481 GEOM::GEOM_Object_var aShapeInit = myGeom->GetIORFromString(listIOR[ind]);
483 GEOM::GEOM_IInsertOperations_var IOp = myGeom->GetIInsertOperations(aStudyID);
484 GEOM::GEOM_Object_var result = IOp->MakeCopy(aShapeInit);
485 myGeomBase->Display(result);
487 catch (const SALOME::SALOME_Exception& S_ex) {
488 QtCatchCorbaException(S_ex);
492 QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
497 //=====================================================================================
499 // purpose : BRep, Iges, Step
500 //=====================================================================================
501 bool GEOMToolsGUI::Import()
503 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( getGeometryGUI()->getApp() );
504 //SUIT_Application* app = getGeometryGUI()->getApp();
505 if (! app) return false;
507 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
509 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
512 _PTR(Study) aStudy = stud->studyDS();
514 bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
516 SUIT_MessageBox::warn1 ( app->desktop(),
517 QObject::tr("WRN_WARNING"),
518 QObject::tr("WRN_STUDY_LOCKED"),
519 QObject::tr("BUT_OK") );
523 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
524 if ( CORBA::is_nil( eng ) ) {
525 SUIT_MessageBox::error1( app->desktop(),
526 QObject::tr("WRN_WARNING"),
527 QObject::tr( "GEOM Engine is not started" ),
528 QObject::tr("BUT_OK") );
532 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
533 if ( aInsOp->_is_nil() )
536 GEOM::GEOM_Object_var anObj;
538 // Obtain a list of available import formats
541 GEOM::string_array_var aFormats, aPatterns;
542 aInsOp->ImportTranslators( aFormats, aPatterns );
544 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
545 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
546 filters.push_back( (char*)aPatterns[i] );
551 QString fileName = getFileName(app->desktop(), "", aMap, filters,
552 tr("GEOM_MEN_IMPORT"), true, fileType, true);
554 if (fileType.isEmpty() )
556 // Trying to detect file type
557 QFileInfo aFileInfo( fileName );
558 QString aPossibleType = (aFileInfo.extension(false)).upper() ;
560 if ( (aMap.values()).contains(aPossibleType) )
561 fileType = aPossibleType;
564 if (fileName.isEmpty() || fileType.isEmpty())
567 GEOM_Operation* anOp = new GEOM_Operation (app, aInsOp.in());
569 SUIT_OverrideCursor wc;
571 app->putInfo(tr("GEOM_PRP_LOADING").arg(SUIT_Tools::file(fileName, /*withExten=*/true)));
575 CORBA::String_var fileN = fileName.latin1();
576 CORBA::String_var fileT = fileType.latin1();
577 anObj = aInsOp->Import(fileN, fileT);
579 if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
580 QString aPublishObjName =
581 GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true));
583 SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy(aStudy);
584 GeometryGUI::GetGeomGen()->PublishInStudy(aDSStudy,
585 SALOMEDS::SObject::_nil(),
589 GEOM_Displayer( stud ).Display( anObj.in() );
591 // update data model and object browser
592 getGeometryGUI()->updateObjBrowser( true );
599 SUIT_MessageBox::error1( app->desktop(),
600 QObject::tr( "GEOM_ERROR" ),
601 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
602 QObject::tr("BUT_OK") );
605 catch( const SALOME::SALOME_Exception& S_ex ) {
606 //QtCatchCorbaException(S_ex);
611 app->updateActions(); //SRN: To update a Save button in the toolbar
617 //=====================================================================================
619 // purpose : BRep, Iges, Step
620 //=====================================================================================
621 bool GEOMToolsGUI::Export()
623 SalomeApp_Application* app = getGeometryGUI()->getApp();
624 if (!app) return false;
626 SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
628 cout << "FAILED to cast active study to SalomeApp_Study" << endl;
631 _PTR(Study) aStudy = stud->studyDS();
633 GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
634 if ( CORBA::is_nil( eng ) ) {
635 SUIT_MessageBox::error1( app->desktop(),
636 QObject::tr("WRN_WARNING"),
637 QObject::tr( "GEOM Engine is not started" ),
638 QObject::tr("BUT_OK") );
642 GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
643 if ( aInsOp->_is_nil() )
646 // Obtain a list of available export formats
649 GEOM::string_array_var aFormats, aPatterns;
650 aInsOp->ExportTranslators( aFormats, aPatterns );
651 for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
652 aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
653 filters.push_back( (char*)aPatterns[i] );
656 // Get selected objects
657 LightApp_SelectionMgr* sm = app->selectionMgr();
661 SALOME_ListIO selectedObjects;
662 sm->selectedObjects( selectedObjects );
664 SALOME_ListIteratorOfListIO It( selectedObjects );
665 for(;It.More();It.Next()) {
666 Handle(SALOME_InteractiveObject) IObject = It.Value();
667 Standard_Boolean found;
668 GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(IObject, found);
670 if ( !found || anObj->_is_nil() )
674 QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, filters,
675 tr("GEOM_MEN_EXPORT"), false, fileType);
677 // User has pressed "Cancel" --> stop the operation
678 if ( file.isEmpty() || fileType.isEmpty() )
681 GEOM_Operation* anOp = new GEOM_Operation( app, aInsOp.in() );
683 SUIT_OverrideCursor wc;
685 app->putInfo( tr("GEOM_PRP_EXPORT").arg(SUIT_Tools::file( file, /*withExten=*/true )) );
690 aInsOp->Export( anObj, file, fileType.latin1() );
692 if ( aInsOp->IsDone() )
698 SUIT_MessageBox::error1( app->desktop(),
699 QObject::tr( "GEOM_ERROR" ),
700 QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
701 QObject::tr("BUT_OK") );
705 catch (const SALOME::SALOME_Exception& S_ex) {
706 //QtCatchCorbaException(S_ex);
716 QString GEOMToolsGUI::getParentComponent( _PTR( Study ) study, const SALOME_ListIO& iobjs )
720 for ( SALOME_ListIteratorOfListIO it( iobjs ); it.More(); it.Next() ) {
722 Handle(SALOME_InteractiveObject) io = it.Value();
723 if ( !io->hasEntry() )
726 QString compName = getParentComponent( study->FindObjectID( io->getEntry() ) );
728 if ( parentComp.isNull() )
729 parentComp = compName;
730 else if ( parentComp.compare( compName) != 0 ) { // objects belonging to different components are selected
731 parentComp = QString::null;
739 QString GEOMToolsGUI::getParentComponent( _PTR( SObject ) obj )
742 _PTR(SComponent) comp = obj->GetFatherComponent();
744 _PTR(GenericAttribute) anAttr;
745 if ( comp->FindAttribute( anAttr, "AttributeName") ) {
746 _PTR(AttributeName) aName( anAttr );
747 return QString( aName->Value().c_str() );
754 //=====================================================================================
755 // function : RemoveObjectWithChildren
756 // purpose : to be used by OnEditDelete() method
757 //=====================================================================================
758 void GEOMToolsGUI::RemoveObjectWithChildren(_PTR(SObject) obj,
760 QPtrList<SALOME_View> views,
761 GEOM_Displayer* disp)
763 // iterate through all children of obj
764 for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
765 _PTR(SObject) child (it->Value());
766 RemoveObjectWithChildren(child, aStudy, views, disp);
769 // erase object and remove it from engine
770 _PTR(GenericAttribute) anAttr;
771 if (obj->FindAttribute(anAttr, "AttributeIOR")) {
772 _PTR(AttributeIOR) anIOR (anAttr);
774 // Delete shape in Client
775 const TCollection_AsciiString ASCIor ((char*)anIOR->Value().c_str());
776 getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCIor);
778 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj);
779 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
780 if (!CORBA::is_nil(geomObj)) {
781 // Erase graphical object
782 SALOME_View* view = views.first();
783 for (; view; view = views.next()) {
784 disp->Erase(geomObj, true, view);
787 // Remove object from Engine
788 GeometryGUI::GetGeomGen()->RemoveObject( geomObj );
793 //=====================================================================================
794 // function : CheckSubObjectInUse
795 // purpose : to be used by OnEditDelete() method
796 //=====================================================================================
797 bool GEOMToolsGUI::CheckSubObjectInUse(_PTR(SObject) checkobj,
798 _PTR(SObject) remobj,
801 CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(checkobj);
802 GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
804 CORBA::Object_var corbaObj_rem = GeometryGUI::ClientSObjectToObject(remobj);
805 GEOM::GEOM_Object_var geomObj_rem = GEOM::GEOM_Object::_narrow( corbaObj_rem );
807 if( CORBA::is_nil(geomObj) || CORBA::is_nil(geomObj_rem))
810 GEOM::ListOfGO_var list = geomObj->GetDependency();
811 if( list->length() > 0 )
812 for(int i = 0; i < list->length(); i++ ){
813 if( list[i]->_is_equivalent( geomObj_rem ) ){
814 SalomeApp_Application* app =
815 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
817 SUIT_MessageBox::warn1 ( app->desktop(),
818 QObject::tr("WRN_WARNING"),
819 QObject::tr("DEP_OBJECT"),
820 QObject::tr("BUT_OK") );
828 //=================================================================================
829 // function : deactivate()
830 // purpose : Called when GEOM component is deactivated
831 //=================================================================================
832 void GEOMToolsGUI::deactivate()
834 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
836 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
837 GEOM_Displayer aDisp (appStudy);
838 aDisp.GlobalSelection();
839 getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
843 //=====================================================================================
845 //=====================================================================================
849 GEOMGUI* GetLibGUI( GeometryGUI* parent )
851 return new GEOMToolsGUI( parent );