mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 07:30:33 +05:00
SMESH note book
This commit is contained in:
parent
17fdea7a8c
commit
8eb6a5158a
@ -268,8 +268,9 @@ void SMESH_NoteBook::ReplaceVariables()
|
||||
aStates->IncrementState();
|
||||
}
|
||||
}
|
||||
|
||||
else if(aStates->GetObjectType().IsEqual("Arithmetic1D")) {
|
||||
// Case for Arithmetic1D or StartEndLength hypothesis
|
||||
else if(aStates->GetObjectType().IsEqual("Arithmetic1D") ||
|
||||
aStates->GetObjectType().IsEqual("StartEndLength")) {
|
||||
if(aMethod == "SetLength" &&
|
||||
aStates->GetCurrectState().size() >= 2) {
|
||||
if(aCmd->GetArg(2) == "1" && !aStates->GetCurrectState().at(0).IsEmpty())
|
||||
@ -279,6 +280,13 @@ void SMESH_NoteBook::ReplaceVariables()
|
||||
aStates->IncrementState();
|
||||
}
|
||||
}
|
||||
else if(aStates->GetObjectType().IsEqual("Deflection1D")){
|
||||
if(aMethod == "SetDeflection" && aStates->GetCurrectState().size() >= 1) {
|
||||
if(!aStates->GetCurrectState().at(0).IsEmpty() )
|
||||
aCmd->SetArg(1,aStates->GetCurrectState().at(0));
|
||||
aStates->IncrementState();
|
||||
}
|
||||
}
|
||||
// Case for LayerDistribution hypothesis (not finished yet)
|
||||
else if(aStates->GetObjectType() == "LayerDistribution") {
|
||||
if(aMethod == "SetLayerDistribution"){
|
||||
|
@ -4142,5 +4142,35 @@ class Arithmetic1D(StdMeshers._objref_StdMeshers_Arithmetic1D):
|
||||
StdMeshers._objref_StdMeshers_Arithmetic1D.SetParameters(self,parameters)
|
||||
StdMeshers._objref_StdMeshers_Arithmetic1D.SetLength(self,length,isStart)
|
||||
|
||||
#Registering the new proxy for LocalLength
|
||||
#Registering the new proxy for Arithmetic1D
|
||||
omniORB.registerObjref(StdMeshers._objref_StdMeshers_Arithmetic1D._NP_RepositoryId, Arithmetic1D)
|
||||
|
||||
#Wrapper class for StdMeshers_Deflection1D hypothesis
|
||||
class Deflection1D(StdMeshers._objref_StdMeshers_Deflection1D):
|
||||
|
||||
## Set deflection parameter value
|
||||
# @param deflection numerical value or name of variable from notebook
|
||||
def SetDeflection(self, deflection):
|
||||
deflection,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Deflection1D.GetLastParameters(self),1,1,deflection)
|
||||
StdMeshers._objref_StdMeshers_Deflection1D.SetParameters(self,parameters)
|
||||
StdMeshers._objref_StdMeshers_Deflection1D.SetDeflection(self,deflection)
|
||||
|
||||
#Registering the new proxy for Deflection1D
|
||||
omniORB.registerObjref(StdMeshers._objref_StdMeshers_StartEndLength._NP_RepositoryId, Deflection1D)
|
||||
|
||||
#Wrapper class for StdMeshers_StartEndLength hypothesis
|
||||
class StartEndLength(StdMeshers._objref_StdMeshers_StartEndLength):
|
||||
|
||||
## Set length parameter value
|
||||
# @param length numerical value or name of variable from notebook
|
||||
# @param isStart true is length is Start Length, otherwise false
|
||||
def SetLength(self, length, isStart):
|
||||
nb = 2
|
||||
if isStart:
|
||||
nb = 1
|
||||
length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_StartEndLength.GetLastParameters(self),2,nb,length)
|
||||
StdMeshers._objref_StdMeshers_StartEndLength.SetParameters(self,parameters)
|
||||
StdMeshers._objref_StdMeshers_StartEndLength.SetLength(self,length,isStart)
|
||||
|
||||
#Registering the new proxy for Arithmetic1D
|
||||
omniORB.registerObjref(StdMeshers._objref_StdMeshers_StartEndLength._NP_RepositoryId, StartEndLength)
|
||||
|
@ -453,13 +453,15 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() );
|
||||
|
||||
h->SetLength( params[0].myValue.toDouble(), true );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
h->SetLength( params[1].myValue.toDouble(), false );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
}
|
||||
else if( hypType()=="Deflection1D" )
|
||||
{
|
||||
StdMeshers::StdMeshers_Deflection1D_var h =
|
||||
StdMeshers::StdMeshers_Deflection1D::_narrow( hypothesis() );
|
||||
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
h->SetDeflection( params[0].myValue.toDouble() );
|
||||
}
|
||||
else if( hypType()=="AutomaticLength" )
|
||||
@ -652,10 +654,23 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
||||
StdMeshers::StdMeshers_StartEndLength::_narrow( hyp );
|
||||
|
||||
item.myName = tr( "SMESH_START_LENGTH_PARAM" );
|
||||
|
||||
aVaribaleName = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
|
||||
item.isVariable = !aVaribaleName.isEmpty();
|
||||
if(item.isVariable)
|
||||
item.myValue = aVaribaleName;
|
||||
else
|
||||
item.myValue = h->GetLength( true );
|
||||
p.append( item );
|
||||
|
||||
item.myName = tr( "SMESH_END_LENGTH_PARAM" );
|
||||
aVaribaleName = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString("");
|
||||
item.isVariable = !aVaribaleName.isEmpty();
|
||||
if(item.isVariable)
|
||||
item.myValue = aVaribaleName;
|
||||
else
|
||||
item.myValue = h->GetLength( false );
|
||||
|
||||
p.append( item );
|
||||
}
|
||||
else if( hypType()=="Deflection1D" )
|
||||
@ -664,6 +679,11 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
||||
StdMeshers::StdMeshers_Deflection1D::_narrow( hyp );
|
||||
|
||||
item.myName = tr( "SMESH_DEFLECTION1D_PARAM" );
|
||||
aVaribaleName = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
|
||||
item.isVariable = !aVaribaleName.isEmpty();
|
||||
if(item.isVariable)
|
||||
item.myValue = aVaribaleName;
|
||||
else
|
||||
item.myValue = h->GetDeflection();
|
||||
p.append( item );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user