X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_TranslationDlg.cxx;h=5a4539c9452e3c8bb080a2894cabbc4c2987bc43;hb=f87e54ae3a450f6adeee75d1b42c3b17e9c6250c;hp=8df40714e1c69be12e2201e8c4b7a8c0d1789ca8;hpb=783b5a717c5967960d2adfdc43f158c8411c66ed;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 8df40714e..5a4539c94 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -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 ), - 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"))); @@ -261,6 +259,8 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha GroupArguments->show(); RadioButton1->setChecked(TRUE); + mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); + mySMESHGUI->SetActiveDialogBox((QDialog*)this); // Costruction of the logical filter @@ -300,6 +300,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha this->show(); /* displays Dialog */ ConstructorsClicked(0); + SelectionIntoArgument(); resize(0,0); // ?? } @@ -395,8 +396,8 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId) 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; @@ -447,10 +448,10 @@ void SMESHGUI_TranslationDlg::ClickOnApply() } catch (...) { } - mySelectionMgr->clearSelected(); SMESH::UpdateView(); Init(false); ConstructorsClicked(GetConstructorId()); + SelectionIntoArgument(); } } @@ -474,7 +475,8 @@ void SMESHGUI_TranslationDlg::ClickOnCancel() mySelectionMgr->clearFilters(); mySelectionMgr->clearSelected(); SMESH::SetPointRepresentation(false); - myViewWindow->SetSelectionMode( ActorSelection ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode( ActorSelection ); mySMESHGUI->ResetState(); reject(); } @@ -518,7 +520,8 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) } mySelector->AddOrRemoveIndex( anIO, newIndices, false ); - myViewWindow->highlight( anIO, true, true ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( anIO, true, true ); myElementsId = theNewText; } @@ -622,7 +625,7 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() aNbUnits = anElementsIds->length(); } } else { - aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aString); + aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString); myElementsId = aString; } @@ -686,22 +689,26 @@ void SMESHGUI_TranslationDlg::SetEditCurrentArgument() 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 { - myViewWindow->SetSelectionMode( CellSelection ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode( CellSelection ); } } 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); - myViewWindow->SetSelectionMode( NodeSelection ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode( NodeSelection ); } myEditCurrentArgument->setFocus(); @@ -738,7 +745,8 @@ void SMESHGUI_TranslationDlg::ActivateThisDialog() mySMESHGUI->SetActiveDialogBox((QDialog*)this); - myViewWindow->SetSelectionMode( CellSelection ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode( CellSelection ); SelectionIntoArgument(); } @@ -793,11 +801,13 @@ void SMESHGUI_TranslationDlg::onSelectMesh (bool 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 { - myViewWindow->SetSelectionMode( CellSelection ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode( CellSelection ); LineEditElements->setReadOnly(false); onTextChange(LineEditElements->text()); }