X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_ExtrusionDlg.cxx;h=89ebc7f55f0ab4371a59f45880fe9ca57da20e9a;hp=2ed9123835b509ec3bde2c6d902449c572bd2f66;hb=9357f5c87098aff2b95b754d69f66c76d2df9c24;hpb=686a8645643ba74ea3be5646b8fc7b35a70c297d diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 2ed912383..89ebc7f55 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -19,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // SMESH SMESHGUI : GUI for SMESH component // File : SMESHGUI_ExtrusionDlg.cxx // Author : Michael ZORIN, Open CASCADE S.A.S. @@ -249,16 +250,16 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule) SMESHGUI_ExtrusionDlgLayout->addWidget(GroupButtons); /* Initialisations */ - SpinBox_Vx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3); - SpinBox_Vy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3); - SpinBox_Vz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3); + SpinBox_Vx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision"); + SpinBox_Vy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision"); + SpinBox_Vz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision"); - SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); + SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); + SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); + SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); SpinBox_NbSteps->setRange(1, 999999); - SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, 3); + SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision"); RadioButton1->setChecked(true); RadioButton3->setChecked(true); @@ -400,24 +401,24 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId) { GroupArguments->setTitle(tr("EXTRUSION_1D")); if (!CheckBoxMesh->isChecked()) - { - LineEditElements->clear(); - myIDs.clear(); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - } + { + LineEditElements->clear(); + myIDs.clear(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + } break; } case 1: { GroupArguments->setTitle(tr("EXTRUSION_2D")); if (!CheckBoxMesh->isChecked()) - { - LineEditElements->clear(); - myIDs.clear(); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + { + LineEditElements->clear(); + myIDs.clear(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } break; } } @@ -509,8 +510,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() aParameters << SpinBox_Dz->text(); } else if ( RadioButton4->isChecked() ) { gp_XYZ aNormale(SpinBox_Vx->GetValue(), - SpinBox_Vy->GetValue(), - SpinBox_Vz->GetValue()); + SpinBox_Vy->GetValue(), + SpinBox_Vz->GetValue()); aNormale /= aNormale.Modulus(); @@ -536,29 +537,29 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) { if( CheckBoxMesh->isChecked() ) { - if( GetConstructorId() == 0 ) - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps); - else - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps); - } - else - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps); + if( GetConstructorId() == 0 ) + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps); + else + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps); + } + else + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps); } else { - if( CheckBoxMesh->isChecked() ) { - if( GetConstructorId() == 0 ) - aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps); - else - aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps); - } - else - aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps); + if( CheckBoxMesh->isChecked() ) { + if( GetConstructorId() == 0 ) + aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps); + else + aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps); + } + else + aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps); } - myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) ); + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); } catch (...) { } @@ -611,10 +612,10 @@ void SMESHGUI_ExtrusionDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -666,7 +667,7 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText) myElementsId->length( myNbOkElements = newIndices.Extent() ); mySelector->AddOrRemoveIndex(myIO, newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myIO, true, true ); + aViewWindow->highlight( myIO, true, true ); } } @@ -744,7 +745,7 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument() aNbElements = aMapIndex.Extent(); if (aNbElements < 1) - return; + return; myElementsId = new SMESH::long_array; myElementsId->length( aNbElements ); @@ -802,20 +803,20 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument() myEditCurrentArgument = (QWidget*)LineEditElements; if (CheckBoxMesh->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { int aConstructorId = GetConstructorId(); if (aConstructorId == 0) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + } else if (aConstructorId == 1) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } } } else if (send == SelectVectorButton){ @@ -930,13 +931,13 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh) int aConstructorId = GetConstructorId(); if (aConstructorId == 0) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); } else if (aConstructorId == 1) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); } LineEditElements->setReadOnly(false); @@ -983,8 +984,8 @@ void SMESHGUI_ExtrusionDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg )