From: rnv Date: Mon, 1 Dec 2008 08:40:32 +0000 (+0000) Subject: Parametrization of the MaxElementVolume hypothesis. X-Git-Tag: TG_DumpPython_Extension_3~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5e01f04c5d1bae3d8cbfbff0c3f6073ca150cbd6;p=modules%2Fsmesh.git Parametrization of the MaxElementVolume hypothesis. --- diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx index 877874c33..3d2ea4099 100644 --- a/src/SMESH_I/SMESH_NoteBook.cxx +++ b/src/SMESH_I/SMESH_NoteBook.cxx @@ -307,6 +307,15 @@ void SMESH_NoteBook::ReplaceVariables() } } + // Case for MaxElementVolume hypothesis + else if(aStates->GetObjectType().IsEqual("MaxElementVolume")){ + if(aMethod == "SetMaxElementVolume" && aStates->GetCurrectState().size() >= 1) { + if(!aStates->GetCurrectState().at(0).IsEmpty() ) + aCmd->SetArg(1,aStates->GetCurrectState().at(0)); + aStates->IncrementState(); + } + } + // Case for NumberOfLayers hypothesis else if(aStates->GetObjectType().IsEqual("NumberOfLayers")){ if(aMethod == "SetNumberOfLayers" && aStates->GetCurrectState().size() >= 1) { diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index 043665f3d..ea33bf50c 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -4424,6 +4424,21 @@ class MaxElementArea(StdMeshers._objref_StdMeshers_MaxElementArea): #Registering the new proxy for MaxElementArea omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementArea._NP_RepositoryId, MaxElementArea) + +#Wrapper class for StdMeshers_MaxElementVolume hypothesis +class MaxElementVolume(StdMeshers._objref_StdMeshers_MaxElementVolume): + + ## Set Max Element Volume parameter value + # @param area numerical value or name of variable from notebook + def SetMaxElementVolume(self, volume): + volume ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementVolume.GetLastParameters(self),1,1,volume) + StdMeshers._objref_StdMeshers_MaxElementVolume.SetParameters(self,parameters) + StdMeshers._objref_StdMeshers_MaxElementVolume.SetMaxElementVolume(self,volume) + +#Registering the new proxy for MaxElementVolume +omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementVolume._NP_RepositoryId, MaxElementVolume) + + #Wrapper class for StdMeshers_NumberOfLayers hypothesis class NumberOfLayers(StdMeshers._objref_StdMeshers_NumberOfLayers): diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 0af1d8aa5..c7b62ea14 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -446,6 +446,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const StdMeshers::StdMeshers_MaxElementVolume::_narrow( hypothesis() ); h->SetMaxElementVolume( params[0].myValue.toDouble() ); + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); } else if( hypType()=="StartEndLength" ) { @@ -623,7 +624,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const StdMeshers::StdMeshers_MaxElementVolume::_narrow( hyp ); item.myName = tr( "SMESH_MAX_ELEMENT_VOLUME_PARAM" ); - item.myValue = h->GetMaxElementVolume(); + if(!initVariableName(aParameters,item,0)) + item.myValue = h->GetMaxElementVolume(); p.append( item ); } else if( hypType()=="StartEndLength" )