Salome HOME
Merge from BR_OPENCV
[modules/geom.git] / src / DisplayGUI / DisplayGUI.cxx
1 // Copyright (C) 2007-2011  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.
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   : DisplayGUI.cxx
25 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
26 //
27 #include "DisplayGUI.h"
28 #include <GeometryGUI.h>
29 #include "GeometryGUI_Operations.h"
30 #include <GEOM_Displayer.h>
31 #include <GEOM_AISShape.hxx>
32 #include <GEOM_Actor.h>
33
34 #include <SUIT_Desktop.h>
35 #include <SUIT_ViewWindow.h>
36 #include <SUIT_OverrideCursor.h>
37
38 #include <OCCViewer_ViewManager.h>
39 #include <OCCViewer_ViewModel.h>
40
41 #include <SALOME_ListIO.hxx>
42 #include <SALOME_ListIteratorOfListIO.hxx>
43
44 #include <SVTK_ViewWindow.h>
45 #include <SVTK_View.h>
46 #include <SVTK_ViewModel.h>
47 #include <SOCC_ViewModel.h>
48 #include <SVTK_Prs.h>
49 #include <SOCC_Prs.h>
50
51 #include <QtxActionMenuMgr.h>
52
53 #include <SalomeApp_Application.h>
54 #include <LightApp_SelectionMgr.h>
55 #include <SalomeApp_Study.h>
56
57 #include <AIS_ListIteratorOfListOfInteractive.hxx>
58
59 #include <vtkActorCollection.h>
60 #include <vtkRenderer.h>
61
62 #include <QAction>
63
64 //=======================================================================
65 // function : DisplayGUI::DisplayGUI()
66 // purpose  : Constructor
67 //=======================================================================
68 DisplayGUI::DisplayGUI( GeometryGUI* parent ) : GEOMGUI( parent )
69 {
70 }
71
72 //=======================================================================
73 // function : DisplayGUI::~DisplayGUI()
74 // purpose  : Destructor
75 //=======================================================================
76 DisplayGUI::~DisplayGUI()
77 {
78 }
79
80
81 //=======================================================================
82 // function : DisplayGUI::OnGUIEvent()
83 // purpose  : Dispatch menu command
84 //=======================================================================
85 bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
86 {
87   SalomeApp_Application* app = getGeometryGUI()->getApp();
88   if (!app) return false;
89
90   LightApp_SelectionMgr *Sel = app->selectionMgr();
91   SALOME_ListIO selected;
92   Sel->selectedObjects( selected );
93
94   switch ( theCommandID ) {
95   case GEOMOp::OpDisplayMode:    // MENU VIEW - DISPLAY MODE - WIREFRAME/SHADING
96     InvertDisplayMode();
97     getGeometryGUI()->action( GEOMOp::OpDisplayMode )->setText
98       ( GetDisplayMode() == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
99     getGeometryGUI()->menuMgr()->update();
100     break;
101   case GEOMOp::OpShowAll:        // MENU VIEW - SHOW ALL
102     getGeometryGUI()->EmitSignalDeactivateDialog();
103     DisplayAll();
104     break;
105   case GEOMOp::OpShowOnly:       // POPUP MENU - SHOW ONLY
106     getGeometryGUI()->EmitSignalDeactivateDialog();
107     DisplayOnly();
108     break;
109   case GEOMOp::OpHideAll:        // MENU VIEW - HIDE ALL
110     EraseAll();
111     break;
112   case GEOMOp::OpHide:           // POPUP MENU - HIDE
113     Erase();
114     break;
115   case GEOMOp::OpShow:           // POPUP MENU - SHOW
116     getGeometryGUI()->EmitSignalDeactivateDialog();
117     Display();
118     break;
119   case GEOMOp::OpSwitchVectors:  // MENU VIEW - DISPLAY MODE - SHOW EDGE DIRECTION
120     SetVectorMode(!GetVectorMode());
121     getGeometryGUI()->action( GEOMOp::OpSwitchVectors )->setText
122       ( GetVectorMode() ? tr("MEN_VECTOR_MODE_ON") : tr( "MEN_VECTOR_MODE_OFF" ) );
123     getGeometryGUI()->menuMgr()->update();
124     break;
125   case GEOMOp::OpWireframe:      // POPUP MENU - DISPLAY MODE - WIREFRAME
126     ChangeDisplayMode( 0 );
127     break;
128   case GEOMOp::OpShading:        // POPUP MENU - DISPLAY MODE - SHADING
129     ChangeDisplayMode( 1 );
130     break;
131   case GEOMOp::OpTexture:        // POPUP MENU - DISPLAY MODE - TEXTURE
132     ChangeDisplayMode( 3 );
133     break;
134   case GEOMOp::OpVectors:        // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
135     ChangeDisplayMode( 2 );
136     break;
137   default:
138     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
139     break;
140   }
141   Sel->setSelectedObjects( selected );
142   return true;
143 }
144
145 //=====================================================================================
146 // function : DisplayGUI::DisplayAll()
147 // purpose  : Display all GEOM objects
148 //=====================================================================================
149 void DisplayGUI::DisplayAll()
150 {
151   SalomeApp_Application* app = getGeometryGUI()->getApp();
152   if ( !app ) return;
153
154   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
155   if ( !appStudy ) return;
156   _PTR(Study) aStudy = appStudy->studyDS();
157   if ( !aStudy ) return;
158   _PTR(SComponent) SC ( aStudy->FindComponent( "GEOM" ) );
159   if ( !SC )
160     return;
161
162   SALOME_ListIO listIO;
163   _PTR(ChildIterator) anIter ( aStudy->NewChildIterator( SC ) );
164   anIter->InitEx( true );
165
166   SUIT_OverrideCursor();
167
168   while( anIter->More() ) {
169     _PTR(SObject) valSO ( anIter->Value() );
170     _PTR(SObject) refSO;
171     if ( !valSO->ReferencedObject( refSO ) ) {
172       listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
173                                                   SC->ComponentDataType().c_str(),
174                                                   valSO->GetName().c_str()) );
175     } 
176     anIter->Next();
177   }
178   GEOM_Displayer( appStudy ).Display( listIO, true );
179 }
180
181 //=====================================================================================
182 // function : DisplayGUI::EraseAll()
183 // purpose  : Erase all GEOM objects
184 //=====================================================================================
185 void DisplayGUI::EraseAll()
186 {
187   SUIT_OverrideCursor();
188
189   SUIT_Application* app = getGeometryGUI()->getApp();
190   if ( app ) {
191     SUIT_ViewWindow* vw = app->desktop()->activeWindow();
192     if ( vw ) {
193       SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
194       SUIT_ViewManager* vman = vw->getViewManager();
195       if ( vman->getType() == OCCViewer_Viewer::Type() || 
196            vman->getType() == SVTK_Viewer::Type() ) {
197         GEOM_Displayer( appStudy ).EraseAll();
198       }
199     }
200   }
201 }
202
203 //=====================================================================================
204 // function : DisplayGUI::DisplayOnly()
205 // purpose  : Display selected GEOM objects and erase other
206 //=====================================================================================
207 void DisplayGUI::DisplayOnly()
208 {
209   EraseAll();
210   Display();
211 }
212
213 //=====================================================================================
214 // function : DisplayGUI::Display()
215 // purpose  : Display selected GEOM objects
216 //=====================================================================================
217 void DisplayGUI::Display()
218 {
219   SALOME_ListIO listIO;
220
221   SalomeApp_Application* app = getGeometryGUI()->getApp();
222   if ( !app ) return;
223
224   SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
225   if ( !anActiveStudy ) return;
226
227   //get SalomeApp selection manager
228   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
229   if ( !aSelMgr ) return;
230
231   SALOME_ListIO aList;
232   aSelMgr->selectedObjects( aList );
233   SALOME_ListIteratorOfListIO It( aList );
234
235   SUIT_OverrideCursor();
236
237   for( ;It.More();It.Next() ) {
238     Handle(SALOME_InteractiveObject) anIObject = It.Value();
239     if ( anIObject->hasEntry() ) {
240       _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
241       if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
242         _PTR(SComponent) SC ( SO->GetFatherComponent() );
243         // if component is selected
244         listIO.Clear();
245         _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
246         anIter->InitEx( true );
247         while( anIter->More() ) {
248           _PTR(SObject) valSO ( anIter->Value() );
249           _PTR(SObject) refSO;
250           if ( !valSO->ReferencedObject( refSO ) ) {
251             listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
252                                                         SC->ComponentDataType().c_str(),
253                                                         valSO->GetName().c_str()) );
254           }
255           anIter->Next();
256         }
257         break;
258       }
259       else {
260         listIO.Append( anIObject );
261       }
262     }
263     else {
264       listIO.Append( anIObject );
265     }
266   }
267   GEOM_Displayer( anActiveStudy ).Display( listIO, true );
268 }
269
270
271 //=====================================================================================
272 // function : DisplayGUI::Erase()
273 // purpose  : Erase selected GEOM objects
274 //=====================================================================================
275 void DisplayGUI::Erase()
276 {
277   SALOME_ListIO listIO;
278
279   SalomeApp_Application* app = getGeometryGUI()->getApp();
280   if ( !app ) return;
281
282   SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
283   if ( !anActiveStudy ) return;
284
285   //get SalomeApp selection manager
286   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
287   if ( !aSelMgr ) return;
288
289   SALOME_ListIO aList;
290   aSelMgr->selectedObjects( aList );
291   SALOME_ListIteratorOfListIO It( aList );
292
293   SUIT_OverrideCursor();
294
295   for( ; It.More(); It.Next() ) {
296     Handle(SALOME_InteractiveObject) anIObject = It.Value();
297     if ( anIObject->hasEntry() ) {
298       _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
299       if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
300         _PTR(SComponent) SC ( SO->GetFatherComponent() );
301         // if component is selected
302         listIO.Clear();
303         _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
304         anIter->InitEx( true );
305         while( anIter->More() ) {
306           _PTR(SObject) valSO ( anIter->Value() );
307           _PTR(SObject) refSO;
308           if ( !valSO->ReferencedObject( refSO ) ) {
309             listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
310                                                         SC->ComponentDataType().c_str(),
311                                                         valSO->GetName().c_str()) );
312           }
313           anIter->Next();
314         }
315         break;
316       }
317       else {
318         listIO.Append( anIObject );
319       }
320     }
321     else {
322       listIO.Append( anIObject );
323     }
324   }
325
326   SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow();
327   bool aIsForced = true;
328   if(viewWindow->getViewManager()->getType() == SVTK_Viewer::Type())
329     aIsForced = false;
330
331   GEOM_Displayer(anActiveStudy).Erase( listIO, aIsForced);
332   getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
333 }
334
335 //=====================================================================================
336 // function : DisplayGUI::SetDisplayMode()
337 // purpose  : Set display mode for the viewer (current viewer if <viewWindow> - 0 )
338 //=====================================================================================
339 void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
340 {
341   SUIT_OverrideCursor();
342
343   if ( !viewWindow ) 
344     viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
345   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
346     SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
347     aView->SetDisplayMode( mode );
348     GeometryGUI::Modified();
349   } 
350   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
351     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
352     Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
353     AIS_DisplayMode newmode = (mode == 1 ? AIS_Shaded : AIS_WireFrame);
354     AIS_ListOfInteractive List;
355     ic->DisplayedObjects( List );
356     AIS_ListOfInteractive List1;
357     ic->ObjectsInCollector( List1 );
358     List.Append( List1 );
359
360     AIS_ListIteratorOfListOfInteractive ite( List );
361     while( ite.More() ) {
362       if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
363         Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
364         ic->SetDisplayMode( aSh, Standard_Integer( newmode ),true );
365       }
366       ite.Next();
367     }
368
369     ic->SetDisplayMode( newmode, Standard_False );
370     GeometryGUI::Modified();
371   }
372 }
373
374 //=====================================================================================
375 // function : DisplayGUI::GetDisplayMode()
376 // purpose  : Get display mode of the viewer (current viewer if <viewWindow> - 0 )
377 //=====================================================================================
378 int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
379 {
380   int dispMode = 0;
381   if ( !viewWindow ) 
382     viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
383   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
384     SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
385     dispMode = aView->GetDisplayMode();
386   } 
387   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
388     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
389     Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
390     AIS_DisplayMode mode = (AIS_DisplayMode)ic->DisplayMode();
391     dispMode = (mode == AIS_WireFrame ? 0 : 1 );
392   }
393   return dispMode;
394 }
395
396 //=====================================================================================
397 // function : DisplayGUI::SetVectorsMode()
398 // purpose  : Set vector mode for the viewer
399 //=====================================================================================
400 void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow )
401 {
402   SUIT_OverrideCursor();
403
404   if ( !viewWindow ) 
405     viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
406   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
407     viewWindow->setProperty( "VectorsMode", mode );
408     SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
409     vtkActorCollection* allActors = vw->getRenderer()->GetActors();
410     allActors->InitTraversal();
411     while (vtkActor* actor = allActors->GetNextActor()) {
412       if (actor->GetVisibility()) { // only for visible actors
413         GEOM_Actor* aGeomActor = 0;
414         if ( actor->IsA( "GEOM_Actor" ) ) {
415           aGeomActor = GEOM_Actor::SafeDownCast( actor );
416           if ( aGeomActor )
417             aGeomActor->SetVectorMode( mode );
418         }
419       }
420     }
421     GeometryGUI::Modified();
422   }
423   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
424     viewWindow->setProperty( "VectorsMode", mode );
425     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
426     Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
427     AIS_ListOfInteractive List;
428     ic->DisplayedObjects( List );
429     AIS_ListOfInteractive List1;
430     ic->ObjectsInCollector( List1 );
431     List.Append( List1 );
432
433     AIS_ListIteratorOfListOfInteractive ite( List );
434     while( ite.More() ) {
435       if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
436         Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
437         aSh->SetDisplayVectors(mode);
438         ic->RecomputePrsOnly(ite.Value());
439       }
440       ite.Next();
441     }
442     GeometryGUI::Modified();
443   }
444 }
445
446 //=====================================================================================
447 // function : DisplayGUI::GetVectorMode()
448 // purpose  : Get the "show edge direction" mode of the viewer
449 //=====================================================================================
450 int DisplayGUI::GetVectorMode( SUIT_ViewWindow* viewWindow )
451 {
452   if ( !viewWindow ) 
453     viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
454   return viewWindow->property( "VectorsMode" ).toBool();
455 }
456
457 //=====================================================================================
458 // function : DisplayGUI::InvertDisplayMode()
459 // purpose  : Invert display mode ( shadin <-> wireframe ) for the viewer 
460 //            (current viewer if <viewWindow> = 0 )
461 //=====================================================================================
462 void DisplayGUI::InvertDisplayMode( SUIT_ViewWindow* viewWindow )
463 {
464   SetDisplayMode( 1 - GetDisplayMode( viewWindow ) );
465 }
466
467 //=====================================================================================
468 // function : DisplayGUI::ChangeDisplayMode()
469 // purpose  : Set display mode for selected objects in the viewer given
470 //            (current viewer if <viewWindow> = 0 )
471 //=====================================================================================
472 void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
473 {
474   SalomeApp_Application* app = getGeometryGUI()->getApp();
475   if ( !app ) return;
476
477   if ( !viewWindow ) 
478     viewWindow = app->desktop()->activeWindow();
479
480   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
481   if ( !aSelMgr ) return;
482
483   SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
484   
485   if(!aStudy)
486     return;
487
488   SUIT_OverrideCursor();
489
490   SALOME_ListIO aList;
491
492   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
493     SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
494     SVTK_View* aView = vw->getView();
495     int mgrId = viewWindow->getViewManager()->getGlobalId();
496     bool vectorMode = false;
497
498     aSelMgr->selectedObjects( aList );
499     SALOME_ListIteratorOfListIO It( aList );
500
501     for( ;It.More(); It.Next() ) {
502       SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
503       SVTK_Prs* vtkPrs =
504         stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
505       if ( vtkPrs && !vtkPrs->IsNull() ) {
506         if ( mode == 0 )
507           aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
508         else if ( mode == 1 )
509           aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
510         else if ( mode == 2 ) {
511           vtkActorCollection* anActors = vtkPrs->GetObjects();
512           anActors->InitTraversal();
513           while (vtkActor* anAct = anActors->GetNextActor()) {
514             GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
515             vectorMode = !aGeomActor->GetVectorMode();
516             aGeomActor->SetVectorMode(vectorMode);
517           }
518         }
519         if(mode == 0 || mode == 1) {
520           aStudy->setObjectProperty(mgrId,It.Value()->getEntry(),DISPLAY_MODE_PROP, mode);
521         } 
522         else if (mode == 3) {
523           aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),VECTOR_MODE_PROP , vectorMode);
524         }
525       }
526     }
527     aView->Repaint();
528     GeometryGUI::Modified();
529   }
530   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
531     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
532     Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
533
534     aSelMgr->selectedObjects( aList );
535     SALOME_ListIteratorOfListIO It( aList );
536     int mgrId = viewWindow->getViewManager()->getGlobalId();
537     bool vectorMode = 0;
538
539     for( ;It.More(); It.Next() ) {
540       SOCC_Viewer* soccViewer = (SOCC_Viewer*)(viewWindow->getViewManager()->getViewModel());
541       SOCC_Prs* occPrs = dynamic_cast<SOCC_Prs*>( soccViewer->CreatePrs( It.Value()->getEntry() ) );
542       if ( occPrs && !occPrs->IsNull() ) {
543         AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
544         AIS_ListIteratorOfListOfInteractive interIter( shapes );
545         for ( ; interIter.More(); interIter.Next() ) {
546           if ( mode == 0 )
547             ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
548           else if ( mode == 1 )
549             ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
550           else if ( mode == 3 )
551             ic->SetDisplayMode( interIter.Value(), AIS_ExactHLR, false );
552           else if (mode == 2 ) {
553             Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
554             if ( !aSh.IsNull() ) {
555               vectorMode = !aSh->isShowVectors();      
556               aSh->SetDisplayVectors(vectorMode);
557               ic->RecomputePrsOnly(interIter.Value());
558             }
559           }
560         }
561         if(mode == 0 || mode == 1) {
562           aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),DISPLAY_MODE_PROP, mode);
563         } else if (mode == 2) {
564           aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),VECTOR_MODE_PROP, vectorMode);
565         }
566       }
567     }
568     ic->UpdateCurrentViewer();
569     GeometryGUI::Modified();
570   }
571 }
572
573 //=====================================================================================
574 // EXPORTED METHODS
575 //=====================================================================================
576 extern "C"
577 {
578 #ifdef WIN32
579   __declspec( dllexport )
580 #endif
581   GEOMGUI* GetLibGUI( GeometryGUI* parent )
582   {
583     return new DisplayGUI( parent );
584   }
585 }