Salome HOME
Fix for bug IPAL9258(/dn06/../current1706): SIGSEGV after trying to close dialog...
authormzn <mzn@opencascade.com>
Fri, 1 Jul 2005 10:42:32 +0000 (10:42 +0000)
committermzn <mzn@opencascade.com>
Fri, 1 Jul 2005 10:42:32 +0000 (10:42 +0000)
47 files changed:
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h
src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePatternDlg.h
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.h
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.h
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.h
src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
src/SMESHGUI/SMESHGUI_GroupOpDlg.h
src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MergeNodesDlg.h
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.h
src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MoveNodesDlg.h
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.h
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.h
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.h
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.h
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.h
src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
src/SMESHGUI/SMESHGUI_SingleEditDlg.h
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.h
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.h
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx

index bb36d5c0386560a69a3367ccfa2ef27d95267e36..823716a853bb6cd4f69b87c496538c69aba2e665 100644 (file)
@@ -216,14 +216,13 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
     (SUIT_Session::session()->activeApplication());
   myIsPoly = false;
   mySimulation = new SMESH::TElementSimulation (anApp);
 {
   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
     (SUIT_Session::session()->activeApplication());
   myIsPoly = false;
   mySimulation = new SMESH::TElementSimulation (anApp);
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
 
   // verify nb nodes and type
   myNbNodes = nbNodes;
 
   // verify nb nodes and type
   myNbNodes = nbNodes;
@@ -420,7 +419,8 @@ void SMESHGUI_AddMeshElementDlg::Init()
   // set selection mode
   SMESH::SetPointRepresentation(true);
 
   // set selection mode
   SMESH::SetPointRepresentation(true);
 
-  myViewWindow->SetSelectionMode( NodeSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( NodeSelection );
 
   myBusy = false;
 
 
   myBusy = false;
 
@@ -491,7 +491,8 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
   mySelectionMgr->clearSelected();
   mySimulation->SetVisibility(false);
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearSelected();
   mySimulation->SetVisibility(false);
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode( ActorSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( ActorSelection );
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
@@ -532,7 +533,8 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
     }
     
     mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
     }
     
     mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
-    myViewWindow->highlight( myActor->getIO(), true, true );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->highlight( myActor->getIO(), true, true );
     
     bool aNodesOK = false;
     if (myIsPoly && myElementType == SMDSAbs_Face && aListId.count() >=3 ){
     
     bool aNodesOK = false;
     if (myIsPoly && myElementType == SMDSAbs_Face && aListId.count() >=3 ){
@@ -693,7 +695,8 @@ void SMESHGUI_AddMeshElementDlg::ActivateThisDialog()
 
   SMESH::SetPointRepresentation(true);
 
 
   SMESH::SetPointRepresentation(true);
 
-  myViewWindow->SetSelectionMode( NodeSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( NodeSelection );
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
index a04635c304ea6bd48587bea02d0d3ac9032cb487..e6149a33ef2efc4e80cb1a876cc12219866f769c 100644 (file)
@@ -88,7 +88,6 @@ private:
     SalomeApp_SelectionMgr*     mySelectionMgr;          /* User shape selection */
     int                         myNbOkNodes;               /* to check when arguments is defined */
     bool                        myBusy;
     SalomeApp_SelectionMgr*     mySelectionMgr;          /* User shape selection */
     int                         myNbOkNodes;               /* to check when arguments is defined */
     bool                        myBusy;
-    SVTK_ViewWindow*            myViewWindow;
     SVTK_Selector*              mySelector;
 
     QLineEdit*                  myEditCurrentArgument;   /* Current  LineEdit */
     SVTK_Selector*              mySelector;
 
     QLineEdit*                  myEditCurrentArgument;   /* Current  LineEdit */
index 28bb9ad0c5e05707628d1398d5994fee150ab6d1..6b1f20e1287f6a4d3fcc29085ff6ff2aab22c77c 100755 (executable)
@@ -88,9 +88,7 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI*   theModule,
      : QDialog( SMESH::GetDesktop( theModule ), theName, false,\r
                 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),\r
      mySMESHGUI( theModule ),\r
      : QDialog( SMESH::GetDesktop( theModule ), theName, false,\r
                 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),\r
      mySMESHGUI( theModule ),\r
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),\r
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),\r
-     mySelector( myViewWindow->GetSelector() )\r
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )\r
 {\r
   setCaption(tr("CAPTION"));\r
 \r
 {\r
   setCaption(tr("CAPTION"));\r
 \r
@@ -104,6 +102,9 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI*   theModule,
 \r
   aDlgLay->setStretchFactor(aMainFrame, 1);\r
 \r
 \r
   aDlgLay->setStretchFactor(aMainFrame, 1);\r
 \r
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+    mySelector = aViewWindow->GetSelector();\r
+\r
   Init(theType);\r
 }\r
 \r
   Init(theType);\r
 }\r
 \r
@@ -386,7 +387,8 @@ void SMESHGUI_CreatePatternDlg::onSave()
                                tr("ERROR_OF_SAVING"), QMessageBox::Ok);\r
     } else {\r
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
                                tr("ERROR_OF_SAVING"), QMessageBox::Ok);\r
     } else {\r
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
-      myViewWindow->SetSelectionMode(ActorSelection);\r
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+       aViewWindow->SetSelectionMode(ActorSelection);\r
       disconnect(mySelectionMgr, 0, this, 0);\r
       disconnect(mySMESHGUI, 0, this, 0);\r
       mySMESHGUI->ResetState();\r
       disconnect(mySelectionMgr, 0, this, 0);\r
       disconnect(mySMESHGUI, 0, this, 0);\r
       mySMESHGUI->ResetState();\r
@@ -435,7 +437,8 @@ void SMESHGUI_CreatePatternDlg::onOk()
       return;\r
     } else {\r
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
       return;\r
     } else {\r
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
-      myViewWindow->SetSelectionMode(ActorSelection);\r
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+       aViewWindow->SetSelectionMode(ActorSelection);\r
       disconnect(mySelectionMgr, 0, this, 0);\r
       disconnect(mySMESHGUI, 0, this, 0);\r
       mySMESHGUI->ResetState();\r
       disconnect(mySelectionMgr, 0, this, 0);\r
       disconnect(mySMESHGUI, 0, this, 0);\r
       mySMESHGUI->ResetState();\r
@@ -454,7 +457,8 @@ void SMESHGUI_CreatePatternDlg::onOk()
 //=======================================================================\r
 void SMESHGUI_CreatePatternDlg::onClose()\r
 {\r
 //=======================================================================\r
 void SMESHGUI_CreatePatternDlg::onClose()\r
 {\r
-  myViewWindow->SetSelectionMode(ActorSelection);\r
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+    aViewWindow->SetSelectionMode(ActorSelection);\r
   disconnect(mySelectionMgr, 0, this, 0);\r
   disconnect(mySMESHGUI, 0, this, 0);\r
   mySMESHGUI->ResetState();\r
   disconnect(mySelectionMgr, 0, this, 0);\r
   disconnect(mySMESHGUI, 0, this, 0);\r
   mySMESHGUI->ResetState();\r
@@ -682,7 +686,8 @@ void SMESHGUI_CreatePatternDlg::activateSelection()
 {\r
   mySelectionMgr->clearFilters();\r
   //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
 {\r
   mySelectionMgr->clearFilters();\r
   //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
-  myViewWindow->SetSelectionMode(ActorSelection);\r
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+    aViewWindow->SetSelectionMode(ActorSelection);\r
 \r
   if (myType == Type_2d) {\r
     mySelectionMgr->installFilter(new SMESH_NumberFilter\r
 \r
   if (myType == Type_2d) {\r
     mySelectionMgr->installFilter(new SMESH_NumberFilter\r
index d0ff40e63bb6966b85d8e12d26d4bb2ce0fc12ec..2e2555c55d5be743f736d58de86784cfde9fa3fc 100755 (executable)
@@ -130,7 +130,6 @@ private:
   QCheckBox*               myProjectChk;
 
   SMESHGUI*                mySMESHGUI;
   QCheckBox*               myProjectChk;
 
   SMESHGUI*                mySMESHGUI;
-  SVTK_ViewWindow*         myViewWindow;
   SVTK_Selector*           mySelector;
   SalomeApp_SelectionMgr*  mySelectionMgr;
   int                      myNbPoints;
   SVTK_Selector*           mySelector;
   SalomeApp_SelectionMgr*  mySelectionMgr;
   int                      myNbPoints;
index b84c11b10206eb936656de6a627faec3d799eb01..a58fd065ef1c0adc78cacda56ddb56cfba626bf6 100644 (file)
@@ -191,9 +191,7 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
                                                                        bool modal, WFlags fl )
   : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
     mySMESHGUI( theModule ),
                                                                        bool modal, WFlags fl )
   : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
     mySMESHGUI( theModule ),
-    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myViewWindow( SMESH::GetViewWindow( theModule ) ),
-    mySelector( myViewWindow->GetSelector() )
+    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH",tr("ICON_SELECT")));
 
 {
   QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH",tr("ICON_SELECT")));
 
@@ -310,6 +308,8 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
   Preview = new QCheckBox( GroupContent, "Preview" );
   Preview->setText( tr( "SMESH_POLYEDRE_PREVIEW"  ) );
   GroupContentLayout->addWidget( Preview , 5, 0 );
   Preview = new QCheckBox( GroupContent, "Preview" );
   Preview->setText( tr( "SMESH_POLYEDRE_PREVIEW"  ) );
   GroupContentLayout->addWidget( Preview , 5, 0 );
+
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
   
   SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupContent, 1, 0 );
   
   
   SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupContent, 1, 0 );
   
@@ -403,7 +403,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
        }
         else
           SMESH::SetPointRepresentation(true);
        }
         else
           SMESH::SetPointRepresentation(true);
-       myViewWindow->SetSelectionMode(NodeSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(NodeSelection);
        
        AddButton->setEnabled(false);
        RemoveButton->setEnabled(false);
        
        AddButton->setEnabled(false);
        RemoveButton->setEnabled(false);
@@ -426,7 +427,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
        } else {
          SMESH::SetPointRepresentation(false);
        }
        } else {
          SMESH::SetPointRepresentation(false);
        }
-       myViewWindow->SetSelectionMode(FaceSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(FaceSelection);
        
        TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
        myFacesByNodesLabel->hide();
        
        TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
        myFacesByNodesLabel->hide();
@@ -554,7 +556,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
   mySelectionMgr->setSelectedObjects( aList );
   SMESH::SetPointRepresentation(false);
   mySimulation->SetVisibility(false);
   mySelectionMgr->setSelectedObjects( aList );
   SMESH::SetPointRepresentation(false);
   mySimulation->SetVisibility(false);
-  myViewWindow->SetSelectionMode( ActorSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( ActorSelection );
   disconnect( mySelectionMgr, 0, this, 0 );
   mySMESHGUI->ResetState() ;
   reject() ;
   disconnect( mySelectionMgr, 0, this, 0 );
   mySMESHGUI->ResetState() ;
   reject() ;
@@ -591,7 +594,9 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
       }
       
       mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
       }
       
       mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
-      myViewWindow->highlight( myActor->getIO(), true, true );
+      
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( myActor->getIO(), true, true );
       
       if ( myNbOkElements>0 && aListId.count()>=3)
        AddButton->setEnabled(true);
       
       if ( myNbOkElements>0 && aListId.count()>=3)
        AddButton->setEnabled(true);
@@ -622,7 +627,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
       }
 
       mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
       }
 
       mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
-      myViewWindow->highlight( myActor->getIO(), true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( myActor->getIO(), true, true );
       
       if ( myNbOkElements ) {
        if (aListId.count()>1){ 
       
       if ( myNbOkElements ) {
        if (aListId.count()>1){ 
@@ -853,7 +859,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ActivateThisDialog()
   
   mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
 
   
   mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
 
-  myViewWindow->SetSelectionMode( FaceSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( FaceSelection );
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
@@ -982,7 +989,8 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onListSelectionChanged()
   if(isSelected) RemoveButton->setEnabled(true);
   else RemoveButton->setEnabled(false);
   mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, true );
   if(isSelected) RemoveButton->setEnabled(true);
   else RemoveButton->setEnabled(false);
   mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, true );
-  myViewWindow->highlight( myActor->getIO(), true, true );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->highlight( myActor->getIO(), true, true );
   mySelectionMgr->clearFilters(); 
   aList.Append( myActor->getIO() );
   mySelectionMgr->setSelectedObjects( aList );
   mySelectionMgr->clearFilters(); 
   aList.Append( myActor->getIO() );
   mySelectionMgr->setSelectedObjects( aList );
index ba7cf2cc5db04ffb984f9b378e2303514f28afef..8ba99e3ba0bf5bffca385c0dfdfc66c97c56f60e 100644 (file)
@@ -78,7 +78,6 @@ private:
     
     SMESHGUI*                     mySMESHGUI ;              /* Current SMESHGUI object */
     SalomeApp_SelectionMgr*       mySelectionMgr ;             /* User shape selection */
     
     SMESHGUI*                     mySMESHGUI ;              /* Current SMESHGUI object */
     SalomeApp_SelectionMgr*       mySelectionMgr ;             /* User shape selection */
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
     QString                       myIDs;
     int                           myNbOkElements ;            /* to check when elements are defined */
     SVTK_Selector*                mySelector;
     QString                       myIDs;
     int                           myNbOkElements ;            /* to check when elements are defined */
index 838f50877aa42c23aa8f3d9f8ddb43de2af7dc4f..cd6afe1c1989ad2b7835c147510e3aca5adc6abc 100644 (file)
@@ -76,7 +76,6 @@ SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule):
          false,
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
          false,
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-  myViewWindow(SMESH::GetViewWindow(mySMESHGUI)),
   mySMESHGUI(theModule)
 {
   setCaption(tr("CAPTION"));
   mySMESHGUI(theModule)
 {
   setCaption(tr("CAPTION"));
@@ -170,7 +169,8 @@ void SMESHGUI_DeleteGroupDlg::Init ()
 
   // set selection mode
   mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
 
   // set selection mode
   mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   onSelectionDone();
 
   return;
   onSelectionDone();
 
   return;
@@ -235,7 +235,8 @@ void SMESHGUI_DeleteGroupDlg::onOk()
 //=================================================================================
 void SMESHGUI_DeleteGroupDlg::onClose()
 {
 //=================================================================================
 void SMESHGUI_DeleteGroupDlg::onClose()
 {
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
@@ -289,7 +290,8 @@ void SMESHGUI_DeleteGroupDlg::enterEvent (QEvent*)
 {
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
 {
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
 }
 
   mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
 }
 
index b6305bd93c1f141ff69ab5fc6405a6422083ad6c..320f411b563532574a3a390ae69fda42c4e9e1ff 100644 (file)
@@ -86,7 +86,6 @@ private:
   QListBox*               myListBox;
 
   SMESHGUI*               mySMESHGUI;
   QListBox*               myListBox;
 
   SMESHGUI*               mySMESHGUI;
-  SVTK_ViewWindow*        myViewWindow;
   SalomeApp_SelectionMgr* mySelectionMgr;
 
   QValueList<SMESH::SMESH_GroupBase_var> myListGrp;
   SalomeApp_SelectionMgr* mySelectionMgr;
 
   QValueList<SMESH::SMESH_GroupBase_var> myListGrp;
index b65bd3c3e1906f783ea7c6bd00bb8c044f6b0080..3e84be424a3d3c3957d164cdae29aa3ea8ff6ab5 100644 (file)
@@ -97,9 +97,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
      : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionAlongPathDlg", modal,
                 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionAlongPathDlg", modal,
                 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
   QPixmap edgeImage   ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
 {
   SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
   QPixmap edgeImage   ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
@@ -317,6 +315,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
   ZSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
   AngleSpin->RangeStepAndValidator(-999999.999, +999999.999, 5.0, 3);
 
   ZSpin->RangeStepAndValidator(-999999.999, +999999.999, 10.0, 3);
   AngleSpin->RangeStepAndValidator(-999999.999, +999999.999, 5.0, 3);
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   mySMESHGUI->SetActiveDialogBox(this);
 
   // Costruction of the logical filter for the elements: mesh/sub-mesh/group
   mySMESHGUI->SetActiveDialogBox(this);
 
   // Costruction of the logical filter for the elements: mesh/sub-mesh/group
@@ -448,13 +448,20 @@ void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
 
     SMESH::SetPointRepresentation(false);
     if (MeshCheck->isChecked()) {
 
     SMESH::SetPointRepresentation(false);
     if (MeshCheck->isChecked()) {
-      myViewWindow->SetSelectionMode(ActorSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myElementsFilter);
     } else {
       if (type == 0)
       mySelectionMgr->installFilter(myElementsFilter);
     } else {
       if (type == 0)
-        myViewWindow->SetSelectionMode(EdgeSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(EdgeSelection);
+       }
       if (type == 1)
       if (type == 1)
-        myViewWindow->SetSelectionMode(FaceSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(FaceSelection);
+       }
     }
   }
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
     }
   }
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@@ -660,7 +667,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::reject()
   mySelectionMgr->clearSelected();
   SMESH::SetPickable(); // ???
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearSelected();
   SMESH::SetPickable(); // ???
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
   QDialog::reject();
 }
   mySMESHGUI->ResetState();
   QDialog::reject();
 }
@@ -713,7 +721,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
        }
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
        }
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
-      myViewWindow->highlight( anIO, true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( anIO, true, true );
     }
   } else if (send == StartPointLineEdit &&
              myEditCurrentArgument == StartPointLineEdit) {
     }
   } else if (send == StartPointLineEdit &&
              myEditCurrentArgument == StartPointLineEdit) {
@@ -738,7 +747,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
             TColStd_MapOfInteger newIndices;
            newIndices.Add(n->GetID());
            mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
             TColStd_MapOfInteger newIndices;
            newIndices.Add(n->GetID());
            mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
-           myViewWindow->highlight( aPathActor->getIO(), true, true );
+           if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+             aViewWindow->highlight( aPathActor->getIO(), true, true );
          }
        }
       }
          }
        }
       }
