X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshersGUI%2FStdMeshersGUI_StdHypothesisCreator.cxx;h=df4370d6dcf1ff67e2a1c14741f43b62932e17cd;hb=686a8645643ba74ea3be5646b8fc7b35a70c297d;hp=2ab70e428f92d6de1ec5deee00620040fea8bebe;hpb=ea89ab6a23bd5042842cc6e2b1abb7b5e6efe998;p=modules%2Fsmesh.git diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 2ab70e428..df4370d6d 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -33,6 +33,7 @@ #include #include "StdMeshersGUI_ObjectReferenceParamWdg.h" #include "StdMeshersGUI_LayerDistributionParamWdg.h" +#include "StdMeshersGUI_EdgeDirectionParamWdg.h" #include // SALOME GUI includes @@ -423,6 +424,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const StdMeshers::StdMeshers_MaxLength::_narrow( hypothesis() ); h->SetLength( params[0].myValue.toDouble() ); + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); h->SetUsePreestimatedLength( widget< QCheckBox >( 1 )->isChecked() ); if ( !h->HavePreestimatedLength() && !h->_is_equivalent( initParamsHypothesis() )) { StdMeshers::StdMeshers_MaxLength_var hInit = @@ -443,10 +445,18 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const StdMeshers::StdMeshers_Arithmetic1D_var h = StdMeshers::StdMeshers_Arithmetic1D::_narrow( hypothesis() ); + StdMeshersGUI_EdgeDirectionParamWdg* w = + widget< StdMeshersGUI_EdgeDirectionParamWdg >( 2 ); + h->SetLength( params[0].myValue.toDouble(), true ); h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); h->SetLength( params[1].myValue.toDouble(), false ); h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + if (w) { + h->SetReversedEdges( w->GetListOfIDs() ); + const char * entry = w->GetMainShapeEntry(); + h->SetObjectEntry( entry ); + } } else if( hypType()=="MaxElementArea" ) { @@ -468,10 +478,17 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const StdMeshers::StdMeshers_StartEndLength_var h = StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() ); + StdMeshersGUI_EdgeDirectionParamWdg* w = + widget< StdMeshersGUI_EdgeDirectionParamWdg >( 2 ); + h->SetLength( params[0].myValue.toDouble(), true ); h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); h->SetLength( params[1].myValue.toDouble(), false ); h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + if (w) { + h->SetReversedEdges( w->GetListOfIDs() ); + h->SetObjectEntry( w->GetMainShapeEntry() ); + } } else if( hypType()=="Deflection1D" ) { @@ -610,7 +627,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const } item.myName = tr("SMESH_LOCAL_LENGTH_PARAM"); - item.myValue = h->GetLength(); + if(!initVariableName(aParameters,item,0)) + item.myValue = h->GetLength(); p.append( item ); customWidgets()->append(0); @@ -648,10 +666,26 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const item.myValue = h->GetLength( true ); p.append( item ); + customWidgets()->append (0); + item.myName = tr( "SMESH_END_LENGTH_PARAM" ); if(!initVariableName(aParameters,item,1)) item.myValue = h->GetLength( false ); p.append( item ); + + customWidgets()->append (0); + + item.myName = tr( "SMESH_REVERCE_EDGES" ); + p.append( item ); + + StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget = new StdMeshersGUI_EdgeDirectionParamWdg(); + QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry(); + if ( anEntry == "" ) + anEntry = h->GetObjectEntry(); + aDirectionWidget->SetMainShapeEntry( anEntry ); + aDirectionWidget->SetListOfIDs( h->GetReversedEdges() ); + aDirectionWidget->showPreview( true ); + customWidgets()->append ( aDirectionWidget ); } else if( hypType()=="MaxElementArea" ) { @@ -684,12 +718,26 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const if(!initVariableName(aParameters,item,0)) item.myValue = h->GetLength( true ); p.append( item ); + customWidgets()->append(0); item.myName = tr( "SMESH_END_LENGTH_PARAM" ); if(!initVariableName(aParameters,item,1)) item.myValue = h->GetLength( false ); p.append( item ); - + customWidgets()->append(0); + + item.myName = tr( "SMESH_REVERCE_EDGES" ); + p.append( item ); + + StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget = new StdMeshersGUI_EdgeDirectionParamWdg(); + QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry(); + if ( anEntry == "" ) + anEntry = h->GetObjectEntry(); + aDirectionWidget->SetMainShapeEntry( anEntry ); + aDirectionWidget->SetListOfIDs( h->GetReversedEdges() ); + aDirectionWidget->SetMainShapeEntry( h->GetObjectEntry() ); + aDirectionWidget->showPreview( true ); + customWidgets()->append ( aDirectionWidget ); } else if( hypType()=="Deflection1D" ) { @@ -998,6 +1046,13 @@ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & pa param.myValue = w->GetValue(); return true; } + if ( widget->inherits( "StdMeshersGUI_EdgeDirectionParamWdg" )) + { + const StdMeshersGUI_EdgeDirectionParamWdg * w = + static_cast( widget ); + param.myValue = w->GetValue(); + return true; + } return false; }