Salome HOME
Remove obsolete staff; redesign Handle-based and CDL-generated classes
[modules/geom.git] / src / GEOMToolsGUI / GEOMToolsGUI.cxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : GEOMBase_Tools.cxx
25 // Author : Damien COQUERET, Open CASCADE S.A.S.
26
27 #include "GEOMToolsGUI.h"
28 #include "GEOMToolsGUI_DeleteDlg.h"
29
30 #include <GeometryGUI.h>
31 #include "GeometryGUI_Operations.h"
32 #include <GEOMBase.h>
33 #include <GEOM_Operation.h>
34 #include <GEOM_Displayer.h>
35
36 #include <SUIT_Session.h>
37 #include <SUIT_OverrideCursor.h>
38 #include <SUIT_MessageBox.h>
39 #include <SUIT_Tools.h>
40 #include <SUIT_FileDlg.h>
41 #include <SUIT_Desktop.h>
42 #include <SUIT_ViewModel.h>
43 #include <SUIT_ViewManager.h>
44
45 #include <SalomeApp_Application.h>
46 #include <SalomeApp_Study.h>
47 #include <LightApp_SelectionMgr.h>
48 #include <GEOMImpl_Types.hxx>
49
50 #include <SALOME_ListIO.hxx>
51 #include <SALOME_Prs.h>
52
53 // QT Includes
54 #include <QApplication>
55 #include <QMap>
56 #include <QRegExp>
57
58 // OCCT Includes
59 #include <TCollection_AsciiString.hxx>
60
61 typedef QMap<QString, QString> FilterMap;
62 static QString lastUsedFilter;
63
64 //=======================================================================
65 // function : getParentComponent
66 // purpose  : Get object's parent component entry
67 //=======================================================================
68 static QString getParentComponent( _PTR( SObject ) obj )
69 {
70   if ( obj ) {
71     _PTR(SComponent) comp = obj->GetFatherComponent();
72     if ( comp )
73       return QString( comp->GetID().c_str() );
74   }
75   return QString();
76 }
77
78 //=====================================================================================
79 // function : inUse
80 // purpose  : check if the object(s) passed as the the second arguments are used
81 //            by the other objects in the study
82 //=====================================================================================
83 static bool inUse( _PTR(Study) study, const QString& component, const QMap<QString,QString>& objects )
84 {
85   _PTR(SObject) comp = study->FindObjectID( component.toLatin1().data() );
86   if ( !comp )
87     return false;
88
89   // collect all GEOM objects being deleted
90   QMap<QString, GEOM::GEOM_BaseObject_var> gobjects;
91   QMap<QString, QString>::ConstIterator oit;
92   std::list<_PTR(SObject)> aSelectedSO;
93   for ( oit = objects.begin(); oit != objects.end(); ++oit ) {
94     _PTR(SObject) so = study->FindObjectID( oit.key().toLatin1().data() );
95     if ( !so )
96       continue;
97     aSelectedSO.push_back(so);
98     CORBA::Object_var corbaObj_rem = GeometryGUI::ClientSObjectToObject( so );
99     GEOM::GEOM_BaseObject_var geomObj_rem = GEOM::GEOM_BaseObject::_narrow( corbaObj_rem );
100     if( CORBA::is_nil( geomObj_rem ) )
101       continue;
102     gobjects.insert( oit.key(), geomObj_rem );
103   }
104
105   // Search References with other Modules
106   std::list< _PTR(SObject) >::iterator itSO = aSelectedSO.begin();
107   for ( ; itSO != aSelectedSO.end(); ++itSO ) {
108     std::vector<_PTR(SObject)> aReferences = study->FindDependances( *itSO  );
109     int aRefLength = aReferences.size();
110     if (aRefLength) {
111       for (int i = 0; i < aRefLength; i++) {
112         _PTR(SObject) firstSO( aReferences[i] );
113         _PTR(SComponent) aComponent = firstSO->GetFatherComponent();
114         QString type = aComponent->ComponentDataType().c_str();
115         if ( type == "SMESH" )
116           return true;
117       }
118     }
119   }
120
121   // browse through all GEOM data tree
122   _PTR(ChildIterator) it ( study->NewChildIterator( comp ) );
123   for ( it->InitEx( true ); it->More(); it->Next() ) {
124     _PTR(SObject) child( it->Value() );
125     CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( child );
126     GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
127     if( CORBA::is_nil( geomObj ) )
128       continue;
129
130     GEOM::ListOfGBO_var list = geomObj->GetDependency();
131     if( list->length() == 0 )
132       continue;
133
134     for( int i = 0; i < list->length(); i++ ) {
135       bool depends = false;
136       bool deleted = false;
137       QMap<QString, GEOM::GEOM_BaseObject_var>::Iterator git;
138       for ( git = gobjects.begin(); git != gobjects.end() && ( !depends || !deleted ); ++git ) {
139         depends = depends || list[i]->_is_equivalent( *git );
140         deleted = deleted || git.key() == child->GetID().c_str() ;//geomObj->_is_equivalent( *git );
141       }
142       if ( depends && !deleted )
143         return true;
144     }
145   }
146   return false;
147 }
148
149 //=======================================================================
150 // function : getGeomChildrenAndFolders
151 // purpose  : Get direct (1-level) GEOM objects under each folder, sub-folder, etc. and these folders itself
152 //=======================================================================
153 static void getGeomChildrenAndFolders( _PTR(SObject) theSO, 
154                                        QMap<QString,QString>& geomObjList, 
155                                        QMap<QString,QString>& folderList ) {
156   if ( !theSO ) return;
157   _PTR(Study) aStudy = theSO->GetStudy();
158   if ( !aStudy ) return;
159   _PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder();
160
161   bool isFolder = false;
162   _PTR(GenericAttribute) anAttr;
163   if ( theSO->FindAttribute(anAttr, "AttributeLocalID") ) {
164     _PTR(AttributeLocalID) aLocalID( anAttr );
165     isFolder = aLocalID->Value() == 999;
166   }
167   QString anEntry = theSO->GetID().c_str();
168   QString aName = theSO->GetName().c_str();
169   if ( isFolder ) {
170     folderList.insert( anEntry, aName );
171     _PTR(UseCaseIterator) ucit ( aUseCaseBuilder->GetUseCaseIterator( theSO ) );
172     for ( ucit->Init( false ); ucit->More(); ucit->Next() ) {
173       getGeomChildrenAndFolders( ucit->Value(), geomObjList, folderList );
174     }
175   } else {
176     geomObjList.insert( anEntry, aName );
177   }
178 }
179
180 //=======================================================================
181 // function : GEOMToolsGUI()
182 // purpose  : Constructor
183 //=======================================================================
184 GEOMToolsGUI::GEOMToolsGUI( GeometryGUI* parent )
185 : GEOMGUI( parent )
186 {
187 }
188
189 //=======================================================================
190 // function : ~GEOMToolsGUI()
191 // purpose  : Destructor
192 //=======================================================================
193 GEOMToolsGUI::~GEOMToolsGUI()
194 {
195 }
196
197 //=======================================================================
198 // function : OnGUIEvent()
199 // purpose  :
200 //=======================================================================
201 bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
202 {
203   getGeometryGUI()->EmitSignalDeactivateDialog();
204
205   switch ( theCommandID ) {
206   case GEOMOp::OpDelete:         // EDIT - DELETE
207     OnEditDelete();
208     break;
209   case GEOMOp::OpCheckGeom:      // TOOLS - CHECK GEOMETRY
210     OnCheckGeometry();
211     break;
212   case GEOMOp::OpSelectVertex:   // POPUP - SELECT ONLY - VERTEX
213     OnSelectOnly( GEOM_POINT );
214     break;
215   case GEOMOp::OpSelectEdge:     // POPUP - SELECT ONLY - EDGE
216     OnSelectOnly( GEOM_EDGE );
217     break;
218   case GEOMOp::OpSelectWire:     // POPUP - SELECT ONLY - WIRE
219     OnSelectOnly( GEOM_WIRE );
220     break;
221   case GEOMOp::OpSelectFace:     // POPUP - SELECT ONLY - FACE
222     OnSelectOnly( GEOM_FACE );
223     break;
224   case GEOMOp::OpSelectShell:    // POPUP - SELECT ONLY - SHELL
225     OnSelectOnly( GEOM_SHELL );
226     break;
227   case GEOMOp::OpSelectSolid:    // POPUP - SELECT ONLY - SOLID
228     OnSelectOnly( GEOM_SOLID );
229     break;
230   case GEOMOp::OpSelectCompound: // POPUP - SELECT ONLY - COMPOUND
231     OnSelectOnly( GEOM_COMPOUND );
232     break;
233   case GEOMOp::OpSelectAll:      // POPUP - SELECT ONLY - SELECT ALL
234     OnSelectOnly( GEOM_ALLOBJECTS );
235     break;
236   case GEOMOp::OpDeflection:     // POPUP - DEFLECTION ANGLE
237     OnDeflection();
238     break;
239   case GEOMOp::OpColor:          // POPUP - COLOR
240     OnColor();
241     break;
242   case GEOMOp::OpSetTexture:     // POPUP - TEXTURE
243     OnTexture();
244     break;
245   case GEOMOp::OpTransparency:   // POPUP - TRANSPARENCY
246     OnTransparency();
247     break;
248   case GEOMOp::OpIncrTransparency: // SHORTCUT   - INCREASE TRANSPARENCY
249     OnChangeTransparency( true );
250     break;
251   case GEOMOp::OpDecrTransparency: // SHORTCUT   - DECREASE TRANSPARENCY
252     OnChangeTransparency( false );
253     break;
254   case GEOMOp::OpIsos:           // POPUP - ISOS
255     OnNbIsos();
256     break;
257   case GEOMOp::OpIncrNbIsos:     // SHORTCUT   - INCREASE NB ISOLINES
258     OnNbIsos( INCR );
259     break;
260   case GEOMOp::OpDecrNbIsos:     // SHORTCUT   - DECREASE NB ISOLINES
261     OnNbIsos( DECR );
262     break;
263   case GEOMOp::OpMaterialProperties: // POPUP - MATERIAL PROPERTIES
264     OnMaterialProperties();
265     break;
266   case GEOMOp::OpPredefMaterCustom:  // POPUP  - MATERIAL PROPERTIES - CUSTOM...
267     OnMaterialProperties();
268     break;
269   case GEOMOp::OpMaterialsLibrary:    // POPUP MENU - MATERIAL PROPERTIES
270     OnMaterialsLibrary();
271     break;
272   case GEOMOp::OpAutoColor:      // POPUP - AUTO COLOR
273     OnAutoColor();
274     break;
275   case GEOMOp::OpNoAutoColor:    // POPUP - DISABLE AUTO COLOR
276     OnDisableAutoColor();
277     break;
278   case GEOMOp::OpDiscloseChildren:   // POPUP - SHOW CHILDREN
279   case GEOMOp::OpConcealChildren:   // POPUP - HIDE CHILDREN
280     OnDiscloseConcealChildren( theCommandID == GEOMOp::OpDiscloseChildren );
281     break;
282   case GEOMOp::OpPointMarker:    // POPUP - POINT MARKER
283     OnPointMarker();
284     break;
285   case GEOMOp::OpUnpublishObject:// POPUP - UNPUBLISH
286     OnUnpublishObject();
287     break;
288   case GEOMOp::OpPublishObject:// GEOM ROOT OBJECT - POPUP - PUBLISH
289     OnPublishObject();
290     break;
291   case GEOMOp::OpEdgeWidth:
292     OnEdgeWidth();
293     break;
294   case GEOMOp::OpIsosWidth:
295     OnIsosWidth();
296     break;
297   case GEOMOp::OpBringToFront:
298     OnBringToFront();
299     break;
300   case GEOMOp::OpClsBringToFront:
301     OnClsBringToFront();
302      break;
303   case GEOMOp::OpCreateFolder:
304     OnCreateFolder();
305      break;
306   case GEOMOp::OpSortChildren:
307     OnSortChildren();
308     break;
309   case GEOMOp::OpShowDependencyTree:
310     OnShowDependencyTree();
311      break;
312   case GEOMOp::OpReduceStudy:
313     OnReduceStudy();
314     break;
315   default:
316     SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
317     break;
318   }
319   return true;
320 }
321
322 //=======================================================================
323 // function : OnGUIEvent()
324 // purpose  :
325 //=======================================================================
326 bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent, const QVariant& theParam )
327 {
328   getGeometryGUI()->EmitSignalDeactivateDialog();
329
330   switch ( theCommandID ) {
331   case GEOMOp::OpPredefMaterial:         // POPUP MENU - MATERIAL PROPERTIES - <SOME MATERIAL>
332     OnSetMaterial( theParam );
333     break;
334   default:
335     SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
336     break;
337   }
338   return true;
339 }
340
341 //===============================================================================
342 // function : OnEditDelete()
343 // purpose  :
344 //===============================================================================
345 void GEOMToolsGUI::OnEditDelete()
346 {
347   SALOME_ListIO selected;
348   SalomeApp_Application* app =
349     dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
350   if ( !app )
351     return;
352
353   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
354   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
355   if ( !aSelMgr || !appStudy )
356     return;
357
358   // get selection
359   aSelMgr->selectedObjects( selected, "ObjectBrowser", false );
360   if ( selected.IsEmpty() )
361     return;
362
363   _PTR(Study) aStudy = appStudy->studyDS();
364   _PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder();
365
366   // check if study is locked
367   if ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() )->IsLocked() ) {
368     SUIT_MessageBox::warning( app->desktop(),
369                               tr("WRN_WARNING"),
370                               tr("WRN_STUDY_LOCKED") );
371     return; // study is locked
372   }
373
374   // get GEOM component
375   CORBA::String_var geomIOR = app->orb()->object_to_string( GeometryGUI::GetGeomGen() );
376   QString geomComp = getParentComponent( aStudy->FindObjectIOR( geomIOR.in() ) );
377
378   // check each selected object: if belongs to GEOM, if not reference...
379   QMap<QString,QString> toBeDeleted;
380   QMap<QString,QString> allDeleted;
381   QMap<QString,QString> toBeDelFolders;
382   bool isComponentSelected = false;
383
384   for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
385     Handle(SALOME_InteractiveObject) anIObject = It.Value();
386     if ( !anIObject->hasEntry() )
387       continue; // invalid object
388     // ...
389     QString entry = anIObject->getEntry();
390     _PTR(SObject) obj = aStudy->FindObjectID( entry.toLatin1().data() );
391     // check parent component
392     QString parentComp = getParentComponent( obj );
393     if ( parentComp != geomComp )  {
394       SUIT_MessageBox::warning( app->desktop(),
395                                 QObject::tr("ERR_ERROR"),
396                                 QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ) );
397       return; // not GEOM object selected
398     }
399
400     ///////////////////////////////////////////////////////
401     // if GEOM component is selected, so skip other checks
402     if ( isComponentSelected ) continue;
403     ///////////////////////////////////////////////////////
404
405     // check if object is reference
406     _PTR(SObject) refobj;
407     if ( obj && obj->ReferencedObject( refobj ) ) {
408       // get the main object by reference IPAL 21354
409       obj = refobj;
410       entry = obj->GetID().c_str();
411     }
412     // ...
413     QString aName = obj->GetName().c_str();
414     if ( entry == geomComp ) {
415       // GEOM component is selected, skip other checks
416       isComponentSelected = true;
417       continue;
418     }
419     // all sub-objects of folder have to be deleted
420     getGeomChildrenAndFolders( obj, toBeDeleted, toBeDelFolders );
421     allDeleted.insert( entry, aName ); // skip GEOM component
422     // browse through all children recursively
423     _PTR(UseCaseIterator) it ( aUseCaseBuilder->GetUseCaseIterator( obj ) );
424     for ( it->Init( true ); it->More(); it->Next() ) {
425       _PTR(SObject) child( it->Value() );
426       if ( child && child->ReferencedObject( refobj ) )
427         continue; // skip references
428       aName = child->GetName().c_str();
429       if ( !aName.isEmpty() )
430         allDeleted.insert( child->GetID().c_str(), aName );
431     }
432   }
433
434   // is there is anything to delete?
435   if ( !isComponentSelected && allDeleted.count() <= 0 )
436     return; // nothing to delete
437
438   // show confirmation dialog box
439   GEOMToolsGUI_DeleteDlg dlg( app->desktop(), allDeleted, isComponentSelected );
440   if ( !dlg.exec() )
441     return; // operation is cancelled by user
442
443   // get currently opened views
444   QList<SALOME_View*> views;
445   SALOME_View* view;
446   ViewManagerList vmans = app->viewManagers();
447   SUIT_ViewManager* vman;
448   foreach ( vman, vmans ) {
449     SUIT_ViewModel* vmod = vman->getViewModel();
450     view = dynamic_cast<SALOME_View*> ( vmod ); // must work for OCC and VTK views
451     if ( view )
452       views.append( view );
453   }
454
455   _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
456   GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
457
458   if ( isComponentSelected ) {
459     // GEOM component is selected: delete all objects recursively
460     _PTR(SObject) comp = aStudy->FindObjectID( geomComp.toLatin1().data() );
461     if ( !comp )
462       return;
463     _PTR(ChildIterator) it ( aStudy->NewChildIterator( comp ) );
464     // remove top-level objects only
465     for ( it->InitEx( false ); it->More(); it->Next() ) {
466       _PTR(SObject) child( it->Value() );
467       // remove object from GEOM engine
468       removeObjectWithChildren( child, aStudy, views, disp );
469       // remove object from study
470       aStudyBuilder->RemoveObjectWithChildren( child );
471       // remove object from use case tree
472       aUseCaseBuilder->Remove( child );
473     }
474   }
475   else {
476     // GEOM component is not selected: check if selected objects are in use
477     if ( inUse( aStudy, geomComp, allDeleted ) && 
478          SUIT_MessageBox::question( app->desktop(),
479                                     QObject::tr("WRN_WARNING"),
480                                     QObject::tr("DEP_OBJECT"),
481                                     SUIT_MessageBox::Yes | SUIT_MessageBox::No,
482                                     SUIT_MessageBox::No ) != SUIT_MessageBox::Yes ) {
483       return; // object(s) in use
484     }
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().toLatin1().data() ) );
489       // remove object from GEOM engine
490       removeObjectWithChildren( obj, aStudy, views, disp );
491       // remove objects from study
492       aStudyBuilder->RemoveObjectWithChildren( obj );
493       // remove object from use case tree
494       aUseCaseBuilder->Remove( obj );
495     }
496     // ... and then delete all folders
497     for ( it = toBeDelFolders.begin(); it != toBeDelFolders.end(); ++it ) {
498       _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
499       // remove object from GEOM engine
500       removeObjectWithChildren( obj, aStudy, views, disp );
501       // remove objects from study
502       aStudyBuilder->RemoveObjectWithChildren( obj );
503       // remove object from use case tree
504       aUseCaseBuilder->Remove( obj );
505     }
506   }
507
508   selected.Clear();
509   aSelMgr->setSelectedObjects( selected );
510   getGeometryGUI()->updateObjBrowser();
511   app->updateActions(); //SRN: To update a Save button in the toolbar
512 }
513
514 //=====================================================================================
515 // function : RemoveObjectWithChildren
516 // purpose  : used by OnEditDelete() method
517 //=====================================================================================
518 void GEOMToolsGUI::removeObjectWithChildren(_PTR(SObject) obj,
519                                             _PTR(Study) aStudy,
520                                             QList<SALOME_View*> views,
521                                             GEOM_Displayer* disp)
522 {
523   // iterate through all children of obj
524   for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
525   // for (_PTR(UseCaseIterator) it (aStudy->GetUseCaseBuilder()->GetUseCaseIterator(obj)); it->More(); it->Next()) {
526     _PTR(SObject) child (it->Value());
527     removeObjectWithChildren(child, aStudy, views, disp);
528   }
529
530   // erase object and remove it from engine
531   _PTR(GenericAttribute) anAttr;
532   if (obj->FindAttribute(anAttr, "AttributeIOR")) {
533     _PTR(AttributeIOR) anIOR (anAttr);
534
535     SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
536
537     // Delete shape in Client
538     const TCollection_AsciiString ASCIor ((char*)anIOR->Value().c_str());
539     getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCIor);
540
541     CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj);
542     GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
543     if (!CORBA::is_nil(geomObj)) {
544
545       //Remove visual properties of the object
546       appStudy->removeObjectFromAll(obj->GetID().c_str());
547
548       // Erase graphical object
549       QListIterator<SALOME_View*> it( views );
550       while ( it.hasNext() )
551         if ( SALOME_View* view = it.next() )
552           disp->Erase(geomObj, true, true, view);
553
554       // Remove object from Engine
555       // We can't directly remove object from engine. All we can do is to unpublish the object
556       // from the study. Another client could be using the object.
557       // Unpublishing is done just after in aStudyBuilder->RemoveObjectWithChildren( child );
558       //GeometryGUI::GetGeomGen()->RemoveObject( geomObj );
559     }
560   }
561 }
562
563 //=================================================================================
564 // function : deactivate()
565 // purpose  : Called when GEOM component is deactivated
566 //=================================================================================
567 void GEOMToolsGUI::deactivate()
568 {
569   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
570   if ( app ) {
571     SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
572     GEOM_Displayer aDisp (appStudy);
573     aDisp.GlobalSelection();
574     getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
575   }
576 }
577
578 //=====================================================================================
579 // EXPORTED METHODS
580 //=====================================================================================
581 extern "C"
582 {
583 #ifdef WIN32
584   __declspec( dllexport )
585 #endif
586   GEOMGUI* GetLibGUI( GeometryGUI* parent )
587   {
588     return new GEOMToolsGUI( parent );
589   }
590 }