From: jfa Date: Tue, 29 Mar 2005 09:16:40 +0000 (+0000) Subject: Dump python: use special static methods of SMESH_Gen_i. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=17d6338a7eacbb06ae6dcfa36cad340f6fd9d5e3;p=modules%2Fsmesh.git Dump python: use special static methods of SMESH_Gen_i. --- diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx index 8e110318f..9c142aab8 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx @@ -92,16 +92,11 @@ void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength, } // Update Python script - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); - TCollection_AsciiString aStr (aSO->GetID()); - aStr += ".SetLength("; - aStr += TCollection_AsciiString((double)theLength); - aStr += ", "; - aStr += TCollection_AsciiString((int)theIsStart); - aStr += ")"; - - aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); + TCollection_AsciiString aStr, aStrLen ((double)theLength), aStrFlag ((int)theIsStart); + SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength("; + aStr += aStrLen + ", " + aStrFlag + ")"; + + SMESH_Gen_i::AddToCurrentPyScript(aStr); } //============================================================================= diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx index 548e3cf52..78ef384cc 100644 --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx @@ -92,14 +92,11 @@ void StdMeshers_Deflection1D_i::SetDeflection( CORBA::Double theValue ) } // Update Python script - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); - TCollection_AsciiString aStr (aSO->GetID()); - aStr += ".SetDeflection("; - aStr += TCollection_AsciiString((double)theValue); - aStr += ")"; + TCollection_AsciiString aStr, aStrVal ((double)theValue); + SMESH_Gen_i::AddObject(aStr, _this()) += ".SetDeflection("; + aStr += aStrVal + ")"; - aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); + SMESH_Gen_i::AddToCurrentPyScript(aStr); } //============================================================================= diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx index fb5a50bcd..fe694f7f7 100644 --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx @@ -92,14 +92,11 @@ void StdMeshers_LocalLength_i::SetLength( CORBA::Double theLength ) } // Update Python script - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); - TCollection_AsciiString aStr (aSO->GetID()); - aStr += ".SetLength("; - aStr += TCollection_AsciiString((double)theLength); - aStr += ")"; + TCollection_AsciiString aStr, aStrLen ((double)theLength); + SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength("; + aStr += aStrLen + ")"; - aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); + SMESH_Gen_i::AddToCurrentPyScript(aStr); } //============================================================================= diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx index 2cec96e03..09544be6b 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx @@ -92,14 +92,11 @@ void StdMeshers_MaxElementArea_i::SetMaxElementArea( CORBA::Double theArea ) } // Update Python script - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); - TCollection_AsciiString aStr (aSO->GetID()); - aStr += ".SetMaxElementArea("; - aStr += TCollection_AsciiString((double)theArea); - aStr += ")"; + TCollection_AsciiString aStr, aStrArea ((double)theArea); + SMESH_Gen_i::AddObject(aStr, _this()) += ".SetMaxElementArea("; + aStr += aStrArea + ")"; - aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); + SMESH_Gen_i::AddToCurrentPyScript(aStr); } //============================================================================= diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx index 59da3b201..f571bab82 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx @@ -92,14 +92,11 @@ void StdMeshers_MaxElementVolume_i::SetMaxElementVolume( CORBA::Double theVolume } // Update Python script - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); - TCollection_AsciiString aStr (aSO->GetID()); - aStr += ".SetMaxElementVolume("; - aStr += TCollection_AsciiString((double)theVolume); - aStr += ")"; - - aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); + TCollection_AsciiString aStr, aStrVol ((double)theVolume); + SMESH_Gen_i::AddObject(aStr, _this()) += ".SetMaxElementVolume("; + aStr += aStrVol + ")"; + + SMESH_Gen_i::AddToCurrentPyScript(aStr); } //============================================================================= diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index f658884e6..356d19ad3 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -92,14 +92,11 @@ void StdMeshers_NumberOfSegments_i::SetNumberOfSegments( CORBA::Long theSegments } // Update Python script - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); - TCollection_AsciiString aStr (aSO->GetID()); - aStr += ".SetNumberOfSegments("; - aStr += TCollection_AsciiString((int)theSegmentsNumber); - aStr += ")"; - - aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); + TCollection_AsciiString aStr, aStrNb ((int)theSegmentsNumber); + SMESH_Gen_i::AddObject(aStr, _this()) += ".SetNumberOfSegments("; + aStr += aStrNb + ")"; + + SMESH_Gen_i::AddToCurrentPyScript(aStr); } //============================================================================= diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx index f61058656..1d175ea63 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx @@ -93,16 +93,11 @@ void StdMeshers_StartEndLength_i::SetLength(CORBA::Double theLength, } // Update Python script - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); - TCollection_AsciiString aStr (aSO->GetID()); - aStr += ".SetLength("; - aStr += TCollection_AsciiString((double)theLength); - aStr += ", "; - aStr += TCollection_AsciiString((int)theIsStart); - aStr += ")"; + TCollection_AsciiString aStr, aStrLen ((double)theLength), aStrFlag ((int)theIsStart); + SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength("; + aStr += aStrLen + ", " + aStrFlag + ")"; - aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); + SMESH_Gen_i::AddToCurrentPyScript(aStr); } //=============================================================================