@@ -940,24 +950,33 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
     myEditCurrentArgument = ElementsLineEdit;
     SMESH::SetPointRepresentation(false);
     if (MeshCheck->isChecked()) {
     myEditCurrentArgument = ElementsLineEdit;
     SMESH::SetPointRepresentation(false);
     if (MeshCheck->isChecked()) {
-      myViewWindow->SetSelectionMode(ActorSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myElementsFilter);
     } else {
       if (Elements1dRB->isChecked())
       mySelectionMgr->installFilter(myElementsFilter);
     } else {
       if (Elements1dRB->isChecked())
-       myViewWindow->SetSelectionMode(EdgeSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(EdgeSelection);
+       }
       else if (Elements2dRB->isChecked())
       else if (Elements2dRB->isChecked())
-       myViewWindow->SetSelectionMode(FaceSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(FaceSelection);
+       }
     }
   } else if (button == SelectPathMeshButton) {
     myEditCurrentArgument = PathMeshLineEdit;
     SMESH::SetPointRepresentation(false);
     }
   } else if (button == SelectPathMeshButton) {
     myEditCurrentArgument = PathMeshLineEdit;
     SMESH::SetPointRepresentation(false);
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myPathMeshFilter);
   }
   else if (button == SelectPathShapeButton) {
     myEditCurrentArgument = PathShapeLineEdit;
     SMESH::SetPointRepresentation(false);
     mySelectionMgr->installFilter(myPathMeshFilter);
   }
   else if (button == SelectPathShapeButton) {
     myEditCurrentArgument = PathShapeLineEdit;
     SMESH::SetPointRepresentation(false);
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
 
     if (!myPathMesh->_is_nil()) {
       GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
 
     if (!myPathMesh->_is_nil()) {
       GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
@@ -975,7 +994,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
       SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
       if (aPathActor) {
        SMESH::SetPointRepresentation(true);
       SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
       if (aPathActor) {
        SMESH::SetPointRepresentation(true);
-       myViewWindow->SetSelectionMode(NodeSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(NodeSelection);
        SMESH::SetPickable(aPathActor);
       }
     }
        SMESH::SetPickable(aPathActor);
       }
     }
@@ -983,7 +1003,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
   else if (button == SelectBasePointButton) {
     myEditCurrentArgument = XSpin;
     SMESH::SetPointRepresentation(true);
   else if (button == SelectBasePointButton) {
     myEditCurrentArgument = XSpin;
     SMESH::SetPointRepresentation(true);
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
 
     SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter(MESHorSUBMESH);
     SMESH_TypeFilter* aSmeshGroupFilter    = new SMESH_TypeFilter(GROUP);
 
     SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter(MESHorSUBMESH);
     SMESH_TypeFilter* aSmeshGroupFilter    = new SMESH_TypeFilter(GROUP);
index 4b70c5ed8f365485a4ecd9cf3a41f7b87076aefd..91ba5084c74f96f4238097420720dff5bead94f3 100644 (file)
@@ -88,7 +88,6 @@ private:
 
   SMESHGUI*                     mySMESHGUI;            /* Current SMESHGUI object */
   SalomeApp_SelectionMgr*       mySelectionMgr;        /* User shape selection */
 
   SMESHGUI*                     mySMESHGUI;            /* Current SMESHGUI object */
   SalomeApp_SelectionMgr*       mySelectionMgr;        /* User shape selection */
-  SVTK_ViewWindow*              myViewWindow;
   SVTK_Selector*                mySelector;
 
   QWidget*                      myEditCurrentArgument; /* Current  argument */
   SVTK_Selector*                mySelector;
 
   QWidget*                      myEditCurrentArgument; /* Current  argument */
index b5df5cc9442e274db537c266c71553c215e21624..d163eb0d8b0b4d6c826396ea9f4d982c36ad1994 100644 (file)
@@ -88,9 +88,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
      : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionDlg", modal, WStyle_Customize |
                 WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionDlg", modal, WStyle_Customize |
                 WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
@@ -324,14 +322,20 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
     {
       GroupArguments->setTitle(tr("EXTRUSION_1D"));
       if (!CheckBoxMesh->isChecked())
     {
       GroupArguments->setTitle(tr("EXTRUSION_1D"));
       if (!CheckBoxMesh->isChecked())
-        myViewWindow->SetSelectionMode(EdgeSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(EdgeSelection);
+       }
       break;
     }
   case 1:
     {
       GroupArguments->setTitle(tr("EXTRUSION_2D"));
       if (!CheckBoxMesh->isChecked())
       break;
     }
   case 1:
     {
       GroupArguments->setTitle(tr("EXTRUSION_2D"));
       if (!CheckBoxMesh->isChecked())
-        myViewWindow->SetSelectionMode(FaceSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(FaceSelection);
+       }
       break;
     }
   }
       break;
     }
   }
@@ -407,7 +411,8 @@ void SMESHGUI_ExtrusionDlg::ClickOnCancel()
   mySelectionMgr->clearSelected();
   SMESH::SetPickable(); // ???
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearSelected();
   SMESH::SetPickable(); // ???
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
   reject();
 }
   mySMESHGUI->ResetState();
   reject();
 }
