Dump python: use special static methods of SMESH_Gen_i.

This commit is contained in:
jfa 2005-03-29 09:16:40 +00:00
parent e769be649b
commit 17d6338a7e
7 changed files with 28 additions and 53 deletions

View File

@ -92,16 +92,11 @@ void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength,
} }
// Update Python script // Update Python script
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); TCollection_AsciiString aStr, aStrLen ((double)theLength), aStrFlag ((int)theIsStart);
SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength(";
TCollection_AsciiString aStr (aSO->GetID()); aStr += aStrLen + ", " + aStrFlag + ")";
aStr += ".SetLength(";
aStr += TCollection_AsciiString((double)theLength);
aStr += ", ";
aStr += TCollection_AsciiString((int)theIsStart);
aStr += ")";
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); SMESH_Gen_i::AddToCurrentPyScript(aStr);
} }
//============================================================================= //=============================================================================

View File

@ -92,14 +92,11 @@ void StdMeshers_Deflection1D_i::SetDeflection( CORBA::Double theValue )
} }
// Update Python script // Update Python script
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); TCollection_AsciiString aStr, aStrVal ((double)theValue);
SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); SMESH_Gen_i::AddObject(aStr, _this()) += ".SetDeflection(";
TCollection_AsciiString aStr (aSO->GetID()); aStr += aStrVal + ")";
aStr += ".SetDeflection(";
aStr += TCollection_AsciiString((double)theValue);
aStr += ")";
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); SMESH_Gen_i::AddToCurrentPyScript(aStr);
} }
//============================================================================= //=============================================================================

View File

@ -92,14 +92,11 @@ void StdMeshers_LocalLength_i::SetLength( CORBA::Double theLength )
} }
// Update Python script // Update Python script
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); TCollection_AsciiString aStr, aStrLen ((double)theLength);
SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength(";
TCollection_AsciiString aStr (aSO->GetID()); aStr += aStrLen + ")";
aStr += ".SetLength(";
aStr += TCollection_AsciiString((double)theLength);
aStr += ")";
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); SMESH_Gen_i::AddToCurrentPyScript(aStr);
} }
//============================================================================= //=============================================================================

View File

@ -92,14 +92,11 @@ void StdMeshers_MaxElementArea_i::SetMaxElementArea( CORBA::Double theArea )
} }
// Update Python script // Update Python script
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); TCollection_AsciiString aStr, aStrArea ((double)theArea);
SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); SMESH_Gen_i::AddObject(aStr, _this()) += ".SetMaxElementArea(";
TCollection_AsciiString aStr (aSO->GetID()); aStr += aStrArea + ")";
aStr += ".SetMaxElementArea(";
aStr += TCollection_AsciiString((double)theArea);
aStr += ")";
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); SMESH_Gen_i::AddToCurrentPyScript(aStr);
} }
//============================================================================= //=============================================================================

View File

@ -92,14 +92,11 @@ void StdMeshers_MaxElementVolume_i::SetMaxElementVolume( CORBA::Double theVolume
} }
// Update Python script // Update Python script
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); TCollection_AsciiString aStr, aStrVol ((double)theVolume);
SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); SMESH_Gen_i::AddObject(aStr, _this()) += ".SetMaxElementVolume(";
TCollection_AsciiString aStr (aSO->GetID()); aStr += aStrVol + ")";
aStr += ".SetMaxElementVolume(";
aStr += TCollection_AsciiString((double)theVolume);
aStr += ")";
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); SMESH_Gen_i::AddToCurrentPyScript(aStr);
} }
//============================================================================= //=============================================================================

View File

@ -92,14 +92,11 @@ void StdMeshers_NumberOfSegments_i::SetNumberOfSegments( CORBA::Long theSegments
} }
// Update Python script // Update Python script
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); TCollection_AsciiString aStr, aStrNb ((int)theSegmentsNumber);
SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); SMESH_Gen_i::AddObject(aStr, _this()) += ".SetNumberOfSegments(";
TCollection_AsciiString aStr (aSO->GetID()); aStr += aStrNb + ")";
aStr += ".SetNumberOfSegments(";
aStr += TCollection_AsciiString((int)theSegmentsNumber);
aStr += ")";
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); SMESH_Gen_i::AddToCurrentPyScript(aStr);
} }
//============================================================================= //=============================================================================

View File

@ -93,16 +93,11 @@ void StdMeshers_StartEndLength_i::SetLength(CORBA::Double theLength,
} }
// Update Python script // Update Python script
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); TCollection_AsciiString aStr, aStrLen ((double)theLength), aStrFlag ((int)theIsStart);
SALOMEDS::SObject_var aSO = SMESH_Gen_i::ObjectToSObject(aSMESHGen->GetCurrentStudy(), _this()); SMESH_Gen_i::AddObject(aStr, _this()) += ".SetLength(";
TCollection_AsciiString aStr (aSO->GetID()); aStr += aStrLen + ", " + aStrFlag + ")";
aStr += ".SetLength(";
aStr += TCollection_AsciiString((double)theLength);
aStr += ", ";
aStr += TCollection_AsciiString((int)theIsStart);
aStr += ")";
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), aStr); SMESH_Gen_i::AddToCurrentPyScript(aStr);
} }
//============================================================================= //=============================================================================