X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshersGUI%2FStdMeshersGUI_StdHypothesisCreator.cxx;h=342f66fc418e775d9f7f94b9cb5b95d7c18b2917;hp=493235b15b59aa1633bf0f0a62217d3f4964dd74;hb=f7aba4830d53719b963fdb7fccc98b760fdef2d1;hpb=62c442d05faf338dd2a7c14a6c175a588735bbe4 diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 493235b15..342f66fc4 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -523,6 +523,23 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const h->SetObjectEntry( w->GetMainShapeEntry() ); } } + else if( hypType()=="GeometricProgression" ) + { + StdMeshers::StdMeshers_Geometric1D_var h = + StdMeshers::StdMeshers_Geometric1D::_narrow( hypothesis() ); + + StdMeshersGUI_SubShapeSelectorWdg* w = + widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 ); + + h->SetVarParameter( params[0].text(), "SetStartLength" ); + h->SetStartLength( params[0].myValue.toDouble() ); + h->SetVarParameter( params[1].text(), "SetCommonRatio" ); + h->SetCommonRatio( params[1].myValue.toDouble() ); + if (w) { + h->SetReversedEdges( w->GetListOfIDs() ); + h->SetObjectEntry( w->GetMainShapeEntry() ); + } + } else if( hypType()=="FixedPoints1D" ) { StdMeshers::StdMeshers_FixedPoints1D_var h = @@ -582,6 +599,17 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const h->SetVarParameter( params[0].text(), "SetDeflection" ); h->SetDeflection( params[0].myValue.toDouble() ); } + else if( hypType()=="Adaptive1D" ) + { + StdMeshers::StdMeshers_Adaptive1D_var h = + StdMeshers::StdMeshers_Adaptive1D::_narrow( hypothesis() ); + h->SetVarParameter( params[0].text(), "SetMinSize" ); + h->SetMinSize( params[0].myValue.toDouble() ); + h->SetVarParameter( params[0].text(), "SetMaxSize" ); + h->SetMaxSize( params[1].myValue.toDouble() ); + h->SetVarParameter( params[0].text(), "SetDeflection" ); + h->SetDeflection( params[2].myValue.toDouble() ); + } else if( hypType()=="AutomaticLength" ) { StdMeshers::StdMeshers_AutomaticLength_var h = @@ -693,9 +721,9 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const h->SetStretchFactor ( params[2].myValue.toDouble() ); if ( StdMeshersGUI_SubShapeSelectorWdg* idsWg = - widget< StdMeshersGUI_SubShapeSelectorWdg >( 3 )) + widget< StdMeshersGUI_SubShapeSelectorWdg >( 4 )) { - h->SetIgnoreFaces( idsWg->GetListOfIDs() ); + h->SetFaces( idsWg->GetListOfIDs(), params[3].myValue.toInt() ); } } else if( hypType()=="ViscousLayers2D" ) @@ -867,6 +895,41 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const customWidgets()->append ( aDirectionWidget ); } + else if( hypType()=="GeometricProgression" ) + { + StdMeshers::StdMeshers_Geometric1D_var h = + StdMeshers::StdMeshers_Geometric1D::_narrow( hyp ); + + item.myName = tr( "SMESH_START_LENGTH_PARAM" ); + if(!initVariableName( hyp, item, "SetStartLength" )) + item.myValue = h->GetStartLength(); + p.append( item ); + + customWidgets()->append (0); + + item.myName = tr( "SMESH_COMMON_RATIO" ); + if(!initVariableName( hyp, item, "SetCommonRatio" )) + item.myValue = h->GetCommonRatio(); + p.append( item ); + + customWidgets()->append (0); + + item.myName = tr( "SMESH_REVERSED_EDGES" ); + p.append( item ); + + StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget = + new StdMeshersGUI_SubShapeSelectorWdg(); + QString aGeomEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry(); + QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry(); + if ( aGeomEntry == "" ) + aGeomEntry = h->GetObjectEntry(); + + aDirectionWidget->SetGeomShapeEntry( aGeomEntry ); + aDirectionWidget->SetMainShapeEntry( aMainEntry ); + aDirectionWidget->SetListOfIDs( h->GetReversedEdges() ); + aDirectionWidget->showPreview( true ); + customWidgets()->append ( aDirectionWidget ); + } else if( hypType()=="FixedPoints1D" ) { @@ -960,7 +1023,27 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const { StdMeshers::StdMeshers_Deflection1D_var h = StdMeshers::StdMeshers_Deflection1D::_narrow( hyp ); - + + item.myName = tr( "SMESH_DEFLECTION1D_PARAM" ); + if(!initVariableName( hyp, item, "SetDeflection" )) + item.myValue = h->GetDeflection(); + p.append( item ); + } + else if( hypType()=="Adaptive1D" ) + { + StdMeshers::StdMeshers_Adaptive1D_var h = + StdMeshers::StdMeshers_Adaptive1D::_narrow( hyp ); + + item.myName = tr( "SMESH_MIN_SIZE" ); + if(!initVariableName( hyp, item, "SetMinSize" )) + item.myValue = h->GetMinSize(); + p.append( item ); + + item.myName = tr( "SMESH_MAX_SIZE" ); + if(!initVariableName( hyp, item, "SetMaxSize" )) + item.myValue = h->GetMaxSize(); + p.append( item ); + item.myName = tr( "SMESH_DEFLECTION1D_PARAM" ); if(!initVariableName( hyp, item, "SetDeflection" )) item.myValue = h->GetDeflection(); @@ -1161,7 +1244,19 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry(); if ( !aMainEntry.isEmpty() ) { - item.myName = tr( "SMESH_FACES_WO_LAYERS" ); + item.myName = tr( "TO_IGNORE_FACES_OR_NOT" ); + p.append( item ); + + StdMeshersGUI_RadioButtonsGrpWdg* ignoreWdg = new StdMeshersGUI_RadioButtonsGrpWdg(""); + ignoreWdg->setButtonLabels ( QStringList() + << tr("NOT_TO_IGNORE_FACES") + << tr("TO_IGNORE_FACES") ); + ignoreWdg->setChecked( h->GetIsToIgnoreFaces() ); + connect(ignoreWdg->getButtonGroup(),SIGNAL(buttonClicked(int)),this,SLOT(onValueChanged())); + customWidgets()->append( ignoreWdg ); + + item.myName = + tr( h->GetIsToIgnoreFaces() ? "SMESH_FACES_WO_LAYERS" : "SMESH_FACES_WITH_LAYERS" ); p.append( item ); StdMeshersGUI_SubShapeSelectorWdg* idsWg = @@ -1169,7 +1264,7 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const idsWg->SetGeomShapeEntry( aMainEntry ); idsWg->SetMainShapeEntry( aMainEntry ); - idsWg->SetListOfIDs( h->GetIgnoreFaces() ); + idsWg->SetListOfIDs( h->GetFaces() ); idsWg->showPreview( true ); customWidgets()->append ( idsWg ); } @@ -1294,6 +1389,13 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int) { sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" ); } + else if( hypType()=="GeometricProgression" ) + { + if (sb->objectName() == tr("SMESH_START_LENGTH_PARAM")) + sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" ); + else if (sb->objectName() == tr("SMESH_COMMON_RATIO")) + sb->RangeStepAndValidator( -VALUE_MAX, VALUE_MAX, 0.5, "len_tol_precision" ); + } else if( hypType()=="MaxLength" ) { sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" ); @@ -1315,6 +1417,10 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int) { sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" ); } + else if( hypType()=="Adaptive1D" ) + { + sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" ); + } else if( hypType().startsWith( "ViscousLayers" )) { if (sb->objectName() == tr("SMESH_STRETCH_FACTOR")) @@ -1386,7 +1492,9 @@ QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) cons types.insert( "MaxElementVolume", "MAX_ELEMENT_VOLUME" ); types.insert( "StartEndLength", "START_END_LENGTH" ); types.insert( "Deflection1D", "DEFLECTION1D" ); + types.insert( "Adaptive1D", "ADAPTIVE1D" ); types.insert( "Arithmetic1D", "ARITHMETIC_1D" ); + types.insert( "GeometricProgression", "GEOMETRIC_1D" ); types.insert( "FixedPoints1D", "FIXED_POINTS_1D" ); types.insert( "AutomaticLength", "AUTOMATIC_LENGTH" ); types.insert( "ProjectionSource1D", "PROJECTION_SOURCE_1D" ); @@ -1560,12 +1668,15 @@ void StdMeshersGUI_StdHypothesisCreator::valueChanged( QWidget* paramWidget) toCopyGroups->setEnabled( true ); } } - else if ( hypType() == "ViscousLayers2D" && paramWidget->inherits("QButtonGroup")) + else if ( hypType().startsWith( "ViscousLayers" ) && paramWidget->inherits("QButtonGroup")) { if ( QLabel* label = getLabel(4) ) { bool toIgnore = widget< StdMeshersGUI_RadioButtonsGrpWdg >( 3 )->checkedId(); - label->setText( tr( toIgnore ? "SMESH_EDGES_WO_LAYERS" : "SMESH_EDGES_WITH_LAYERS" )); + if ( hypType() == "ViscousLayers2D" ) + label->setText( tr( toIgnore ? "SMESH_EDGES_WO_LAYERS" : "SMESH_EDGES_WITH_LAYERS" )); + else + label->setText( tr( toIgnore ? "SMESH_FACES_WO_LAYERS" : "SMESH_FACES_WITH_LAYERS" )); } } }