@@ -450,7 +455,8 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
        myNbOkElements++;
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
        myNbOkElements++;
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
-      myViewWindow->highlight( anIO, true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( anIO, true, true );
       myElementsId = theNewText;
     }
   }
       myElementsId = theNewText;
     }
   }
@@ -608,14 +614,21 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument()
   if (send == SelectElementsButton) {
     myEditCurrentArgument = LineEditElements;
     if (CheckBoxMesh->isChecked()) {
   if (send == SelectElementsButton) {
     myEditCurrentArgument = LineEditElements;
     if (CheckBoxMesh->isChecked()) {
-      myViewWindow->SetSelectionMode(ActorSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       int aConstructorId = GetConstructorId();
       if (aConstructorId == 0)
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       int aConstructorId = GetConstructorId();
       if (aConstructorId == 0)
-        myViewWindow->SetSelectionMode(EdgeSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(EdgeSelection);
+       }
       else if (aConstructorId == 1)
       else if (aConstructorId == 1)
-        myViewWindow->SetSelectionMode(FaceSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(FaceSelection);
+       }
     }
   }
 
     }
   }
 
@@ -706,15 +719,22 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
   mySelectionMgr->clearFilters();
 
   if (toSelectMesh) {
   mySelectionMgr->clearFilters();
 
   if (toSelectMesh) {
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     int aConstructorId = GetConstructorId();
     if (aConstructorId == 0)
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     int aConstructorId = GetConstructorId();
     if (aConstructorId == 0)
-      myViewWindow->SetSelectionMode(EdgeSelection);
+      {
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(EdgeSelection);
+      }
     else if (aConstructorId == 0)
     else if (aConstructorId == 0)
-      myViewWindow->SetSelectionMode(FaceSelection);
+      {
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(FaceSelection);
+      }
 
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
 
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
index ab086e5b1e64355afe3c4ee094b4a86d6cd76fc4..cebdaefb78232321cd01d818f8b733df4e35c146 100644 (file)
@@ -80,7 +80,6 @@ private:
   QLineEdit*                    myEditCurrentArgument; /* Current  LineEdit */
   QString                       myElementsId;
   int                           myNbOkElements;        /* to check when elements are defined */
   QLineEdit*                    myEditCurrentArgument; /* Current  LineEdit */
   QString                       myElementsId;
   int                           myNbOkElements;        /* to check when elements are defined */
-  SVTK_ViewWindow*              myViewWindow;
   SVTK_Selector*                mySelector;
 
   bool                          myBusy;
   SVTK_Selector*                mySelector;
 
   bool                          myBusy;
index f1b72a35e62a8c7a8b312c57f9c7e19a162acf20..49d6ff7958aef493981cf9e0bbc59d007e455ea7 100755 (executable)
@@ -1604,10 +1604,11 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI*              theModule,
 : QDialog( SMESH::GetDesktop( theModule ), theName, false,
            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
      mySMESHGUI( theModule ),
 : QDialog( SMESH::GetDesktop( theModule ), theName, false,
            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
 {
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    mySelector = aViewWindow->GetSelector();
+  
   construct(theTypes);
 }
 
   construct(theTypes);
 }
 
@@ -1623,8 +1624,8 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI*   theModule,
      mySMESHGUI( theModule ),
      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
      mySMESHGUI( theModule ),
      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
-  myViewWindow = SMESH::GetViewWindow( theModule );
-  mySelector = myViewWindow->GetSelector();
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    mySelector = aViewWindow->GetSelector();
   QValueList<int> aTypes;
   aTypes.append(theType);
   construct(aTypes);
   QValueList<int> aTypes;
   aTypes.append(theType);
   construct(aTypes);
@@ -1885,7 +1886,8 @@ void SMESHGUI_FilterDlg::onClose()
         aResMap.Add(anIndMap(i));
 
       mySelector->AddOrRemoveIndex( anIter.Key(), aResMap, false);
         aResMap.Add(anIndMap(i));
 
       mySelector->AddOrRemoveIndex( anIter.Key(), aResMap, false);
-      myViewWindow->highlight( anIter.Key(), true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( anIter.Key(), true, true );
     }
     mySelectionMgr->setSelectedObjects(aList, false);
   }
     }
     mySelectionMgr->setSelectedObjects(aList, false);
   }
@@ -2361,12 +2363,13 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QValueList<int
 
   // Set new selection mode if necessary
   Selection_Mode aSelMode = getSelMode(theType);
 
   // Set new selection mode if necessary
   Selection_Mode aSelMode = getSelMode(theType);
-  if (myViewWindow->SelectionMode()!=aSelMode) {
+  SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+  if ( aViewWindow && aViewWindow->SelectionMode()!=aSelMode) {
     mySelectionMgr->clearSelected();
     mySelectionMgr->clearFilters();
     if (aSelMode == NodeSelection)
       SMESH::SetPointRepresentation(true);
     mySelectionMgr->clearSelected();
     mySelectionMgr->clearFilters();
     if (aSelMode == NodeSelection)
       SMESH::SetPointRepresentation(true);
-    myViewWindow->SetSelectionMode(aSelMode);
+    aViewWindow->SetSelectionMode(aSelMode);
   }
 
   // Clear selection
   }
 
   // Clear selection
@@ -2399,7 +2402,8 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QValueList<int
 
   // Set new selection
   mySelector->AddOrRemoveIndex(anIO, aMap, false);
 
   // Set new selection
   mySelector->AddOrRemoveIndex(anIO, aMap, false);
-  myViewWindow->highlight( anIO, true, true );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->highlight( anIO, true, true );
 
   // insert previously stored filter in viewer if necessary
   if (!aFilter.IsNull())
 
   // insert previously stored filter in viewer if necessary
   if (!aFilter.IsNull())
index 8cb544484085a0b42049c6cf173fb4295309fd4f..7427fe7be1ed296af42b299e150602fac76e2424 100755 (executable)
@@ -293,7 +293,6 @@ private:
   SMESHGUI*                 mySMESHGUI;
   SalomeApp_SelectionMgr*   mySelectionMgr;
   SVTK_Selector*            mySelector;
   SMESHGUI*                 mySMESHGUI;
   SalomeApp_SelectionMgr*   mySelectionMgr;
   SVTK_Selector*            mySelector;
-  SVTK_ViewWindow*          myViewWindow;
   SMESH::SMESH_Mesh_ptr     myMesh;
   QWidget*                  mySourceWg;
 
   SMESH::SMESH_Mesh_ptr     myMesh;
   QWidget*                  mySourceWg;
 
index 25ecdabccecc76348254f05c5c62cf497ee74a9a..2a73bc99384abc66433bf321ce3514d48a7cee34 100644 (file)
@@ -89,8 +89,6 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
                 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
      mySMESHGUI( theModule ),
      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
                 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
      mySMESHGUI( theModule ),
      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() ),
      myIsBusy( false ),
      myActor( 0 )
 {
      myIsBusy( false ),
      myActor( 0 )
 {
@@ -105,6 +103,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
     myGeomGroupLine->setEnabled(false);
   }
 
     myGeomGroupLine->setEnabled(false);
   }
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   /* Move widget on the botton right corner of main widget */
   int x, y ;
   mySMESHGUI->DefineDlgPosition(this, x, y);
   /* Move widget on the botton right corner of main widget */
   int x, y ;
   mySMESHGUI->DefineDlgPosition(this, x, y);
@@ -121,8 +121,6 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
                 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
      mySMESHGUI( theModule ),
      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
                 WStyle_Title | WStyle_SysMenu | WDestructiveClose),
      mySMESHGUI( theModule ),
      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() ),
      myIsBusy( false )
 {
   if (!name) setName("SMESHGUI_GroupDlg");
      myIsBusy( false )
 {
   if (!name) setName("SMESHGUI_GroupDlg");
@@ -134,6 +132,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
     mySelectGroup->setEnabled(false);
   }
 
     mySelectGroup->setEnabled(false);
   }
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   /* Move widget on the botton right corner of main widget */
   int x, y ;
   mySMESHGUI->DefineDlgPosition(this, x, y);
   /* Move widget on the botton right corner of main widget */
   int x, y ;
   mySMESHGUI->DefineDlgPosition(this, x, y);
