0021308: Remove hard-coded dependency of the external mesh plugins from the SMESH module

Use TVar structure to dump arguments that can be defined via
   notebook variables
This commit is contained in:
eap 2012-03-07 15:03:32 +00:00
parent 130a2297e9
commit 93e79bb6c3
3 changed files with 136 additions and 137 deletions

View File

@ -123,6 +123,7 @@
using namespace std; using namespace std;
using SMESH::TPythonDump; using SMESH::TPythonDump;
using SMESH::TVar;
#define NUM_TMP_FILES 2 #define NUM_TMP_FILES 2
@ -2425,7 +2426,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
aPythonDump << "], "; aPythonDump << "], ";
aPythonDump << theUniteIdenticalGroups << ", " aPythonDump << theUniteIdenticalGroups << ", "
<< theMergeNodesAndElements << ", " << theMergeNodesAndElements << ", "
<< theMergeTolerance << ")"; << TVar( theMergeTolerance ) << ")";
delete pPythonDump; // enable python dump from GetGroups() delete pPythonDump; // enable python dump from GetGroups()

View File

@ -75,6 +75,7 @@
using namespace std; using namespace std;
using SMESH::TPythonDump; using SMESH::TPythonDump;
using SMESH::TVar;
namespace { namespace {
@ -561,7 +562,7 @@ CORBA::Long SMESH_MeshEditor_i::AddNode(CORBA::Double x,
// Update Python script // Update Python script
TPythonDump() << "nodeID = " << this << ".AddNode( " TPythonDump() << "nodeID = " << this << ".AddNode( "
<< x << ", " << y << ", " << z << " )"; << TVar( x ) << ", " << TVar( y ) << ", " << TVar( z )<< " )";
myMesh->GetMeshDS()->Modified(); myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true ); // issue 0020693 myMesh->SetIsModified( true ); // issue 0020693
@ -1153,7 +1154,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfE
// Update Python script // Update Python script
TPythonDump() << "isDone = " << this << ".TriToQuad( " TPythonDump() << "isDone = " << this << ".TriToQuad( "
<< IDsOfElements << ", " << aNumericalFunctor << ", " << MaxAngle << " )"; << IDsOfElements << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )";
::SMESH_MeshEditor anEditor( myMesh ); ::SMESH_MeshEditor anEditor( myMesh );
@ -1188,7 +1189,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr
// Update Python script // Update Python script
aTPythonDump << "isDone = " << this << ".TriToQuadObject(" aTPythonDump << "isDone = " << this << ".TriToQuadObject("
<< theObject << ", " << aNumericalFunctor << ", " << MaxAngle << " )"; << theObject << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )";
return isDone; return isDone;
} }
@ -1482,7 +1483,7 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements,
TPythonDump() << "isDone = " << this << "." TPythonDump() << "isDone = " << this << "."
<< (IsParametric ? "SmoothParametric( " : "Smooth( ") << (IsParametric ? "SmoothParametric( " : "Smooth( ")
<< IDsOfElements << ", " << IDsOfFixedNodes << ", " << IDsOfElements << ", " << IDsOfFixedNodes << ", "
<< MaxNbOfIterations << ", " << MaxAspectRatio << ", " << TVar( MaxNbOfIterations ) << ", " << TVar( MaxAspectRatio ) << ", "
<< "SMESH.SMESH_MeshEditor." << "SMESH.SMESH_MeshEditor."
<< ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ? << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
"CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )"); "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
@ -1517,7 +1518,7 @@ SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObjec
aTPythonDump << "isDone = " << this << "." aTPythonDump << "isDone = " << this << "."
<< (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ") << (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ")
<< theObject << ", " << IDsOfFixedNodes << ", " << theObject << ", " << IDsOfFixedNodes << ", "
<< MaxNbOfIterations << ", " << MaxAspectRatio << ", " << TVar( MaxNbOfIterations ) << ", " << TVar( MaxAspectRatio ) << ", "
<< "SMESH.SMESH_MeshEditor." << "SMESH.SMESH_MeshEditor."
<< ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ? << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
"CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )"); "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
@ -1633,11 +1634,11 @@ void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElement
{ {
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".RotationSweep( " TPythonDump() << this << ".RotationSweep( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theNbOfSteps << ", " << TVar( theNbOfSteps ) << ", "
<< theTolerance << " )"; << TVar( theTolerance ) << " )";
} }
rotationSweep(theIDsOfElements, rotationSweep(theIDsOfElements,
theAxis, theAxis,
@ -1670,11 +1671,11 @@ SMESH_MeshEditor_i::RotationSweepMakeGroups(const SMESH::long_array& theIDsOfEle
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotationSweepMakeGroups( " aPythonDump << this << ".RotationSweepMakeGroups( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theNbOfSteps << ", " << TVar( theNbOfSteps ) << ", "
<< theTolerance << " )"; << TVar( theTolerance ) << " )";
} }
return aGroups; return aGroups;
} }
@ -1720,11 +1721,11 @@ void SMESH_MeshEditor_i::RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObje
{ {
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".RotationSweepObject1D( " TPythonDump() << this << ".RotationSweepObject1D( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theNbOfSteps << ", " << TVar( theNbOfSteps ) << ", "
<< theTolerance << " )"; << TVar( theTolerance ) << " )";
} }
SMESH::long_array_var anElementsId = theObject->GetIDs(); SMESH::long_array_var anElementsId = theObject->GetIDs();
rotationSweep(anElementsId, rotationSweep(anElementsId,
@ -1749,11 +1750,11 @@ void SMESH_MeshEditor_i::RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObje
{ {
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".RotationSweepObject2D( " TPythonDump() << this << ".RotationSweepObject2D( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theNbOfSteps << ", " << TVar( theNbOfSteps ) << ", "
<< theTolerance << " )"; << TVar( theTolerance ) << " )";
} }
SMESH::long_array_var anElementsId = theObject->GetIDs(); SMESH::long_array_var anElementsId = theObject->GetIDs();
rotationSweep(anElementsId, rotationSweep(anElementsId,
@ -1823,11 +1824,11 @@ SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr th
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotationSweepObject1DMakeGroups( " aPythonDump << this << ".RotationSweepObject1DMakeGroups( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theNbOfSteps << ", " << TVar( theNbOfSteps ) << ", "
<< theTolerance << " )"; << TVar( theTolerance ) << " )";
} }
return aGroups; return aGroups;
} }
@ -1857,11 +1858,11 @@ SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr th
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotationSweepObject2DMakeGroups( " aPythonDump << this << ".RotationSweepObject2DMakeGroups( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theNbOfSteps << ", " << TVar( theNbOfSteps ) << ", "
<< theTolerance << " )"; << TVar( theTolerance ) << " )";
} }
return aGroups; return aGroups;
} }
@ -1940,7 +1941,7 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false ); extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false );
if (!myPreviewMode) { if (!myPreviewMode) {
TPythonDump() << this << ".ExtrusionSweep( " TPythonDump() << this << ".ExtrusionSweep( "
<< theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )"; << theIDsOfElements << ", " << theStepVector <<", " << TVar(theNbOfSteps) << " )";
} }
} }
@ -1950,13 +1951,13 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
//======================================================================= //=======================================================================
void SMESH_MeshEditor_i::ExtrusionSweep0D(const SMESH::long_array & theIDsOfElements, void SMESH_MeshEditor_i::ExtrusionSweep0D(const SMESH::long_array & theIDsOfElements,
const SMESH::DirStruct & theStepVector, const SMESH::DirStruct & theStepVector,
CORBA::Long theNbOfSteps) CORBA::Long theNbOfSteps)
{ {
extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false, SMDSAbs_Node ); extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
if (!myPreviewMode) { if (!myPreviewMode) {
TPythonDump() << this << ".ExtrusionSweep0D( " TPythonDump() << this << ".ExtrusionSweep0D( "
<< theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )"; << theIDsOfElements << ", " << theStepVector <<", " << TVar(theNbOfSteps)<< " )";
} }
} }
@ -1990,7 +1991,7 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObj
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Node ); extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".ExtrusionSweepObject0D( " TPythonDump() << this << ".ExtrusionSweepObject0D( "
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )"; << theObject << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
} }
} }
@ -2007,7 +2008,7 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObj
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Edge ); extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Edge );
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".ExtrusionSweepObject1D( " TPythonDump() << this << ".ExtrusionSweepObject1D( "
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )"; << theObject << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
} }
} }
@ -2024,7 +2025,7 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObj
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Face ); extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Face );
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".ExtrusionSweepObject2D( " TPythonDump() << this << ".ExtrusionSweepObject2D( "
<< theObject << ", " << theStepVector << ", " << theNbOfSteps << " )"; << theObject << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
} }
} }
@ -2045,7 +2046,7 @@ SMESH_MeshEditor_i::ExtrusionSweepMakeGroups(const SMESH::long_array& theIDsOfEl
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepMakeGroups( " << theIDsOfElements aPythonDump << this << ".ExtrusionSweepMakeGroups( " << theIDsOfElements
<< ", " << theStepVector <<", " << theNbOfSteps << " )"; << ", " << theStepVector <<", " << TVar( theNbOfSteps ) << " )";
} }
return aGroups; return aGroups;
} }
@ -2057,8 +2058,8 @@ SMESH_MeshEditor_i::ExtrusionSweepMakeGroups(const SMESH::long_array& theIDsOfEl
SMESH::ListOfGroups* SMESH::ListOfGroups*
SMESH_MeshEditor_i::ExtrusionSweepMakeGroups0D(const SMESH::long_array& theIDsOfElements, SMESH_MeshEditor_i::ExtrusionSweepMakeGroups0D(const SMESH::long_array& theIDsOfElements,
const SMESH::DirStruct& theStepVector, const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps) CORBA::Long theNbOfSteps)
{ {
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups() TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
@ -2067,7 +2068,7 @@ SMESH_MeshEditor_i::ExtrusionSweepMakeGroups0D(const SMESH::long_array& theIDsOf
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepMakeGroups0D( " << theIDsOfElements aPythonDump << this << ".ExtrusionSweepMakeGroups0D( " << theIDsOfElements
<< ", " << theStepVector <<", " << theNbOfSteps << " )"; << ", " << theStepVector <<", " << TVar( theNbOfSteps ) << " )";
} }
return aGroups; return aGroups;
} }
@ -2113,7 +2114,7 @@ SMESH_MeshEditor_i::ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr t
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepObject0DMakeGroups( " << theObject aPythonDump << this << ".ExtrusionSweepObject0DMakeGroups( " << theObject
<< ", " << theStepVector << ", " << theNbOfSteps << " )"; << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
} }
return aGroups; return aGroups;
} }
@ -2136,7 +2137,7 @@ SMESH_MeshEditor_i::ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr t
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( " << theObject aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( " << theObject
<< ", " << theStepVector << ", " << theNbOfSteps << " )"; << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
} }
return aGroups; return aGroups;
} }
@ -2159,7 +2160,7 @@ SMESH_MeshEditor_i::ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr t
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( " << theObject aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( " << theObject
<< ", " << theStepVector << ", " << theNbOfSteps << " )"; << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
} }
return aGroups; return aGroups;
} }
@ -2889,17 +2890,17 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
aPythonDump << "error"; aPythonDump << "error";
aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( " aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
<< Object << ", " << Object << ", "
<< Path << ", " << Path << ", "
<< NodeStart << ", " << NodeStart << ", "
<< HasAngles << ", " << HasAngles << ", "
<< Angles << ", " << TVar( Angles ) << ", "
<< LinearVariation << ", " << LinearVariation << ", "
<< HasRefPoint << ", " << HasRefPoint << ", "
<< "SMESH.PointStruct( " << "SMESH.PointStruct( "
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", " << TVar( HasRefPoint ? RefPoint.x : 0 ) << ", "
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", " << TVar( HasRefPoint ? RefPoint.y : 0 ) << ", "
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), " << TVar( HasRefPoint ? RefPoint.z : 0 ) << " ), "
<< MakeGroups << ", " << MakeGroups << ", "
<< ElemType << " )"; << ElemType << " )";
} }
@ -2946,17 +2947,17 @@ ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
aPythonDump <<"error"; aPythonDump <<"error";
aPythonDump << " = " << this << ".ExtrusionAlongPathX( " aPythonDump << " = " << this << ".ExtrusionAlongPathX( "
<< IDsOfElements << ", " << IDsOfElements << ", "
<< Path << ", " << Path << ", "
<< NodeStart << ", " << NodeStart << ", "
<< HasAngles << ", " << HasAngles << ", "
<< Angles << ", " << TVar( Angles ) << ", "
<< LinearVariation << ", " << LinearVariation << ", "
<< HasRefPoint << ", " << HasRefPoint << ", "
<< "SMESH.PointStruct( " << "SMESH.PointStruct( "
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", " << TVar( HasRefPoint ? RefPoint.x : 0 ) << ", "
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", " << TVar( HasRefPoint ? RefPoint.y : 0 ) << ", "
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), " << TVar( HasRefPoint ? RefPoint.z : 0 ) << " ), "
<< MakeGroups << ", " << MakeGroups << ", "
<< ElemType << " )"; << ElemType << " )";
} }
@ -3122,10 +3123,10 @@ void SMESH_MeshEditor_i::Mirror(const SMESH::long_array & theIDsOfElem
{ {
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".Mirror( " TPythonDump() << this << ".Mirror( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theAxis << ", " << theAxis << ", "
<< mirrorTypeName(theMirrorType) << ", " << mirrorTypeName(theMirrorType) << ", "
<< theCopy << " )"; << theCopy << " )";
} }
if ( theIDsOfElements.length() > 0 ) if ( theIDsOfElements.length() > 0 )
{ {
@ -3148,10 +3149,10 @@ void SMESH_MeshEditor_i::MirrorObject(SMESH::SMESH_IDSource_ptr theObj
{ {
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".MirrorObject( " TPythonDump() << this << ".MirrorObject( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< mirrorTypeName(theMirrorType) << ", " << mirrorTypeName(theMirrorType) << ", "
<< theCopy << " )"; << theCopy << " )";
} }
TIDSortedElemSet elements; TIDSortedElemSet elements;
@ -3183,8 +3184,8 @@ SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array& theIDsO
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".MirrorMakeGroups( " aPythonDump << this << ".MirrorMakeGroups( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theMirror << ", " << theMirror << ", "
<< mirrorTypeName(theMirrorType) << " )"; << mirrorTypeName(theMirrorType) << " )";
} }
return aGroups; return aGroups;
@ -3211,8 +3212,8 @@ SMESH_MeshEditor_i::MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr t
{ {
DumpGroupsList(aPythonDump,aGroups); DumpGroupsList(aPythonDump,aGroups);
aPythonDump << this << ".MirrorObjectMakeGroups( " aPythonDump << this << ".MirrorObjectMakeGroups( "
<< theObject << ", " << theObject << ", "
<< theMirror << ", " << theMirror << ", "
<< mirrorTypeName(theMirrorType) << " )"; << mirrorTypeName(theMirrorType) << " )";
} }
return aGroups; return aGroups;
@ -3250,11 +3251,11 @@ SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array& theIDsOfE
if (!myPreviewMode) { if (!myPreviewMode) {
pydump << mesh << " = " << this << ".MirrorMakeMesh( " pydump << mesh << " = " << this << ".MirrorMakeMesh( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theMirror << ", " << theMirror << ", "
<< mirrorTypeName(theMirrorType) << ", " << mirrorTypeName(theMirrorType) << ", "
<< theCopyGroups << ", '" << theCopyGroups << ", '"
<< theMeshName << "' )"; << theMeshName << "' )";
} }
} }
@ -3296,11 +3297,11 @@ SMESH_MeshEditor_i::MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr the
} }
if (!myPreviewMode) { if (!myPreviewMode) {
pydump << mesh << " = " << this << ".MirrorObjectMakeMesh( " pydump << mesh << " = " << this << ".MirrorObjectMakeMesh( "
<< theObject << ", " << theObject << ", "
<< theMirror << ", " << theMirror << ", "
<< mirrorTypeName(theMirrorType) << ", " << mirrorTypeName(theMirrorType) << ", "
<< theCopyGroups << ", '" << theCopyGroups << ", '"
<< theMeshName << "' )"; << theMeshName << "' )";
} }
} }
@ -3386,8 +3387,8 @@ void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
if (!myPreviewMode) { if (!myPreviewMode) {
TPythonDump() << this << ".Translate( " TPythonDump() << this << ".Translate( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theVector << ", " << theVector << ", "
<< theCopy << " )"; << theCopy << " )";
} }
if (theIDsOfElements.length()) { if (theIDsOfElements.length()) {
TIDSortedElemSet elements; TIDSortedElemSet elements;
@ -3409,7 +3410,7 @@ void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
TPythonDump() << this << ".TranslateObject( " TPythonDump() << this << ".TranslateObject( "
<< theObject << ", " << theObject << ", "
<< theVector << ", " << theVector << ", "
<< theCopy << " )"; << theCopy << " )";
} }
TIDSortedElemSet elements; TIDSortedElemSet elements;
@ -3440,7 +3441,7 @@ SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElement
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".TranslateMakeGroups( " aPythonDump << this << ".TranslateMakeGroups( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theVector << " )"; << theVector << " )";
} }
return aGroups; return aGroups;
} }
@ -3503,9 +3504,9 @@ SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::long_array& theIDsOfElements,
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".TranslateMakeMesh( " pydump << mesh << " = " << this << ".TranslateMakeMesh( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theVector << ", " << theVector << ", "
<< theCopyGroups << ", '" << theCopyGroups << ", '"
<< theMeshName << "' )"; << theMeshName << "' )";
} }
} }
@ -3545,10 +3546,10 @@ SMESH_MeshEditor_i::TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
} }
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".TranslateObjectMakeMesh( " pydump << mesh << " = " << this << ".TranslateObjectMakeMesh( "
<< theObject << ", " << theObject << ", "
<< theVector << ", " << theVector << ", "
<< theCopyGroups << ", '" << theCopyGroups << ", '"
<< theMeshName << "' )"; << theMeshName << "' )";
} }
} }
@ -3637,9 +3638,9 @@ void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements,
if (!myPreviewMode) { if (!myPreviewMode) {
TPythonDump() << this << ".Rotate( " TPythonDump() << this << ".Rotate( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngle << ", " << TVar( theAngle ) << ", "
<< theCopy << " )"; << theCopy << " )";
} }
if (theIDsOfElements.length() > 0) if (theIDsOfElements.length() > 0)
{ {
@ -3661,10 +3662,10 @@ void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject,
{ {
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".RotateObject( " TPythonDump() << this << ".RotateObject( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngle << ", " << TVar( theAngle ) << ", "
<< theCopy << " )"; << theCopy << " )";
} }
TIDSortedElemSet elements; TIDSortedElemSet elements;
bool emptyIfIsMesh = myPreviewMode ? false : true; bool emptyIfIsMesh = myPreviewMode ? false : true;
@ -3695,8 +3696,8 @@ SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements,
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotateMakeGroups( " aPythonDump << this << ".RotateMakeGroups( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngle << " )"; << TVar( theAngle ) << " )";
} }
return aGroups; return aGroups;
} }
@ -3721,9 +3722,9 @@ SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotateObjectMakeGroups( " aPythonDump << this << ".RotateObjectMakeGroups( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngle << " )"; << TVar( theAngle ) << " )";
} }
return aGroups; return aGroups;
} }
@ -3761,11 +3762,11 @@ SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
} }
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".RotateMakeMesh( " pydump << mesh << " = " << this << ".RotateMakeMesh( "
<< theIDsOfElements << ", " << theIDsOfElements << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theCopyGroups << ", '" << theCopyGroups << ", '"
<< theMeshName << "' )"; << theMeshName << "' )";
} }
} }
@ -3808,11 +3809,11 @@ SMESH_MeshEditor_i::RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
} }
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".RotateObjectMakeMesh( " pydump << mesh << " = " << this << ".RotateObjectMakeMesh( "
<< theObject << ", " << theObject << ", "
<< theAxis << ", " << theAxis << ", "
<< theAngleInRadians << ", " << TVar( theAngleInRadians ) << ", "
<< theCopyGroups << ", '" << theCopyGroups << ", '"
<< theMeshName << "' )"; << theMeshName << "' )";
} }
} }
@ -3915,11 +3916,10 @@ void SMESH_MeshEditor_i::Scale(SMESH::SMESH_IDSource_ptr theObject,
{ {
if ( !myPreviewMode ) { if ( !myPreviewMode ) {
TPythonDump() << this << ".Scale( " TPythonDump() << this << ".Scale( "
<< theObject << ", " << theObject << ", "
<< "SMESH.PointStruct( " << thePoint.x << ", " << thePoint << ", "
<< thePoint.y << ", " << thePoint.z << " ) ," << TVar( theScaleFact ) << ", "
<< theScaleFact << ", " << theCopy << " )";
<< theCopy << " )";
} }
scale(theObject, thePoint, theScaleFact, theCopy, false); scale(theObject, thePoint, theScaleFact, theCopy, false);
} }
@ -3941,10 +3941,9 @@ SMESH_MeshEditor_i::ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
if (!myPreviewMode) { if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups); DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".Scale(" aPythonDump << this << ".Scale("
<< theObject << "," << theObject << ","
<< "SMESH.PointStruct(" <<thePoint.x << "," << thePoint << ","
<< thePoint.y << "," << thePoint.z << ")," << TVar( theScaleFact ) << ",True,True)";
<< theScaleFact << ",True,True)";
} }
return aGroups; return aGroups;
} }
@ -3978,12 +3977,11 @@ SMESH_MeshEditor_i::ScaleMakeMesh(SMESH::SMESH_IDSource_ptr theObject,
} }
if ( !myPreviewMode ) if ( !myPreviewMode )
pydump << mesh << " = " << this << ".ScaleMakeMesh( " pydump << mesh << " = " << this << ".ScaleMakeMesh( "
<< theObject << ", " << theObject << ", "
<< "SMESH.PointStruct( " << thePoint.x << ", " << thePoint << ", "
<< thePoint.y << ", " << thePoint.z << " ) ," << TVar( theScaleFact ) << ", "
<< theScaleFact << ", " << theCopyGroups << ", '"
<< theCopyGroups << ", '" << theMeshName << "' )";
<< theMeshName << "' )";
} }
// dump "GetGroups" // dump "GetGroups"
@ -4298,7 +4296,7 @@ CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long NodeID,
{ {
// Update Python script // Update Python script
TPythonDump() << "isDone = " << this << ".MoveNode( " TPythonDump() << "isDone = " << this << ".MoveNode( "
<< NodeID << ", " << x << ", " << y << ", " << z << " )"; << NodeID << ", " << TVar(x) << ", " << TVar(y) << ", " << TVar(z) << " )";
myMesh->GetMeshDS()->Modified(); myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true ); myMesh->SetIsModified( true );
} }

