Back to index

salome-geom  6.5.0
DisplayGUI.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // GEOM GEOMGUI : GUI for Geometry component
00024 // File   : DisplayGUI.cxx
00025 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00026 //
00027 #include "DisplayGUI.h"
00028 #include <GeometryGUI.h>
00029 #include "GeometryGUI_Operations.h"
00030 #include <GEOM_Constants.h>
00031 #include <GEOM_Displayer.h>
00032 #include <GEOM_AISShape.hxx>
00033 #include <GEOM_Actor.h>
00034 
00035 #include <SUIT_Desktop.h>
00036 #include <SUIT_ViewWindow.h>
00037 #include <SUIT_OverrideCursor.h>
00038 
00039 #include <OCCViewer_ViewManager.h>
00040 #include <OCCViewer_ViewModel.h>
00041 
00042 #include <SALOME_ListIO.hxx>
00043 #include <SALOME_ListIteratorOfListIO.hxx>
00044 
00045 #include <SVTK_ViewWindow.h>
00046 #include <SVTK_View.h>
00047 #include <SVTK_ViewModel.h>
00048 #include <SOCC_ViewModel.h>
00049 #include <SVTK_Prs.h>
00050 #include <SOCC_Prs.h>
00051 
00052 #include <QtxActionMenuMgr.h>
00053 
00054 #include <SalomeApp_Application.h>
00055 #include <LightApp_SelectionMgr.h>
00056 #include <SalomeApp_Study.h>
00057 
00058 #include <AIS_ListIteratorOfListOfInteractive.hxx>
00059 
00060 #include <vtkActorCollection.h>
00061 #include <vtkRenderer.h>
00062 
00063 #include <QAction>
00064 
00065 //=======================================================================
00066 // function : DisplayGUI::DisplayGUI()
00067 // purpose  : Constructor
00068 //=======================================================================
00069 DisplayGUI::DisplayGUI( GeometryGUI* parent ) : GEOMGUI( parent )
00070 {
00071 }
00072 
00073 //=======================================================================
00074 // function : DisplayGUI::~DisplayGUI()
00075 // purpose  : Destructor
00076 //=======================================================================
00077 DisplayGUI::~DisplayGUI()
00078 {
00079 }
00080 
00081 
00082 //=======================================================================
00083 // function : DisplayGUI::OnGUIEvent()
00084 // purpose  : Dispatch menu command
00085 //=======================================================================
00086 bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
00087 {
00088   SalomeApp_Application* app = getGeometryGUI()->getApp();
00089   if (!app) return false;
00090 
00091   LightApp_SelectionMgr *Sel = app->selectionMgr();
00092   SALOME_ListIO selected;
00093   Sel->selectedObjects( selected );
00094 
00095   switch ( theCommandID ) {
00096   case GEOMOp::OpDMWireframe:         // MENU VIEW - DISPLAY MODE - WIREFRAME
00097     SetDisplayMode( 0 );
00098     break;
00099   case GEOMOp::OpDMShading:           // MENU VIEW - DISPLAY MODE - SHADING
00100     SetDisplayMode( 1 );
00101     break;
00102   case GEOMOp::OpDMShadingWithEdges:  // MENU VIEW - DISPLAY MODE - SHADING WITH EDGES
00103     SetDisplayMode( 2 );
00104     break;
00105   case GEOMOp::OpShowAll:        // MENU VIEW - SHOW ALL
00106     getGeometryGUI()->EmitSignalDeactivateDialog();
00107     DisplayAll();
00108     break;
00109   case GEOMOp::OpShowOnly:       // POPUP MENU - SHOW ONLY
00110     getGeometryGUI()->EmitSignalDeactivateDialog();
00111     DisplayOnly();
00112     break;
00113   case GEOMOp::OpHideAll:        // MENU VIEW - HIDE ALL
00114     EraseAll();
00115     break;
00116   case GEOMOp::OpHide:           // POPUP MENU - HIDE
00117     Erase();
00118     break;
00119   case GEOMOp::OpShow:           // POPUP MENU - SHOW
00120     getGeometryGUI()->EmitSignalDeactivateDialog();
00121     Display();
00122     break;
00123   case GEOMOp::OpSwitchVectors:  // MENU VIEW - DISPLAY MODE - SHOW EDGE DIRECTION
00124     SetVectorMode(!GetVectorMode());
00125     getGeometryGUI()->action( GEOMOp::OpSwitchVectors )->setText
00126       ( GetVectorMode() ? tr("MEN_VECTOR_MODE_ON") : tr( "MEN_VECTOR_MODE_OFF" ) );
00127     getGeometryGUI()->menuMgr()->update();
00128     break;
00129   case GEOMOp::OpWireframe:      // POPUP MENU - DISPLAY MODE - WIREFRAME
00130     ChangeDisplayMode( 0 );
00131     break;
00132   case GEOMOp::OpShading:        // POPUP MENU - DISPLAY MODE - SHADING
00133     ChangeDisplayMode( 1 );
00134     break;
00135   case GEOMOp::OpShadingWithEdges: // POPUP MENU - DISPLAY MODE - SHADING WITH EDGES
00136     ChangeDisplayMode( 2 );
00137     break;
00138   case GEOMOp::OpTexture:        // POPUP MENU - DISPLAY MODE - TEXTURE
00139     ChangeDisplayMode( 3 );
00140     break;
00141     case GEOMOp::OpVectors:        // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
00142     ChangeDisplayMode( 4 );
00143     break;
00144   default:
00145     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
00146     break;
00147   }
00148   Sel->setSelectedObjects( selected );
00149   return true;
00150 }
00151 
00152 //=====================================================================================
00153 // function : DisplayGUI::DisplayAll()
00154 // purpose  : Display all GEOM objects
00155 //=====================================================================================
00156 void DisplayGUI::DisplayAll()
00157 {
00158   SalomeApp_Application* app = getGeometryGUI()->getApp();
00159   if ( !app ) return;
00160 
00161   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
00162   if ( !appStudy ) return;
00163   _PTR(Study) aStudy = appStudy->studyDS();
00164   if ( !aStudy ) return;
00165   _PTR(SComponent) SC ( aStudy->FindComponent( "GEOM" ) );
00166   if ( !SC )
00167     return;
00168 
00169   SALOME_ListIO listIO;
00170   _PTR(ChildIterator) anIter ( aStudy->NewChildIterator( SC ) );
00171   anIter->InitEx( true );
00172 
00173   SUIT_OverrideCursor();
00174 
00175   while( anIter->More() ) {
00176     _PTR(SObject) valSO ( anIter->Value() );
00177     _PTR(SObject) refSO;
00178     if ( !valSO->ReferencedObject( refSO ) ) {
00179       listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
00180                                                   SC->ComponentDataType().c_str(),
00181                                                   valSO->GetName().c_str()) );
00182     } 
00183     anIter->Next();
00184   }
00185   GEOM_Displayer( appStudy ).Display( listIO, true );
00186 }
00187 
00188 //=====================================================================================
00189 // function : DisplayGUI::EraseAll()
00190 // purpose  : Erase all GEOM objects
00191 //=====================================================================================
00192 void DisplayGUI::EraseAll()
00193 {
00194   SUIT_OverrideCursor();
00195 
00196   SUIT_Application* app = getGeometryGUI()->getApp();
00197   if ( app ) {
00198     SUIT_ViewWindow* vw = app->desktop()->activeWindow();
00199     if ( vw ) {
00200       SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
00201       SUIT_ViewManager* vman = vw->getViewManager();
00202       if ( vman->getType() == OCCViewer_Viewer::Type() || 
00203            vman->getType() == SVTK_Viewer::Type() ) {
00204         GEOM_Displayer( appStudy ).EraseAll();
00205       }
00206     }
00207   }
00208 }
00209 
00210 //=====================================================================================
00211 // function : DisplayGUI::DisplayOnly()
00212 // purpose  : Display selected GEOM objects and erase other
00213 //=====================================================================================
00214 void DisplayGUI::DisplayOnly()
00215 {
00216   EraseAll();
00217   Display();
00218 }
00219 
00220 //=====================================================================================
00221 // function : DisplayGUI::Display()
00222 // purpose  : Display selected GEOM objects
00223 //=====================================================================================
00224 void DisplayGUI::Display()
00225 {
00226   SALOME_ListIO listIO;
00227 
00228   SalomeApp_Application* app = getGeometryGUI()->getApp();
00229   if ( !app ) return;
00230 
00231   SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
00232   if ( !anActiveStudy ) return;
00233 
00234   //get SalomeApp selection manager
00235   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
00236   if ( !aSelMgr ) return;
00237 
00238   SALOME_ListIO aList;
00239   aSelMgr->selectedObjects( aList );
00240   SALOME_ListIteratorOfListIO It( aList );
00241 
00242   SUIT_OverrideCursor();
00243 
00244   for( ;It.More();It.Next() ) {
00245     Handle(SALOME_InteractiveObject) anIObject = It.Value();
00246     if ( anIObject->hasEntry() ) {
00247       _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
00248       if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
00249         _PTR(SComponent) SC ( SO->GetFatherComponent() );
00250         // if component is selected
00251         listIO.Clear();
00252         _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
00253         anIter->InitEx( true );
00254         while( anIter->More() ) {
00255           _PTR(SObject) valSO ( anIter->Value() );
00256           _PTR(SObject) refSO;
00257           if ( !valSO->ReferencedObject( refSO ) ) {
00258             listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
00259                                                         SC->ComponentDataType().c_str(),
00260                                                         valSO->GetName().c_str()) );
00261           }
00262           anIter->Next();
00263         }
00264         break;
00265       }
00266       else {
00267         listIO.Append( anIObject );
00268       }
00269     }
00270     else {
00271       listIO.Append( anIObject );
00272     }
00273   }
00274   GEOM_Displayer( anActiveStudy ).Display( listIO, true );
00275 }
00276 
00277 
00278 //=====================================================================================
00279 // function : DisplayGUI::Erase()
00280 // purpose  : Erase selected GEOM objects
00281 //=====================================================================================
00282 void DisplayGUI::Erase()
00283 {
00284   SALOME_ListIO listIO;
00285 
00286   SalomeApp_Application* app = getGeometryGUI()->getApp();
00287   if ( !app ) return;
00288 
00289   SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
00290   if ( !anActiveStudy ) return;
00291 
00292   //get SalomeApp selection manager
00293   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
00294   if ( !aSelMgr ) return;
00295 
00296   SALOME_ListIO aList;
00297   aSelMgr->selectedObjects( aList );
00298   SALOME_ListIteratorOfListIO It( aList );
00299 
00300   SUIT_OverrideCursor();
00301 
00302   for( ; It.More(); It.Next() ) {
00303     Handle(SALOME_InteractiveObject) anIObject = It.Value();
00304     if ( anIObject->hasEntry() ) {
00305       _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
00306       if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
00307         _PTR(SComponent) SC ( SO->GetFatherComponent() );
00308         // if component is selected
00309         listIO.Clear();
00310         _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
00311         anIter->InitEx( true );
00312         while( anIter->More() ) {
00313           _PTR(SObject) valSO ( anIter->Value() );
00314           _PTR(SObject) refSO;
00315           if ( !valSO->ReferencedObject( refSO ) ) {
00316             listIO.Append( new SALOME_InteractiveObject(valSO->GetID().c_str(),
00317                                                         SC->ComponentDataType().c_str(),
00318                                                         valSO->GetName().c_str()) );
00319           }
00320           anIter->Next();
00321         }
00322         break;
00323       }
00324       else {
00325         listIO.Append( anIObject );
00326       }
00327     }
00328     else {
00329       listIO.Append( anIObject );
00330     }
00331   }
00332 
00333   SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow();
00334   bool aIsForced = true;
00335   if(viewWindow->getViewManager()->getType() == SVTK_Viewer::Type())
00336     aIsForced = false;
00337 
00338   GEOM_Displayer(anActiveStudy).Erase( listIO, aIsForced);
00339   getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
00340 }
00341 
00342 //=====================================================================================
00343 // function : DisplayGUI::SetDisplayMode()
00344 // purpose  : Set display mode for the viewer (current viewer if <viewWindow> - 0 )
00345 //=====================================================================================
00346 void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
00347 {
00348   SUIT_OverrideCursor();
00349 
00350   if ( !viewWindow ) 
00351     viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
00352   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
00353     SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
00354     aView->SetDisplayMode( mode );
00355     GeometryGUI::Modified();
00356   } 
00357   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
00358     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
00359     Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
00360 
00361     AIS_DisplayMode newmode;
00362     switch (mode) {
00363     case 0:
00364       newmode = AIS_WireFrame;
00365       break;
00366     case 1:
00367       newmode = AIS_Shaded;
00368       break;
00369     case 2:
00370       newmode = AIS_DisplayMode( GEOM_AISShape::ShadingWithEdges );
00371       break;
00372     case 3:
00373       newmode = AIS_DisplayMode( GEOM_AISShape::TexturedShape );
00374       break;
00375     default:
00376       break;
00377     }
00378 
00379     AIS_ListOfInteractive List;
00380     ic->DisplayedObjects( List );
00381     AIS_ListOfInteractive List1;
00382     ic->ObjectsInCollector( List1 );
00383     List.Append( List1 );
00384     
00385     AIS_ListIteratorOfListOfInteractive ite( List );
00386     while( ite.More() ) {
00387       if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
00388        Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
00389        ic->SetDisplayMode( aSh, Standard_Integer( newmode ),true );
00390       }
00391       ite.Next();
00392     }
00393       
00394     ic->SetDisplayMode( newmode, Standard_False );
00395 
00396     GeometryGUI::Modified();
00397   }
00398 }
00399 
00400 //=====================================================================================
00401 // function : DisplayGUI::SetVectorsMode()
00402 // purpose  : Set vector mode for the viewer
00403 //=====================================================================================
00404 void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow )
00405 {
00406   SUIT_OverrideCursor();
00407 
00408   if ( !viewWindow ) 
00409     viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
00410   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
00411     viewWindow->setProperty( "VectorsMode", mode );
00412     SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
00413     vtkActorCollection* allActors = vw->getRenderer()->GetActors();
00414     allActors->InitTraversal();
00415     while (vtkActor* actor = allActors->GetNextActor()) {
00416       if (actor->GetVisibility()) { // only for visible actors
00417         GEOM_Actor* aGeomActor = 0;
00418         if ( actor->IsA( "GEOM_Actor" ) ) {
00419           aGeomActor = GEOM_Actor::SafeDownCast( actor );
00420           if ( aGeomActor )
00421             aGeomActor->SetVectorMode( mode );
00422         }
00423       }
00424     }
00425     GeometryGUI::Modified();
00426   }
00427   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
00428     viewWindow->setProperty( "VectorsMode", mode );
00429     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
00430     Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
00431     AIS_ListOfInteractive List;
00432     ic->DisplayedObjects( List );
00433     AIS_ListOfInteractive List1;
00434     ic->ObjectsInCollector( List1 );
00435     List.Append( List1 );
00436 
00437     AIS_ListIteratorOfListOfInteractive ite( List );
00438     while( ite.More() ) {
00439       if( ite.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
00440         Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( ite.Value() );
00441         aSh->SetDisplayVectors(mode);
00442         ic->RecomputePrsOnly(ite.Value());
00443       }
00444       ite.Next();
00445     }
00446     GeometryGUI::Modified();
00447   }
00448 }
00449 
00450 //=====================================================================================
00451 // function : DisplayGUI::GetVectorMode()
00452 // purpose  : Get the "show edge direction" mode of the viewer
00453 //=====================================================================================
00454 int DisplayGUI::GetVectorMode( SUIT_ViewWindow* viewWindow )
00455 {
00456   if ( !viewWindow ) 
00457     viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
00458   return viewWindow->property( "VectorsMode" ).toBool();
00459 }
00460 
00461 //=====================================================================================
00462 // function : DisplayGUI::ChangeDisplayMode()
00463 // purpose  : Set display mode for selected objects in the viewer given
00464 //            (current viewer if <viewWindow> = 0 )
00465 //=====================================================================================
00466 void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
00467 {
00468   SalomeApp_Application* app = getGeometryGUI()->getApp();
00469   if ( !app ) return;
00470 
00471   if ( !viewWindow ) 
00472     viewWindow = app->desktop()->activeWindow();
00473 
00474   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
00475   if ( !aSelMgr ) return;
00476 
00477   SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
00478   
00479   if(!aStudy)
00480     return;
00481 
00482   SUIT_OverrideCursor();
00483 
00484   SALOME_ListIO aList;
00485 
00486   if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
00487     SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
00488     SVTK_View* aView = vw->getView();
00489     int mgrId = viewWindow->getViewManager()->getGlobalId();
00490     bool vectorMode = false;
00491 
00492     aSelMgr->selectedObjects( aList );
00493     SALOME_ListIteratorOfListIO It( aList );
00494 
00495     for( ;It.More(); It.Next() ) {
00496       SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
00497       SVTK_Prs* vtkPrs =
00498         stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
00499       if ( vtkPrs && !vtkPrs->IsNull() ) {
00500        if (mode == 0 )
00501           aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
00502        else if ( mode == 1 )
00503           aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
00504        else if ( mode == 2 )
00505          aView->ChangeRepresentationToSurfaceWithEdges( vtkPrs->GetObjects() );
00506        else if ( mode == 4 ) {
00507           vtkActorCollection* anActors = vtkPrs->GetObjects();
00508           anActors->InitTraversal();
00509           while (vtkActor* anAct = anActors->GetNextActor()) {
00510             GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
00511             vectorMode = !aGeomActor->GetVectorMode();
00512             aGeomActor->SetVectorMode(vectorMode);
00513           }
00514         }
00515        if(mode == 0 || mode == 1 || mode == 2) {
00516          aStudy->setObjectProperty(mgrId,It.Value()->getEntry(),DISPLAY_MODE_PROP, mode);
00517        }
00518        else if (mode == 4) {
00519          aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),VECTOR_MODE_PROP, vectorMode);   
00520        }
00521       }
00522     }
00523     aView->Repaint();
00524     GeometryGUI::Modified();
00525   }
00526   else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
00527     OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
00528     Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
00529 
00530     aSelMgr->selectedObjects( aList );
00531     SALOME_ListIteratorOfListIO It( aList );
00532     int mgrId = viewWindow->getViewManager()->getGlobalId();
00533     bool vectorMode = 0;
00534 
00535     for( ;It.More(); It.Next() ) {
00536       SOCC_Viewer* soccViewer = (SOCC_Viewer*)(viewWindow->getViewManager()->getViewModel());
00537       SOCC_Prs* occPrs = dynamic_cast<SOCC_Prs*>( soccViewer->CreatePrs( It.Value()->getEntry() ) );
00538       if ( occPrs && !occPrs->IsNull() ) {
00539         AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
00540         AIS_ListIteratorOfListOfInteractive interIter( shapes );
00541         for ( ; interIter.More(); interIter.Next() ) {
00542          if ( mode == 0 )
00543             ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
00544          else if ( mode == 1 )
00545             ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
00546          else if ( mode == 2 )
00547            ic->SetDisplayMode( interIter.Value(), GEOM_AISShape::ShadingWithEdges, false );
00548          else if ( mode == 3 )
00549             ic->SetDisplayMode( interIter.Value(), AIS_ExactHLR, false );
00550          else if (mode == 4 ) {
00551            Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
00552             if ( !aSh.IsNull() ) {
00553               vectorMode = !aSh->isShowVectors();      
00554               aSh->SetDisplayVectors(vectorMode);
00555               ic->RecomputePrsOnly(interIter.Value());
00556             }
00557           }
00558         }
00559        if(mode == 0 || mode == 1 || mode == 2 || mode == 3) {
00560          aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),DISPLAY_MODE_PROP, mode);
00561        }
00562        else if (mode == 4) {
00563          aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),VECTOR_MODE_PROP, vectorMode);
00564        }
00565       }
00566     }
00567     ic->UpdateCurrentViewer();
00568     GeometryGUI::Modified();
00569   }
00570 }
00571 
00572 //=====================================================================================
00573 // EXPORTED METHODS
00574 //=====================================================================================
00575 extern "C"
00576 {
00577 #ifdef WIN32
00578   __declspec( dllexport )
00579 #endif
00580   GEOMGUI* GetLibGUI( GeometryGUI* parent )
00581   {
00582     return new DisplayGUI( parent );
00583   }
00584 }