@@ -543,19 +543,24 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
           myActor->SetPointRepresentation(true);
         else
           SMESH::SetPointRepresentation(true);
           myActor->SetPointRepresentation(true);
         else
           SMESH::SetPointRepresentation(true);
-       myViewWindow->SetSelectionMode(NodeSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(NodeSelection);
        break;
       case 1:
        break;
       case 1:
-       myViewWindow->SetSelectionMode(EdgeSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(EdgeSelection);
        break;
       case 2:
        break;
       case 2:
-       myViewWindow->SetSelectionMode(FaceSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(FaceSelection);
        break;
       default:
        break;
       default:
-        myViewWindow->SetSelectionMode(VolumeSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(VolumeSelection);
       }
     } else {
       }
     } else {
-      myViewWindow->SetSelectionMode(ActorSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(ActorSelection);
       if (theMode == 4)
        mySelectionMgr->installFilter(mySubMeshFilter);
       else if (theMode == 5)
       if (theMode == 4)
        mySelectionMgr->installFilter(mySubMeshFilter);
       else if (theMode == 5)
@@ -707,7 +712,8 @@ void SMESHGUI_GroupDlg::onListSelectionChanged()
     SALOME_ListIO aList;
     aList.Append(myActor->getIO());
     mySelectionMgr->setSelectedObjects(aList,false);
     SALOME_ListIO aList;
     aList.Append(myActor->getIO());
     mySelectionMgr->setSelectedObjects(aList,false);
-    myViewWindow->highlight( myActor->getIO(), true, true );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->highlight( myActor->getIO(), true, true );
   }
   myIsBusy = false;
 }
   }
   myIsBusy = false;
 }
@@ -1392,7 +1398,8 @@ void SMESHGUI_GroupDlg::onClose()
   }
 
   mySelectionMgr->clearSelected();
   }
 
   mySelectionMgr->clearSelected();
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->clearFilters();
   mySMESHGUI->ResetState();
 
   mySelectionMgr->clearFilters();
   mySMESHGUI->ResetState();
 
index c01482e972680b1b2c076e5473112603455090b5..112738099a4d6009baf7118abe6532e04bd8145e 100644 (file)
@@ -119,7 +119,6 @@ private:
     int                           myGrpTypeId; /* Current group type id : standalone or group on geometry */
     int                           myTypeId;                /* Current type id = radio button id */
     QLineEdit*                    myCurrentLineEdit;       /* Current  LineEdit */
     int                           myGrpTypeId; /* Current group type id : standalone or group on geometry */
     int                           myTypeId;                /* Current type id = radio button id */
     QLineEdit*                    myCurrentLineEdit;       /* Current  LineEdit */
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
 
     QPushButton*                  myMeshGroupBtn;
     SVTK_Selector*                mySelector;
 
     QPushButton*                  myMeshGroupBtn;
index 7c15603ed475c5a8a4d71d09d970e1891f1e0261..5cff77713d51db9abd158bd4c9a069f8f96a5293 100644 (file)
@@ -68,9 +68,7 @@ SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode
      : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_GroupOpDlg", false,
                 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_GroupOpDlg", false,
                 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   myMode = theMode;
 
 {
   myMode = theMode;
 
@@ -78,6 +76,8 @@ SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode
   else if (myMode == INTERSECT) setCaption(tr("INTERSECTION_OF_TWO_GROUPS"));
   else setCaption(tr("CUT_OF_TWO_GROUPS"));
 
   else if (myMode == INTERSECT) setCaption(tr("INTERSECTION_OF_TWO_GROUPS"));
   else setCaption(tr("CUT_OF_TWO_GROUPS"));
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
 
   QFrame* aMainFrame = createMainFrame  (this);
   QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
 
   QFrame* aMainFrame = createMainFrame  (this);
@@ -191,7 +191,8 @@ void SMESHGUI_GroupOpDlg::Init()
   this->show();
 
   // set selection mode
   this->show();
 
   // set selection mode
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
 
   return;
   mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
 
   return;
@@ -284,7 +285,8 @@ void SMESHGUI_GroupOpDlg::onOk()
 //=======================================================================
 void SMESHGUI_GroupOpDlg::onClose()
 {
 //=======================================================================
 void SMESHGUI_GroupOpDlg::onClose()
 {
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
@@ -343,7 +345,8 @@ void SMESHGUI_GroupOpDlg::enterEvent (QEvent*)
 {
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
 {
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
 }
 
   mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
 }
 
index e04b02fde0fa88cf429a84fc478d2d1bb58d0399..774455d4ee03c9bf04539421af687687c556a28f 100644 (file)
@@ -97,7 +97,6 @@ private:
   SMESHGUI*                 mySMESHGUI;
   SalomeApp_SelectionMgr*   mySelectionMgr;
   int                       myMode;
   SMESHGUI*                 mySMESHGUI;
   SalomeApp_SelectionMgr*   mySelectionMgr;
   int                       myMode;
-  SVTK_ViewWindow*          myViewWindow;
   SVTK_Selector*            mySelector;
   
   QLineEdit*                myFocusWg;
   SVTK_Selector*            mySelector;
   
   QLineEdit*                myFocusWg;
index 7ad8ccbe4c1f9bae6709c3e479afbe2ddad5d021..e297b635c86841ff6f4d027038bd00db56066004 100644 (file)
@@ -79,9 +79,7 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@@ -247,6 +245,8 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
 
   myActor = 0;
 
 
   myActor = 0;
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
@@ -356,7 +356,8 @@ void SMESHGUI_MergeNodesDlg::ClickOnCancel()
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
@@ -388,7 +389,8 @@ void SMESHGUI_MergeNodesDlg::updateControls()
 {
   if (ListCoincident->childCount() < 1) {
     SMESH::SetPointRepresentation(false);
 {
   if (ListCoincident->childCount() < 1) {
     SMESH::SetPointRepresentation(false);
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     return;
   }
 
     return;
   }
 
@@ -476,7 +478,8 @@ void SMESHGUI_MergeNodesDlg::onSelectNodesGroup()
   mySelectionMgr->setSelectedObjects(aList, false);
 
   SMESH::SetPointRepresentation(true);
   mySelectionMgr->setSelectedObjects(aList, false);
 
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   ListEdit->selectAll(true);
 }
 
   ListEdit->selectAll(true);
 }
@@ -590,7 +593,8 @@ void SMESHGUI_MergeNodesDlg::SetEditCurrentArgument()
   if (send == SelectMeshButton) {
     myEditCurrentArgument = (QWidget*)LineEditMesh;
     SMESH::SetPointRepresentation(false);
   if (send == SelectMeshButton) {
     myEditCurrentArgument = (QWidget*)LineEditMesh;
     SMESH::SetPointRepresentation(false);
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myMeshOrSubMeshFilter);
   }
 
     mySelectionMgr->installFilter(myMeshOrSubMeshFilter);
   }
 
index b679a94f060633bd44a94133d967ce9addaaef5c..3eaf68acbe3e59dba7f0ab04d03ff00cf1377ba7 100644 (file)
@@ -83,7 +83,6 @@ private:
 
     SMESHGUI*                     mySMESHGUI;               /* Current SMESHGUI object */
     SalomeApp_SelectionMgr*       mySelectionMgr;           /* User shape selection */
 
     SMESHGUI*                     mySMESHGUI;               /* Current SMESHGUI object */
     SalomeApp_SelectionMgr*       mySelectionMgr;           /* User shape selection */
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;
index ecd3c522ac29a48bcae2caa1265538f86eee1a42..f040d82a14c2c26aac834714173a6aa1c7a12c60 100755 (executable)
@@ -110,9 +110,7 @@ SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI*   theModule,
                 WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
        myBusy(false),
        mySMESHGUI( theModule ),
                 WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
        myBusy(false),
        mySMESHGUI( theModule ),
-       mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-       myViewWindow( SMESH::GetViewWindow( theModule ) ),
-       mySelector( myViewWindow->GetSelector() )
+       mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   setCaption(tr("CAPTION"));
 
 {
   setCaption(tr("CAPTION"));
 
@@ -127,6 +125,9 @@ SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI*   theModule,
   aDlgLay->setStretchFactor(aMainFrame, 1);
 
   myCreationDlg = 0;
   aDlgLay->setStretchFactor(aMainFrame, 1);
 
   myCreationDlg = 0;
+
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+  
   Init();
 }
 
   Init();
 }
 
@@ -462,7 +463,8 @@ void SMESHGUI_MeshPatternDlg::onClose()
 {
   mySelectionMgr->clearFilters();
   SMESH::SetPickable();
 {
   mySelectionMgr->clearFilters();
   SMESH::SetPickable();
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
@@ -963,14 +965,21 @@ void SMESHGUI_MeshPatternDlg::activateSelection()
       SMESH::SetPickable(anActor);
 
     if (myType == Type_2d)
       SMESH::SetPickable(anActor);
 
     if (myType == Type_2d)
-      myViewWindow->SetSelectionMode(FaceSelection);
+      {
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(FaceSelection);
+      }
     else
     else
-      myViewWindow->SetSelectionMode(CellSelection);
+      {
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(CellSelection);
+      }
   }
   else {
     SMESH::SetPickable();
     //mySelectionMgr->setSelectionModes(ActorSelection);
   }
   else {
     SMESH::SetPickable();
     //mySelectionMgr->setSelectionModes(ActorSelection);
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
   }
 
   if (mySelInput == Object && !myMeshShape->_is_nil()) {
   }
 
   if (mySelInput == Object && !myMeshShape->_is_nil()) {
@@ -1265,7 +1274,8 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
        newIndices.Add(e->GetID());
     }
     mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
        newIndices.Add(e->GetID());
     }
     mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
-    myViewWindow->highlight( anActor->getIO(), true, true );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->highlight( anActor->getIO(), true, true );
   }
 
   myBusy = false;
   }
 
   myBusy = false;
index b1cf5b9d7c6938dbd5df16db257d2ce7633f7606..c09ab443c1316808b8980d95a38a9eb160e91a23 100755 (executable)
@@ -156,7 +156,6 @@ private:
   QCheckBox*                          myPreviewChk;
 
   SMESHGUI*                           mySMESHGUI;
   QCheckBox*                          myPreviewChk;
 
   SMESHGUI*                           mySMESHGUI;