View File

@ -24,7 +24,6 @@
// File : SMESH_Pattern_i.cxx // File : SMESH_Pattern_i.cxx
// Created : Fri Aug 20 16:15:49 2004 // Created : Fri Aug 20 16:15:49 2004
// Author : Edward AGAPOV (eap) // Author : Edward AGAPOV (eap)
// $Header:
// //
#include "SMESH_Pattern_i.hxx" #include "SMESH_Pattern_i.hxx"
@ -47,6 +46,7 @@
#include <set> #include <set>
using SMESH::TPythonDump; using SMESH::TPythonDump;
using SMESH::TVar;
//======================================================================= //=======================================================================
//function : dumpErrorCode //function : dumpErrorCode
@ -318,7 +318,7 @@ SMESH::point_array*
// Update Python script // Update Python script
TPythonDump() << "pattern.ApplyToMeshFaces( " << theMesh << ".GetMesh(), " TPythonDump() << "pattern.ApplyToMeshFaces( " << theMesh << ".GetMesh(), "
<< theFacesIDs << ", " << theFacesIDs << ", "
<< theNodeIndexOnKeyPoint1 << ", " << theReverse << " )"; << TVar( theNodeIndexOnKeyPoint1 ) << ", " << theReverse << " )";
return points._retn(); return points._retn();
} }
@ -363,7 +363,7 @@ SMESH::point_array*
// Update Python script // Update Python script
TPythonDump() << "pattern.ApplyToHexahedrons( " << theMesh << ".GetMesh(), " TPythonDump() << "pattern.ApplyToHexahedrons( " << theMesh << ".GetMesh(), "
<< theVolumesIDs << ", " << theVolumesIDs << ", "
<< theNode000Index << ", " << theNode001Index << " )"; << TVar(theNode000Index) << ", " << TVar(theNode001Index) << " )";
return points._retn(); return points._retn();
} }