using namespace std;
using SMESH::TPythonDump;
+using SMESH::TVar;
namespace {
// Update Python script
TPythonDump() << "nodeID = " << this << ".AddNode( "
- << x << ", " << y << ", " << z << " )";
+ << TVar( x ) << ", " << TVar( y ) << ", " << TVar( z )<< " )";
myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true ); // issue 0020693
// Update Python script
TPythonDump() << "isDone = " << this << ".TriToQuad( "
- << IDsOfElements << ", " << aNumericalFunctor << ", " << MaxAngle << " )";
+ << IDsOfElements << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )";
::SMESH_MeshEditor anEditor( myMesh );
// Update Python script
aTPythonDump << "isDone = " << this << ".TriToQuadObject("
- << theObject << ", " << aNumericalFunctor << ", " << MaxAngle << " )";
+ << theObject << ", " << aNumericalFunctor << ", " << TVar( MaxAngle ) << " )";
return isDone;
}
TPythonDump() << "isDone = " << this << "."
<< (IsParametric ? "SmoothParametric( " : "Smooth( ")
<< IDsOfElements << ", " << IDsOfFixedNodes << ", "
- << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
+ << TVar( MaxNbOfIterations ) << ", " << TVar( MaxAspectRatio ) << ", "
<< "SMESH.SMESH_MeshEditor."
<< ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
"CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
aTPythonDump << "isDone = " << this << "."
<< (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ")
<< theObject << ", " << IDsOfFixedNodes << ", "
- << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
+ << TVar( MaxNbOfIterations ) << ", " << TVar( MaxAspectRatio ) << ", "
<< "SMESH.SMESH_MeshEditor."
<< ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
"CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
{
if ( !myPreviewMode ) {
TPythonDump() << this << ".RotationSweep( "
- << theIDsOfElements << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ << theIDsOfElements << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << TVar( theNbOfSteps ) << ", "
+ << TVar( theTolerance ) << " )";
}
rotationSweep(theIDsOfElements,
theAxis,
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotationSweepMakeGroups( "
- << theIDsOfElements << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ << theIDsOfElements << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << TVar( theNbOfSteps ) << ", "
+ << TVar( theTolerance ) << " )";
}
return aGroups;
}
{
if ( !myPreviewMode ) {
TPythonDump() << this << ".RotationSweepObject1D( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ << theObject << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << TVar( theNbOfSteps ) << ", "
+ << TVar( theTolerance ) << " )";
}
SMESH::long_array_var anElementsId = theObject->GetIDs();
rotationSweep(anElementsId,
{
if ( !myPreviewMode ) {
TPythonDump() << this << ".RotationSweepObject2D( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ << theObject << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << TVar( theNbOfSteps ) << ", "
+ << TVar( theTolerance ) << " )";
}
SMESH::long_array_var anElementsId = theObject->GetIDs();
rotationSweep(anElementsId,
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotationSweepObject1DMakeGroups( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ << theObject << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << TVar( theNbOfSteps ) << ", "
+ << TVar( theTolerance ) << " )";
}
return aGroups;
}
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotationSweepObject2DMakeGroups( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ << theObject << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << TVar( theNbOfSteps ) << ", "
+ << TVar( theTolerance ) << " )";
}
return aGroups;
}
extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false );
if (!myPreviewMode) {
TPythonDump() << this << ".ExtrusionSweep( "
- << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
+ << theIDsOfElements << ", " << theStepVector <<", " << TVar(theNbOfSteps) << " )";
}
}
//=======================================================================
void SMESH_MeshEditor_i::ExtrusionSweep0D(const SMESH::long_array & theIDsOfElements,
- const SMESH::DirStruct & theStepVector,
- CORBA::Long theNbOfSteps)
+ const SMESH::DirStruct & theStepVector,
+ CORBA::Long theNbOfSteps)
{
extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
if (!myPreviewMode) {
TPythonDump() << this << ".ExtrusionSweep0D( "
- << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
+ << theIDsOfElements << ", " << theStepVector <<", " << TVar(theNbOfSteps)<< " )";
}
}
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
if ( !myPreviewMode ) {
TPythonDump() << this << ".ExtrusionSweepObject0D( "
- << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ << theObject << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
}
}
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Edge );
if ( !myPreviewMode ) {
TPythonDump() << this << ".ExtrusionSweepObject1D( "
- << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ << theObject << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
}
}
extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Face );
if ( !myPreviewMode ) {
TPythonDump() << this << ".ExtrusionSweepObject2D( "
- << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ << theObject << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
}
}
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepMakeGroups( " << theIDsOfElements
- << ", " << theStepVector <<", " << theNbOfSteps << " )";
+ << ", " << theStepVector <<", " << TVar( theNbOfSteps ) << " )";
}
return aGroups;
}
SMESH::ListOfGroups*
SMESH_MeshEditor_i::ExtrusionSweepMakeGroups0D(const SMESH::long_array& theIDsOfElements,
- const SMESH::DirStruct& theStepVector,
- CORBA::Long theNbOfSteps)
+ const SMESH::DirStruct& theStepVector,
+ CORBA::Long theNbOfSteps)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepMakeGroups0D( " << theIDsOfElements
- << ", " << theStepVector <<", " << theNbOfSteps << " )";
+ << ", " << theStepVector <<", " << TVar( theNbOfSteps ) << " )";
}
return aGroups;
}
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepObject0DMakeGroups( " << theObject
- << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
}
return aGroups;
}
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( " << theObject
- << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
}
return aGroups;
}
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( " << theObject
- << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ << ", " << theStepVector << ", " << TVar( theNbOfSteps ) << " )";
}
return aGroups;
}
aPythonDump << "error";
aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
- << Object << ", "
- << Path << ", "
- << NodeStart << ", "
- << HasAngles << ", "
- << Angles << ", "
+ << Object << ", "
+ << Path << ", "
+ << NodeStart << ", "
+ << HasAngles << ", "
+ << TVar( Angles ) << ", "
<< LinearVariation << ", "
- << HasRefPoint << ", "
+ << HasRefPoint << ", "
<< "SMESH.PointStruct( "
- << ( HasRefPoint ? RefPoint.x : 0 ) << ", "
- << ( HasRefPoint ? RefPoint.y : 0 ) << ", "
- << ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
+ << TVar( HasRefPoint ? RefPoint.x : 0 ) << ", "
+ << TVar( HasRefPoint ? RefPoint.y : 0 ) << ", "
+ << TVar( HasRefPoint ? RefPoint.z : 0 ) << " ), "
<< MakeGroups << ", "
<< ElemType << " )";
}
aPythonDump <<"error";
aPythonDump << " = " << this << ".ExtrusionAlongPathX( "
- << IDsOfElements << ", "
- << Path << ", "
- << NodeStart << ", "
- << HasAngles << ", "
- << Angles << ", "
+ << IDsOfElements << ", "
+ << Path << ", "
+ << NodeStart << ", "
+ << HasAngles << ", "
+ << TVar( Angles ) << ", "
<< LinearVariation << ", "
- << HasRefPoint << ", "
+ << HasRefPoint << ", "
<< "SMESH.PointStruct( "
- << ( HasRefPoint ? RefPoint.x : 0 ) << ", "
- << ( HasRefPoint ? RefPoint.y : 0 ) << ", "
- << ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
+ << TVar( HasRefPoint ? RefPoint.x : 0 ) << ", "
+ << TVar( HasRefPoint ? RefPoint.y : 0 ) << ", "
+ << TVar( HasRefPoint ? RefPoint.z : 0 ) << " ), "
<< MakeGroups << ", "
<< ElemType << " )";
}
{
if ( !myPreviewMode ) {
TPythonDump() << this << ".Mirror( "
- << theIDsOfElements << ", "
- << theAxis << ", "
+ << theIDsOfElements << ", "
+ << theAxis << ", "
<< mirrorTypeName(theMirrorType) << ", "
- << theCopy << " )";
+ << theCopy << " )";
}
if ( theIDsOfElements.length() > 0 )
{
{
if ( !myPreviewMode ) {
TPythonDump() << this << ".MirrorObject( "
- << theObject << ", "
- << theAxis << ", "
+ << theObject << ", "
+ << theAxis << ", "
<< mirrorTypeName(theMirrorType) << ", "
- << theCopy << " )";
+ << theCopy << " )";
}
TIDSortedElemSet elements;
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".MirrorMakeGroups( "
- << theIDsOfElements << ", "
- << theMirror << ", "
+ << theIDsOfElements << ", "
+ << theMirror << ", "
<< mirrorTypeName(theMirrorType) << " )";
}
return aGroups;
{
DumpGroupsList(aPythonDump,aGroups);
aPythonDump << this << ".MirrorObjectMakeGroups( "
- << theObject << ", "
- << theMirror << ", "
+ << theObject << ", "
+ << theMirror << ", "
<< mirrorTypeName(theMirrorType) << " )";
}
return aGroups;
if (!myPreviewMode) {
pydump << mesh << " = " << this << ".MirrorMakeMesh( "
- << theIDsOfElements << ", "
- << theMirror << ", "
+ << theIDsOfElements << ", "
+ << theMirror << ", "
<< mirrorTypeName(theMirrorType) << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
}
}
}
if (!myPreviewMode) {
pydump << mesh << " = " << this << ".MirrorObjectMakeMesh( "
- << theObject << ", "
- << theMirror << ", "
+ << theObject << ", "
+ << theMirror << ", "
<< mirrorTypeName(theMirrorType) << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
}
}
if (!myPreviewMode) {
TPythonDump() << this << ".Translate( "
<< theIDsOfElements << ", "
- << theVector << ", "
- << theCopy << " )";
+ << theVector << ", "
+ << theCopy << " )";
}
if (theIDsOfElements.length()) {
TIDSortedElemSet elements;
TPythonDump() << this << ".TranslateObject( "
<< theObject << ", "
<< theVector << ", "
- << theCopy << " )";
+ << theCopy << " )";
}
TIDSortedElemSet elements;
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".TranslateMakeGroups( "
<< theIDsOfElements << ", "
- << theVector << " )";
+ << theVector << " )";
}
return aGroups;
}
if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".TranslateMakeMesh( "
<< theIDsOfElements << ", "
- << theVector << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ << theVector << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
}
}
}
if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".TranslateObjectMakeMesh( "
- << theObject << ", "
- << theVector << ", "
+ << theObject << ", "
+ << theVector << ", "
<< theCopyGroups << ", '"
- << theMeshName << "' )";
+ << theMeshName << "' )";
}
}
if (!myPreviewMode) {
TPythonDump() << this << ".Rotate( "
<< theIDsOfElements << ", "
- << theAxis << ", "
- << theAngle << ", "
- << theCopy << " )";
+ << theAxis << ", "
+ << TVar( theAngle ) << ", "
+ << theCopy << " )";
}
if (theIDsOfElements.length() > 0)
{
{
if ( !myPreviewMode ) {
TPythonDump() << this << ".RotateObject( "
- << theObject << ", "
- << theAxis << ", "
- << theAngle << ", "
- << theCopy << " )";
+ << theObject << ", "
+ << theAxis << ", "
+ << TVar( theAngle ) << ", "
+ << theCopy << " )";
}
TIDSortedElemSet elements;
bool emptyIfIsMesh = myPreviewMode ? false : true;
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotateMakeGroups( "
<< theIDsOfElements << ", "
- << theAxis << ", "
- << theAngle << " )";
+ << theAxis << ", "
+ << TVar( theAngle ) << " )";
}
return aGroups;
}
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".RotateObjectMakeGroups( "
- << theObject << ", "
- << theAxis << ", "
- << theAngle << " )";
+ << theObject << ", "
+ << theAxis << ", "
+ << TVar( theAngle ) << " )";
}
return aGroups;
}
}
if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".RotateMakeMesh( "
- << theIDsOfElements << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ << theIDsOfElements << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
}
}
}
if ( !myPreviewMode ) {
pydump << mesh << " = " << this << ".RotateObjectMakeMesh( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ << theObject << ", "
+ << theAxis << ", "
+ << TVar( theAngleInRadians ) << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
}
}
{
if ( !myPreviewMode ) {
TPythonDump() << this << ".Scale( "
- << theObject << ", "
- << "SMESH.PointStruct( " << thePoint.x << ", "
- << thePoint.y << ", " << thePoint.z << " ) ,"
- << theScaleFact << ", "
- << theCopy << " )";
+ << theObject << ", "
+ << thePoint << ", "
+ << TVar( theScaleFact ) << ", "
+ << theCopy << " )";
}
scale(theObject, thePoint, theScaleFact, theCopy, false);
}
if (!myPreviewMode) {
DumpGroupsList(aPythonDump, aGroups);
aPythonDump << this << ".Scale("
- << theObject << ","
- << "SMESH.PointStruct(" <<thePoint.x << ","
- << thePoint.y << "," << thePoint.z << "),"
- << theScaleFact << ",True,True)";
+ << theObject << ","
+ << thePoint << ","
+ << TVar( theScaleFact ) << ",True,True)";
}
return aGroups;
}
}
if ( !myPreviewMode )
pydump << mesh << " = " << this << ".ScaleMakeMesh( "
- << theObject << ", "
- << "SMESH.PointStruct( " << thePoint.x << ", "
- << thePoint.y << ", " << thePoint.z << " ) ,"
- << theScaleFact << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ << theObject << ", "
+ << thePoint << ", "
+ << TVar( theScaleFact ) << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
}
// dump "GetGroups"
{
// Update Python script
TPythonDump() << "isDone = " << this << ".MoveNode( "
- << NodeID << ", " << x << ", " << y << ", " << z << " )";
+ << NodeID << ", " << TVar(x) << ", " << TVar(y) << ", " << TVar(z) << " )";
myMesh->GetMeshDS()->Modified();
myMesh->SetIsModified( true );
}