-  SVTK_ViewWindow*                    myViewWindow;
   SVTK_Selector*                      mySelector;
   SalomeApp_SelectionMgr*             mySelectionMgr;
   int                                 mySelInput;
   SVTK_Selector*                      mySelector;
   SalomeApp_SelectionMgr*             mySelectionMgr;
   int                                 mySelInput;
index f249535c87a3e4a6521ab88218941b9aa069233b..944a6d2a9e74540a3696813584dc4563d006c4e5 100644 (file)
@@ -93,9 +93,7 @@ SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule,
          theName, 
          false,
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
          theName, 
          false,
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
-  mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-  myViewWindow(SMESH::GetViewWindow(theModule)),
   mySMESHGUI(theModule)
 {
   myPreviewActor = 0;
   mySMESHGUI(theModule)
 {
   myPreviewActor = 0;
@@ -113,6 +111,8 @@ SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule,
 
   aDlgLay->setStretchFactor(aMainFrame, 1);
 
 
   aDlgLay->setStretchFactor(aMainFrame, 1);
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   Init();
 }
 
   Init();
 }
 
@@ -230,7 +230,8 @@ void SMESHGUI_MoveNodesDlg::Init()
 
   // set selection mode
   SMESH::SetPointRepresentation(true);
 
   // set selection mode
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   onSelectionDone();
 }
 
   onSelectionDone();
 }
@@ -323,7 +324,8 @@ void SMESHGUI_MoveNodesDlg::onClose()
 {
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
 {
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
@@ -356,7 +358,8 @@ void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
        TColStd_MapOfInteger aListInd;
        aListInd.Add(anElem->GetID());
        mySelector->AddOrRemoveIndex(anIO,aListInd, false);
        TColStd_MapOfInteger aListInd;
        aListInd.Add(anElem->GetID());
        mySelector->AddOrRemoveIndex(anIO,aListInd, false);
-       myViewWindow->highlight(anIO,true,true);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->highlight(anIO,true,true);
        
        onSelectionDone();
       }
        
        onSelectionDone();
       }
@@ -423,7 +426,8 @@ void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
 
     // set selection mode
     SMESH::SetPointRepresentation(true);
 
     // set selection mode
     SMESH::SetPointRepresentation(true);
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
 
     redisplayPreview();
 
 
     redisplayPreview();
 
@@ -438,7 +442,8 @@ void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
 void SMESHGUI_MoveNodesDlg::closeEvent (QCloseEvent*)
 {
   onClose();
 void SMESHGUI_MoveNodesDlg::closeEvent (QCloseEvent*)
 {
   onClose();
-  myViewWindow->Repaint();
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->Repaint();
 }
 
 //=======================================================================
 }
 
 //=======================================================================
@@ -471,10 +476,13 @@ void  SMESHGUI_MoveNodesDlg::erasePreview()
   if (myPreviewActor == 0)
     return;
 
   if (myPreviewActor == 0)
     return;
 
-  myViewWindow->RemoveActor(myPreviewActor);
+  SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+  if (aViewWindow)
+    aViewWindow->RemoveActor(myPreviewActor);
   myPreviewActor->Delete();
   myPreviewActor = 0;
   myPreviewActor->Delete();
   myPreviewActor = 0;
-  myViewWindow->Repaint();
+  if (aViewWindow)
+    aViewWindow->Repaint();
 }
 
 //=======================================================================
 }
 
 //=======================================================================
@@ -548,6 +556,9 @@ void SMESHGUI_MoveNodesDlg::redisplayPreview()
   myPreviewActor->SetProperty(aProp);
   aProp->Delete();
 
   myPreviewActor->SetProperty(aProp);
   aProp->Delete();
 
-  myViewWindow->AddActor(myPreviewActor);
-  myViewWindow->Repaint();
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    {
+      aViewWindow->AddActor(myPreviewActor);
+      aViewWindow->Repaint();
+    }
 }
 }
index 4163c542126b0a1eaf5f700a03182b5292fc9793..aa4d51d96655673b70241b136673cb1b4af8e5ed 100644 (file)
@@ -97,7 +97,6 @@ private:
   SMESHGUI_SpinBox*             myZ;
 
   SalomeApp_SelectionMgr*       mySelectionMgr;
   SMESHGUI_SpinBox*             myZ;
 
   SalomeApp_SelectionMgr*       mySelectionMgr;
-  SVTK_ViewWindow*              myViewWindow;
   SVTK_Selector*                mySelector;
   SMESHGUI*                     mySMESHGUI;
   
   SVTK_Selector*                mySelector;
   SMESHGUI*                     mySMESHGUI;
   
index d2fd9fefb96a4ff2f7bcd8d48d3999bdb35fd434..a773c49ac47daf45295a070b7a8141fd1ff57e47 100755 (executable)
@@ -111,7 +111,6 @@ SMESHGUI_MultiEditDlg
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-    myViewWindow(SMESH::GetViewWindow(theModule)),
     mySMESHGUI(theModule)
 {
   myFilterDlg = 0;
     mySMESHGUI(theModule)
 {
   myFilterDlg = 0;
@@ -372,7 +371,8 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds()
 //=======================================================================
 void SMESHGUI_MultiEditDlg::onClose()
 {
 //=======================================================================
 void SMESHGUI_MultiEditDlg::onClose()
 {
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySMESHGUI->ResetState();
@@ -762,7 +762,8 @@ void SMESHGUI_MultiEditDlg::onListSelectionChanged()
   }
 
   mySelector->AddOrRemoveIndex(anActor->getIO(),anIndexes,false);
   }
 
   mySelector->AddOrRemoveIndex(anActor->getIO(),anIndexes,false);
-  myViewWindow->highlight(anActor->getIO(),true,true);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->highlight(anActor->getIO(),true,true);
 }
 
 //=======================================================================
 }
 
 //=======================================================================
@@ -833,19 +834,23 @@ void SMESHGUI_MultiEditDlg::setSelectionMode()
   mySelectionMgr->clearFilters();
 
   if (mySubmeshChk->isChecked()) {
   mySelectionMgr->clearFilters();
 
   if (mySubmeshChk->isChecked()) {
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(new SMESH_TypeFilter(SUBMESH));
   }
   else if (myGroupChk->isChecked()) {
     mySelectionMgr->installFilter(new SMESH_TypeFilter(SUBMESH));
   }
   else if (myGroupChk->isChecked()) {
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
   }
 
   if (entityType()) {
     mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
   }
 
   if (entityType()) {
-    myViewWindow->SetSelectionMode(VolumeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(VolumeSelection);
     SMESH::SetFilter(new SMESHGUI_VolumesFilter());
   } else {
     SMESH::SetFilter(new SMESHGUI_VolumesFilter());
   } else {
-    myViewWindow->SetSelectionMode(FaceSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(FaceSelection);
     if (myFilterType == SMESHGUI_TriaFilter)
       SMESH::SetFilter(new SMESHGUI_TriangleFilter());
     else if (myFilterType == SMESHGUI_QuadFilter)
     if (myFilterType == SMESHGUI_TriaFilter)
       SMESH::SetFilter(new SMESHGUI_TriangleFilter());
     else if (myFilterType == SMESHGUI_QuadFilter)
index 3a5558fe14e5ffbb8ac93a018894cd1efc6fc24a..09134549338501707bdb0cc7ea885e0d0fd8d8e7 100755 (executable)
@@ -124,7 +124,6 @@ protected:
   SMESH::SMESH_Mesh_var     myMesh;
   
   SalomeApp_SelectionMgr*   mySelectionMgr;
   SMESH::SMESH_Mesh_var     myMesh;
   
   SalomeApp_SelectionMgr*   mySelectionMgr;
-  SVTK_ViewWindow*          myViewWindow;
   SVTK_Selector*            mySelector;
   SMESHGUI*                 mySMESHGUI;
 
   SVTK_Selector*            mySelector;
   SMESHGUI*                 mySMESHGUI;
 
index 47e8f82c2a554187a58180597899e548b2f1fe96..3f20596c5afcc88d9693e344c939456d0a73d884 100644 (file)
@@ -230,10 +230,9 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
   mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
   mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-  myViewWindow(SMESH::GetViewWindow(theModule)),
   mySMESHGUI(theModule)
 {
   mySMESHGUI(theModule)
 {
-  mySimulation = new SMESH::TNodeSimulation(myViewWindow);
+  mySimulation = new SMESH::TNodeSimulation(SMESH::GetViewWindow( mySMESHGUI ));
 
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
   if (!name)
 
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
   if (!name)
@@ -382,7 +381,8 @@ void SMESHGUI_NodesDlg::Init ()
 
   // set selection mode
   SMESH::SetPointRepresentation(true);
 
   // set selection mode
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
@@ -468,7 +468,8 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
 void SMESHGUI_NodesDlg::ClickOnCancel()
 {
   disconnect(mySelectionMgr, 0, this, 0);
 void SMESHGUI_NodesDlg::ClickOnCancel()
 {
   disconnect(mySelectionMgr, 0, this, 0);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
 
   mySimulation->SetVisibility(false);
   SMESH::SetPointRepresentation(false);
 
   mySimulation->SetVisibility(false);
   SMESH::SetPointRepresentation(false);
@@ -571,7 +572,8 @@ void SMESHGUI_NodesDlg::ActivateThisDialog()
   GroupButtons->setEnabled(true);
 
   SMESH::SetPointRepresentation(true);
   GroupButtons->setEnabled(true);
 
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
index 0a64f964f2df3b1af9200714beb291fdea2c26de..e7da8a68631df014c59333bcb8daad6beb99a963 100644 (file)
@@ -75,7 +75,6 @@ public:
 
 private:
     SalomeApp_SelectionMgr* mySelectionMgr;
 
 private:
     SalomeApp_SelectionMgr* mySelectionMgr;
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
     SMESHGUI*               mySMESHGUI;
 
     SVTK_Selector*                mySelector;
     SMESHGUI*               mySMESHGUI;
 
index baf1814d25bf1c28f332e06d684c2ea1d99713ea..16529726e7d9342c6f2780ce67137bcb1d26b06e 100644 (file)
@@ -82,7 +82,6 @@ SMESHGUI_RemoveElementsDlg
            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-    myViewWindow(SMESH::GetViewWindow(theModule)),
     mySMESHGUI(theModule),
     myBusy(false)
 {
     mySMESHGUI(theModule),
     myBusy(false)
 {
@@ -225,7 +224,8 @@ void SMESHGUI_RemoveElementsDlg::Init()
   this->move(x, y);
   this->show(); /* displays Dialog */
 
   this->move(x, y);
   this->show(); /* displays Dialog */
 
-  myViewWindow->SetSelectionMode(CellSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(CellSelection);
 
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
@@ -286,7 +286,8 @@ void SMESHGUI_RemoveElementsDlg::ClickOnOk()
 void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
 {
   mySelectionMgr->clearSelected();
 void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
 {
   mySelectionMgr->clearSelected();
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
@@ -324,7 +325,8 @@ void SMESHGUI_RemoveElementsDlg::onTextChange (const QString& theNewText)
       }
       
       mySelector->AddOrRemoveIndex(anIO,newIndices,false);
       }
       
       mySelector->AddOrRemoveIndex(anIO,newIndices,false);
-      myViewWindow->highlight(anIO,true,true);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight(anIO,true,true);
     }
   }
   
     }
   }
   
@@ -446,7 +448,8 @@ void SMESHGUI_RemoveElementsDlg::ActivateThisDialog()
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ??
 
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ??
 
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   SelectionIntoArgument(); // ??
 }
 
   SelectionIntoArgument(); // ??
 }
index e112f65f115dbdf6a919a656605a9f3dd9beaf62..4c9b62b1ba238ccc6cfcde99de146394125c3ff9 100644 (file)
@@ -77,7 +77,6 @@ private:
     void hideEvent ( QHideEvent * );                        /* ESC key */
 
     SalomeApp_SelectionMgr*       mySelectionMgr;
     void hideEvent ( QHideEvent * );                        /* ESC key */
 
     SalomeApp_SelectionMgr*       mySelectionMgr;
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
     SMESHGUI*                     mySMESHGUI;
 
     SVTK_Selector*                mySelector;
     SMESHGUI*                     mySMESHGUI;
 
index 7e913dbd5a84473bf51cfc0ab25ee90a028c5ebb..5e9261eb11e82fd71b547028b4017aa757b7435f 100644 (file)
@@ -82,7 +82,6 @@ SMESHGUI_RemoveNodesDlg
            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-    myViewWindow(SMESH::GetViewWindow(theModule)),
     mySMESHGUI(theModule),
     myBusy(false)
 {
     mySMESHGUI(theModule),
     myBusy(false)
 {
@@ -226,7 +225,9 @@ void SMESHGUI_RemoveNodesDlg::Init()
   this->show(); /* displays Dialog */
 
   SMESH::SetPointRepresentation(true);
   this->show(); /* displays Dialog */
 
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
@@ -289,7 +290,8 @@ void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
 {
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
 {
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
@@ -325,7 +327,8 @@ void SMESHGUI_RemoveNodesDlg::onTextChange (const QString& theNewText)
       }
 
       mySelector->AddOrRemoveIndex(anIO,newIndices,false);
       }
 
       mySelector->AddOrRemoveIndex(anIO,newIndices,false);
-      myViewWindow->highlight(anIO,true,true);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight(anIO,true,true);
     }
   }
 
     }
   }
 
@@ -448,7 +451,8 @@ void SMESHGUI_RemoveNodesDlg::ActivateThisDialog()
   mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ??
 
   SMESH::SetPointRepresentation(true);
   mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ??
 
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   SelectionIntoArgument(); // ??
 }
 
   SelectionIntoArgument(); // ??
 }
index 6a847e2cf544b617ffeb13fe105eab0c1cddfa2a..e0a89b00d81a372d66ee1afc1b30e8a32d344dba 100644 (file)
@@ -80,7 +80,6 @@ private:
     void hideEvent ( QHideEvent * );                       /* ESC key */
 
     SalomeApp_SelectionMgr*       mySelectionMgr;
     void hideEvent ( QHideEvent * );                       /* ESC key */
 
     SalomeApp_SelectionMgr*       mySelectionMgr;
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
     SMESHGUI*                     mySMESHGUI;
 
     SVTK_Selector*                mySelector;
     SMESHGUI*                     mySMESHGUI;
 
index b2e4615b12e50744f045677b8b420403e8074245..2f15f1882ba0d8de15098351db4472e3709a93e0 100644 (file)
@@ -83,9 +83,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
   QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
 {
   SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
   QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
@@ -298,6 +296,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
   GroupArguments->show();
   RadioButton1->setChecked(TRUE);
 
   GroupArguments->show();
   RadioButton1->setChecked(TRUE);
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
@@ -416,7 +416,10 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
   }
 
   if (!CheckBoxMesh->isChecked())
   }
 
   if (!CheckBoxMesh->isChecked())
-    myViewWindow->SetSelectionMode(aSelMode);
+    {
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(aSelMode);
+    }
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
   LineEditElements->setFocus();
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
   LineEditElements->setFocus();
@@ -493,7 +496,8 @@ void SMESHGUI_RevolutionDlg::ClickOnCancel()
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
   reject();
 }
   mySMESHGUI->ResetState();
   reject();
 }
@@ -536,7 +540,8 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
       }
 
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
       }
 
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
-      myViewWindow->highlight( myActor->getIO(), true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( myActor->getIO(), true, true );
       
       myElementsId = theNewText;
     }
       
       myElementsId = theNewText;
     }
@@ -726,23 +731,32 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
     myEditCurrentArgument = (QWidget*)LineEditElements;
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
     myEditCurrentArgument = (QWidget*)LineEditElements;
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
-      myViewWindow->SetSelectionMode(ActorSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       int aConstructorId = GetConstructorId();
       if (aConstructorId == 0)
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       int aConstructorId = GetConstructorId();
       if (aConstructorId == 0)
-        myViewWindow->SetSelectionMode(EdgeSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(EdgeSelection);
+       }
       else if (aConstructorId == 1)
       else if (aConstructorId == 1)
-        myViewWindow->SetSelectionMode(FaceSelection);
+       {
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(FaceSelection);
+       }
     }
   } else if (send == SelectPointButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_X;
     SMESH::SetPointRepresentation(true);
     }
   } else if (send == SelectPointButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_X;
     SMESH::SetPointRepresentation(true);
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
   } else if (send == SelectVectorButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_DX;
     SMESH::SetPointRepresentation(true);
   } else if (send == SelectVectorButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_DX;
     SMESH::SetPointRepresentation(true);
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
   } else {
   }
 
   } else {
   }
 
@@ -834,15 +848,22 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     int aConstructorId = GetConstructorId();
     if (aConstructorId == 0)
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     int aConstructorId = GetConstructorId();
     if (aConstructorId == 0)
-      myViewWindow->SetSelectionMode(EdgeSelection);
+      {
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(EdgeSelection);
+      }
     else if (aConstructorId == 0)
     else if (aConstructorId == 0)
-      myViewWindow->SetSelectionMode(FaceSelection);
+      {
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(FaceSelection);
+      }
 
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
 
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
index 5e35ea9dac8c9e1c0a979e29d3e368b6f5ce732c..31912fa8a0910c2732bdcf589a1b825fd648b750 100644 (file)
@@ -86,7 +86,6 @@ private:
     int                           myNbOkElements;          /* to check when elements are defined */
     QString                       myElementsId;
     QWidget*                      myEditCurrentArgument;   /* Current  argument */
     int                           myNbOkElements;          /* to check when elements are defined */
     QString                       myElementsId;
     QWidget*                      myEditCurrentArgument;   /* Current  argument */
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
 
     bool                          myBusy;
     SVTK_Selector*                mySelector;
 
     bool                          myBusy;
index cb43bf86c40c39746d46e857bc389d0e21f4b003..8b074aba329114f1156a27f0ebd2793981cc3996 100644 (file)
@@ -82,9 +82,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_ROTATION")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_ROTATION")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@@ -287,6 +285,8 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
   myConstructorId = 0;
   RadioButton1->setChecked(TRUE);
 
   myConstructorId = 0;
   RadioButton1->setChecked(TRUE);
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
@@ -450,7 +450,8 @@ void SMESHGUI_RotationDlg::ClickOnCancel()
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
   reject();
 }
   mySMESHGUI->ResetState();
   reject();
 }
@@ -492,7 +493,8 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText)
       }
 
       mySelector->AddOrRemoveIndex( anIO, newIndices, false );
       }
 
       mySelector->AddOrRemoveIndex( anIO, newIndices, false );
-      myViewWindow->highlight( anIO, true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( anIO, true, true );
       
       myElementsId = theNewText;
     }
       
       myElementsId = theNewText;
     }
@@ -660,26 +662,28 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument()
   switch (myConstructorId) {
   case 0: /* default constructor */
     {
   switch (myConstructorId) {
   case 0: /* default constructor */
     {
+      SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
       if (send == SelectElementsButton) {
         myEditCurrentArgument = (QWidget*)LineEditElements;
         SMESH::SetPointRepresentation(false);
         if (CheckBoxMesh->isChecked()) {
       if (send == SelectElementsButton) {
         myEditCurrentArgument = (QWidget*)LineEditElements;
         SMESH::SetPointRepresentation(false);
         if (CheckBoxMesh->isChecked()) {
-          myViewWindow->SetSelectionMode(ActorSelection);
+         if ( aViewWindow )
+           aViewWindow->SetSelectionMode(ActorSelection);
           mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
         } else {
           mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
         } else {
-
-          myViewWindow->SetSelectionMode( CellSelection );
-        }
+         if ( aViewWindow )
+           aViewWindow->SetSelectionMode( CellSelection );
+       }
       } else if (send == SelectPointButton) {
         myEditCurrentArgument = (QWidget*)SpinBox_X;
         SMESH::SetPointRepresentation(true);
       } else if (send == SelectPointButton) {
         myEditCurrentArgument = (QWidget*)SpinBox_X;
         SMESH::SetPointRepresentation(true);
-
-        myViewWindow->SetSelectionMode( NodeSelection );
+       if ( aViewWindow )
+         aViewWindow->SetSelectionMode( NodeSelection );
       } else if (send == SelectVectorButton) {
         myEditCurrentArgument = (QWidget*)SpinBox_DX;
         SMESH::SetPointRepresentation(true);
       } else if (send == SelectVectorButton) {
         myEditCurrentArgument = (QWidget*)SpinBox_DX;
         SMESH::SetPointRepresentation(true);
-
-        myViewWindow->SetSelectionMode( NodeSelection );
+       if ( aViewWindow )
+         aViewWindow->SetSelectionMode( NodeSelection );
       }
       break;
     }
       }
       break;
     }
@@ -719,7 +723,8 @@ void SMESHGUI_RotationDlg::ActivateThisDialog()
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
-  myViewWindow->SetSelectionMode( CellSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( CellSelection );
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
@@ -773,11 +778,13 @@ void SMESHGUI_RotationDlg::onSelectMesh (bool toSelectMesh)
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
-    myViewWindow->SetSelectionMode( CellSelection );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode( CellSelection );
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
index 1fb8ed500d98d5dab2aba086ff7f6f07ee4464dc..7e71856d17266e66da6f77d26fe6c8ca201c205f 100644 (file)
@@ -83,7 +83,6 @@ private:
     SalomeApp_SelectionMgr*       mySelectionMgr;          /* User shape selection */
     int                           myNbOkElements;          /* to check when elements are defined */
     QString                       myElementsId;
     SalomeApp_SelectionMgr*       mySelectionMgr;          /* User shape selection */
     int                           myNbOkElements;          /* to check when elements are defined */
     QString                       myElementsId;
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;   /* Current  LineEdit */
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;   /* Current  LineEdit */
index 6bbc5c7b141412b71efaed2cd471d7f9c7a92aa2..6ee03914146aa7263aa2329bcee5d0e986aaaf3e 100644 (file)
@@ -75,9 +75,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
       mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
       mySMESHGUI( theModule ),
-      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-      myViewWindow( SMESH::GetViewWindow( theModule ) ),
-      mySelector( myViewWindow->GetSelector() )
+      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
   QPixmap image0 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_FREEBORDERS")));
 {
   SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
   QPixmap image0 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_FREEBORDERS")));
@@ -284,6 +282,8 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
   LineEdit5->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
   LineEdit6->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
 
   LineEdit5->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
   LineEdit6->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   Init();
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   Init();
@@ -452,7 +452,8 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
 
       SMESH::SetPointRepresentation(false);
 
 
       SMESH::SetPointRepresentation(false);
 
-      myViewWindow->SetSelectionMode(CellSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(CellSelection);
       break;
     }
   }
       break;
     }
   }
@@ -470,7 +471,8 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId)
 
     SMESH::SetPointRepresentation(true);
 
 
     SMESH::SetPointRepresentation(true);
 
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
   }
 
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   }
 
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@@ -593,7 +595,8 @@ void SMESHGUI_SewingDlg::ClickOnCancel()
 {
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
 {
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
   disconnect(mySelectionMgr, 0, this, 0);
   mySMESHGUI->ResetState();
   reject();
@@ -643,13 +646,15 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
     if (GetConstructorId() != 3 || (send != LineEdit1 && send != LineEdit4)) {
       SMESH::SetPointRepresentation(true);
 
     if (GetConstructorId() != 3 || (send != LineEdit1 && send != LineEdit4)) {
       SMESH::SetPointRepresentation(true);
 
-      myViewWindow->SetSelectionMode(NodeSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(NodeSelection);
 
       const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
       if (n) {
        newIndices.Add(n->GetID());
        mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
 
       const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
       if (n) {
        newIndices.Add(n->GetID());
        mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
-       myViewWindow->highlight( myActor->getIO(), true, true );
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->highlight( myActor->getIO(), true, true );
        
         if      (send == LineEdit1)
           myOk1 = true;
        
         if      (send == LineEdit1)
           myOk1 = true;
@@ -667,7 +672,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
     } else {
       SMESH::SetPointRepresentation(false);
 
     } else {
       SMESH::SetPointRepresentation(false);
 
-      myViewWindow->SetSelectionMode(CellSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(CellSelection);
 
       QStringList aListId = QStringList::split(" ", theNewText, false);
 
 
       QStringList aListId = QStringList::split(" ", theNewText, false);
 
@@ -684,7 +690,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
       
 
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
       
 
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
-      myViewWindow->highlight( myActor->getIO(), true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( myActor->getIO(), true, true );
       
       if (isEvenOneExists) {
         if (send == LineEdit1)
       
       if (isEvenOneExists) {
         if (send == LineEdit1)
@@ -821,11 +828,13 @@ void SMESHGUI_SewingDlg::SetEditCurrentArgument()
   if (GetConstructorId() != 3 || (send != SelectButton1 && send != SelectButton4)) {
     SMESH::SetPointRepresentation(true);
 
   if (GetConstructorId() != 3 || (send != SelectButton1 && send != SelectButton4)) {
     SMESH::SetPointRepresentation(true);
 
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
 
   } else {
     SMESH::SetPointRepresentation(false);
 
   } else {
     SMESH::SetPointRepresentation(false);
-    myViewWindow->SetSelectionMode(CellSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(CellSelection);
   }
 
   myEditCurrentArgument->setFocus();
   }
 
   myEditCurrentArgument->setFocus();
index 695abc9b362e98d645c066d2ca1e6126c5dcf6ff..6a800d6acb1562c6f3c23813df06a4ac93df7c63 100644 (file)
@@ -79,7 +79,6 @@ private:
     SalomeApp_SelectionMgr*       mySelectionMgr;          /* User shape selection */
     int                           myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;    
     QLineEdit*                    myEditCurrentArgument;   /* Current  LineEdit */
     SalomeApp_SelectionMgr*       mySelectionMgr;          /* User shape selection */
     int                           myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;    
     QLineEdit*                    myEditCurrentArgument;   /* Current  LineEdit */
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
     
     bool                          myBusy;
     SVTK_Selector*                mySelector;
     
     bool                          myBusy;
index 404d6a6d82a5e286bf4709e52ee0204b1e99e18e..fcf0682b49ef72c673973f5c70e453e60a7cb997 100755 (executable)
@@ -113,7 +113,6 @@ SMESHGUI_SingleEditDlg
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-    myViewWindow(SMESH::GetViewWindow(theModule)),
     mySMESHGUI(theModule)
 {
   QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
     mySMESHGUI(theModule)
 {
   QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
@@ -240,7 +239,8 @@ void SMESHGUI_SingleEditDlg::Init()
   this->show();
 
   // set selection mode
   this->show();
 
   // set selection mode
-  myViewWindow->SetSelectionMode(EdgeOfCellSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(EdgeOfCellSelection);
 
   onSelectionDone();
 }
 
   onSelectionDone();
 }
@@ -262,7 +262,8 @@ void SMESHGUI_SingleEditDlg::onOk()
 //=======================================================================
 void SMESHGUI_SingleEditDlg::onClose()
 {
 //=======================================================================
 void SMESHGUI_SingleEditDlg::onClose()
 {
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->clearSelected();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
   mySelectionMgr->clearSelected();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
@@ -442,7 +443,8 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
     mySMESHGUI->EmitSignalDeactivateDialog();
 {
   if (!isEnabled()) {
     mySMESHGUI->EmitSignalDeactivateDialog();
-    myViewWindow->SetSelectionMode(EdgeOfCellSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(EdgeOfCellSelection);
     setEnabled(true);
   }
 }
     setEnabled(true);
   }
 }
index 3eff1f9d36d1285910c2c14002e597b05d6c864b..01f724a4c135ef3480ddfbebd1f7697bddb543f0 100755 (executable)
@@ -89,7 +89,6 @@ protected:
   SMESH_Actor*            myActor;
 
   SalomeApp_SelectionMgr* mySelectionMgr;
   SMESH_Actor*            myActor;
 
   SalomeApp_SelectionMgr* mySelectionMgr;
-  SVTK_ViewWindow*        myViewWindow;
   SVTK_Selector*          mySelector;
   SMESHGUI*               mySMESHGUI;
 };
   SVTK_Selector*          mySelector;
   SMESHGUI*               mySMESHGUI;
 };
index c1b4dea983589443facf46996ef61d2801a0b0a7..40400d4996e97f249e12a2143e1fe31b7e6de466 100644 (file)
@@ -89,9 +89,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@@ -253,6 +251,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
   GroupArguments->show();
   myConstructorId = 0;
   Constructor1->setChecked(TRUE);
   GroupArguments->show();
   myConstructorId = 0;
   Constructor1->setChecked(TRUE);
+  
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
 
   mySMESHGUI->SetActiveDialogBox(this);
 
 
   mySMESHGUI->SetActiveDialogBox(this);
 
@@ -424,7 +424,8 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel()
   mySelectionMgr->clearSelected();
   SMESH::SetPickable(); // ???
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearSelected();
   SMESH::SetPickable(); // ???
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
   reject();
 }
   mySMESHGUI->ResetState();
   reject();
 }
@@ -470,7 +471,8 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
        myNbOkElements++;
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
        myNbOkElements++;
       }
       mySelector->AddOrRemoveIndex(anIO, newIndices, false);
-      myViewWindow->highlight( anIO, true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( anIO, true, true );
       myElementsId = theNewText;
 
     } else if (send == LineEditNodes) {
       myElementsId = theNewText;
 
     } else if (send == LineEditNodes) {
@@ -483,7 +485,8 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText)
        myNbOkNodes++;
       }
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
        myNbOkNodes++;
       }
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
-      myViewWindow->highlight( myActor->getIO(), true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( myActor->getIO(), true, true );
     }
   }
 
     }
   }
 
@@ -633,12 +636,14 @@ void SMESHGUI_SmoothingDlg::SetEditCurrentArgument()
           mySelectionMgr->setSelectionModes(ActorSelection);
           mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
         } else {
           mySelectionMgr->setSelectionModes(ActorSelection);
           mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
         } else {
-          myViewWindow->SetSelectionMode(CellSelection);
+         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+           aViewWindow->SetSelectionMode(CellSelection);
        }
       }        else if (send == SelectNodesButton) {
         myEditCurrentArgument = LineEditNodes;
         SMESH::SetPointRepresentation(true);
        }
       }        else if (send == SelectNodesButton) {
         myEditCurrentArgument = LineEditNodes;
         SMESH::SetPointRepresentation(true);
-        myViewWindow->SetSelectionMode(NodeSelection);
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(NodeSelection);
       }
 
       myEditCurrentArgument->setFocus();
       }
 
       myEditCurrentArgument->setFocus();
@@ -677,7 +682,8 @@ void SMESHGUI_SmoothingDlg::ActivateThisDialog()
   GroupButtons->setEnabled(true);
 
   mySMESHGUI->SetActiveDialogBox(this);
   GroupButtons->setEnabled(true);
 
   mySMESHGUI->SetActiveDialogBox(this);
-  myViewWindow->SetSelectionMode(CellSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(CellSelection);
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
@@ -735,7 +741,8 @@ void SMESHGUI_SmoothingDlg::onSelectMesh (bool toSelectMesh)
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
-    myViewWindow->SetSelectionMode(CellSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(CellSelection);
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
index fc1fdb21599238548db50d1a95b86a9ece9d218b..32dc80513c93a60bb930bc5f3ac21b3a2955f54e 100644 (file)
@@ -87,7 +87,6 @@ private:
     int                           myNbOkNodes;             /* to check when fixed nodes are defined */
     int                           myConstructorId;         /* Current constructor id = radio button id */
     QLineEdit*                    myEditCurrentArgument;   /* Current  LineEdit */
     int                           myNbOkNodes;             /* to check when fixed nodes are defined */
     int                           myConstructorId;         /* Current constructor id = radio button id */
     QLineEdit*                    myEditCurrentArgument;   /* Current  LineEdit */
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
 
     bool                          myBusy;
     SVTK_Selector*                mySelector;
 
     bool                          myBusy;
index 496a1573a51ebfdcf06b4bb8934041dd97fbd116..fe52986e52107c5893e63739462483c7d49b1b78 100644 (file)
@@ -82,9 +82,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
       mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
       mySMESHGUI( theModule ),
-      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-      myViewWindow( SMESH::GetViewWindow( theModule ) ),
-      mySelector( myViewWindow->GetSelector() )
+      mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
@@ -281,6 +279,8 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
   GroupArguments->show();
   RadioButton1->setChecked(TRUE);
 
   GroupArguments->show();
   RadioButton1->setChecked(TRUE);
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
@@ -420,7 +420,10 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
   if (myEditCurrentArgument != (QWidget*)LineEditElements) {
     SMESH::SetPointRepresentation(false);
     if (!CheckBoxMesh->isChecked())
   if (myEditCurrentArgument != (QWidget*)LineEditElements) {
     SMESH::SetPointRepresentation(false);
     if (!CheckBoxMesh->isChecked())
-      myViewWindow->SetSelectionMode(CellSelection);
+      {
+       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+         aViewWindow->SetSelectionMode(CellSelection);
+      }
   }
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
   }
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
@@ -509,7 +512,8 @@ void SMESHGUI_SymmetryDlg::ClickOnCancel()
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySMESHGUI->ResetState();
   reject();
 }
   mySMESHGUI->ResetState();
   reject();
 }
@@ -552,7 +556,8 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText)
       }
 
       mySelector->AddOrRemoveIndex( anIO, newIndices, false );
       }
 
       mySelector->AddOrRemoveIndex( anIO, newIndices, false );
-      myViewWindow->highlight( anIO, true, true );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->highlight( anIO, true, true );
       
       myElementsId = theNewText;
     }
       
       myElementsId = theNewText;
     }
@@ -721,20 +726,24 @@ void SMESHGUI_SymmetryDlg::SetEditCurrentArgument()
     myEditCurrentArgument = (QWidget*)LineEditElements;
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
     myEditCurrentArgument = (QWidget*)LineEditElements;
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
-      myViewWindow->SetSelectionMode(ActorSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(ActorSelection);
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
-      myViewWindow->SetSelectionMode(CellSelection);
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode(CellSelection);
     }
   } else if (send == SelectPointButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_X;
     SMESH::SetPointRepresentation(true);
     }
   } else if (send == SelectPointButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_X;
     SMESH::SetPointRepresentation(true);
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
   } else if (send == SelectVectorButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_DX;
     SMESH::SetPointRepresentation(true);
 
   } else if (send == SelectVectorButton) {
     myEditCurrentArgument = (QWidget*)SpinBox_DX;
     SMESH::SetPointRepresentation(true);
 
-    myViewWindow->SetSelectionMode(NodeSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(NodeSelection);
   } else {
   }
 
   } else {
   }
 
@@ -772,7 +781,8 @@ void SMESHGUI_SymmetryDlg::ActivateThisDialog()
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
-  myViewWindow->SetSelectionMode(CellSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(CellSelection);
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
@@ -826,11 +836,13 @@ void SMESHGUI_SymmetryDlg::onSelectMesh (bool toSelectMesh)
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
-    myViewWindow->SetSelectionMode(ActorSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
-    myViewWindow->SetSelectionMode(CellSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(CellSelection);
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
index 97cd85605b14296964bbd50693d1b4bb4559ba82..b09ad5e46a7486cac9bad979863ec8a3957316ce 100644 (file)
@@ -83,7 +83,6 @@ private:
     SalomeApp_SelectionMgr*       mySelectionMgr;          /* User shape selection */
     int                           myNbOkElements;          /* to check when elements are defined */
     QString                       myElementsId;
     SalomeApp_SelectionMgr*       mySelectionMgr;          /* User shape selection */
     int                           myNbOkElements;          /* to check when elements are defined */
     QString                       myElementsId;
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;   /* Current  LineEdit */
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;   /* Current  LineEdit */
index 8df40714e1c69be12e2201e8c4b7a8c0d1789ca8..6ea4bbf29ab2ab2730ae5ac089f59966caed990c 100644 (file)
@@ -83,9 +83,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
      : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
                 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
      mySMESHGUI( theModule ),
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),
-     mySelector( myViewWindow->GetSelector() )
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
@@ -261,6 +259,8 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
   GroupArguments->show();
   RadioButton1->setChecked(TRUE);
 
   GroupArguments->show();
   RadioButton1->setChecked(TRUE);
 
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   // Costruction of the logical filter
@@ -395,8 +395,8 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
   if (myEditCurrentArgument != (QWidget*)LineEditElements) {
     SMESH::SetPointRepresentation(false);
     if (!CheckBoxMesh->isChecked())
   if (myEditCurrentArgument != (QWidget*)LineEditElements) {
     SMESH::SetPointRepresentation(false);
     if (!CheckBoxMesh->isChecked())
-
-      myViewWindow->SetSelectionMode( CellSelection );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode( CellSelection );
   }
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
   }
 
   myEditCurrentArgument = (QWidget*)LineEditElements;
@@ -474,7 +474,8 @@ void SMESHGUI_TranslationDlg::ClickOnCancel()
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
   mySelectionMgr->clearFilters();
   mySelectionMgr->clearSelected();
   SMESH::SetPointRepresentation(false);
-  myViewWindow->SetSelectionMode( ActorSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( ActorSelection );
   mySMESHGUI->ResetState();
   reject();
 }
   mySMESHGUI->ResetState();
   reject();
 }
@@ -518,7 +519,8 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
     }
 
     mySelector->AddOrRemoveIndex( anIO, newIndices, false );
     }
 
     mySelector->AddOrRemoveIndex( anIO, newIndices, false );
-    myViewWindow->highlight( anIO, true, true );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->highlight( anIO, true, true );
     
     myElementsId = theNewText;
   }
     
     myElementsId = theNewText;
   }
@@ -686,22 +688,26 @@ void SMESHGUI_TranslationDlg::SetEditCurrentArgument()
     myEditCurrentArgument = (QWidget*)LineEditElements;
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
     myEditCurrentArgument = (QWidget*)LineEditElements;
     SMESH::SetPointRepresentation(false);
     if (CheckBoxMesh->isChecked()) {
-      myViewWindow->SetSelectionMode( ActorSelection );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode( ActorSelection );
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
 
       mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     } else {
 
-      myViewWindow->SetSelectionMode( CellSelection );
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+       aViewWindow->SetSelectionMode( CellSelection );
     }
   } else if (send == SelectButton1) {
     myEditCurrentArgument = (QWidget*)SpinBox1_1;
     SMESH::SetPointRepresentation(true);
 
     }
   } else if (send == SelectButton1) {
     myEditCurrentArgument = (QWidget*)SpinBox1_1;
     SMESH::SetPointRepresentation(true);
 
-    myViewWindow->SetSelectionMode( NodeSelection );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode( NodeSelection );
   } else if (send == SelectButton2) {
     myEditCurrentArgument = (QWidget*)SpinBox2_1;
     SMESH::SetPointRepresentation(true);
 
   } else if (send == SelectButton2) {
     myEditCurrentArgument = (QWidget*)SpinBox2_1;
     SMESH::SetPointRepresentation(true);
 
-    myViewWindow->SetSelectionMode( NodeSelection );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode( NodeSelection );
   }
 
   myEditCurrentArgument->setFocus();
   }
 
   myEditCurrentArgument->setFocus();
@@ -738,7 +744,8 @@ void SMESHGUI_TranslationDlg::ActivateThisDialog()
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
 
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
-  myViewWindow->SetSelectionMode( CellSelection );
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( CellSelection );
 
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
@@ -793,11 +800,13 @@ void SMESHGUI_TranslationDlg::onSelectMesh (bool toSelectMesh)
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
   SMESH::SetPointRepresentation(false);
 
   if (toSelectMesh) {
-    myViewWindow->SetSelectionMode( ActorSelection );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode( ActorSelection );
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
   } else {
-    myViewWindow->SetSelectionMode( CellSelection );
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode( CellSelection );
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
     LineEditElements->setReadOnly(false);
     onTextChange(LineEditElements->text());
   }
index da9c93e7d309a7f554b46752d6209fd8313418a8..117a71b428efb5cbeaacdcebd194cfb2b5aae233 100644 (file)
@@ -82,7 +82,6 @@ private:
     QString                       myElementsId;
     int                           myNbOkElements;          /* to check when elements are defined */
 
     QString                       myElementsId;
     int                           myNbOkElements;          /* to check when elements are defined */
 
-    SVTK_ViewWindow*              myViewWindow;
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;
     SVTK_Selector*                mySelector;
 
     QWidget*                      myEditCurrentArgument;
index d2a5689d39a0ab9628d2b7f8e785b8c41a14cb30..ac064ec25a41bd753af8242a86d2464219513e69 100644 (file)
@@ -497,7 +497,8 @@ namespace SMESH{
   void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
                 SVTK_InteractorStyle* theStyle)
   {
   void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
                 SVTK_InteractorStyle* theStyle)
   {
-    theStyle->SetFilter(theFilter);
+    if (theStyle)
+      theStyle->SetFilter(theFilter);
   }
 
   Handle(VTKViewer_Filter) GetFilter(int theId, SVTK_InteractorStyle* theStyle)
   }
 
   Handle(VTKViewer_Filter) GetFilter(int theId, SVTK_InteractorStyle* theStyle)