CORBA::Long theNbOfSteps,
CORBA::Double theTolerance)
{
+ SMESH::ListOfGroups *aGroups = rotationSweep(theIDsOfElements,
+ theAxis,
+ theAngleInRadians,
+ theNbOfSteps,
+ theTolerance,
+ true);
if ( !myPreviewMode ) {
- TPythonDump() << "axis = " << theAxis;
- TPythonDump() << this << ".RotationSweepMakeGroups( "
- << theIDsOfElements
- << ", axis, "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ TPythonDump()<< "axis = " << theAxis;
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump<< this << ".RotationSweepMakeGroups( "
+ << theIDsOfElements
+ << ", axis, "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
- return rotationSweep(theIDsOfElements,
- theAxis,
- theAngleInRadians,
- theNbOfSteps,
- theTolerance,
- true);
+ return aGroups;
}
//=======================================================================
CORBA::Long theNbOfSteps,
CORBA::Double theTolerance)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
+ theAxis,
+ theAngleInRadians,
+ theNbOfSteps,
+ theTolerance,
+ true);
if ( !myPreviewMode ) {
TPythonDump() << "axis = " << theAxis;
- TPythonDump() << this << ".RotationSweepObjectMakeGroups( "
- << theObject
- << ", axis, "
- << theAngleInRadians << ", "
- << theNbOfSteps << ", "
- << theTolerance << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump<< this << ".RotationSweepObjectMakeGroups( "
+ << theObject
+ << ", axis, "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return rotationSweep(anElementsId,
- theAxis,
- theAngleInRadians,
- theNbOfSteps,
- theTolerance,
- true);
+ return aGroups;
}
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
+ SMESH::ListOfGroups* aGroups = extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, true );
+
if ( !myPreviewMode ) {
TPythonDump() << "stepVector = " << theStepVector;
- TPythonDump() << this << ".ExtrusionSweepMakeGroups( "
- << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".ExtrusionSweepMakeGroups( "
+ << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
}
- return extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, true );
+ return aGroups;
}
//=======================================================================
//function : ExtrusionSweepObjectMakeGroups
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
+
if ( !myPreviewMode ) {
TPythonDump() << "stepVector = " << theStepVector;
- TPythonDump() << this << ".ExtrusionSweepObjectMakeGroups( "
- << theObject << ", stepVector, " << theNbOfSteps << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump<< this << ".ExtrusionSweepObjectMakeGroups( "
+ << theObject << ", stepVector, " << theNbOfSteps << " )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
+ return aGroups;
}
//=======================================================================
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Edge );
if ( !myPreviewMode ) {
TPythonDump() << "stepVector = " << theStepVector;
- TPythonDump() << this << ".ExtrusionSweepObject1DMakeGroups( "
- << theObject << ", stepVector, " << theNbOfSteps << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( "
+ << theObject << ", stepVector, " << theNbOfSteps << " )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Edge );
+ return aGroups;
}
//=======================================================================
const SMESH::DirStruct& theStepVector,
CORBA::Long theNbOfSteps)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Face );
if ( !myPreviewMode ) {
TPythonDump() << "stepVector = " << theStepVector;
- TPythonDump() << this << ".ExtrusionSweepObject2DMakeGroups( "
- << theObject << ", stepVector, " << theNbOfSteps << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( "
+ << theObject << ", stepVector, " << theNbOfSteps << " )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Face );
+ return aGroups;
}
CORBA::Long theExtrFlags,
CORBA::Double theSewTolerance)
{
+ SMESH::ListOfGroups * aGroups = advancedExtrusion( theIDsOfElements,
+ theStepVector,
+ theNbOfSteps,
+ theExtrFlags,
+ theSewTolerance,
+ true);
+
if ( !myPreviewMode ) {
TPythonDump() << "stepVector = " << theStepVector;
- TPythonDump() << this << ".AdvancedExtrusionMakeGroups("
- << theIDsOfElements
- << ", stepVector, "
- << theNbOfSteps << ","
- << theExtrFlags << ", "
- << theSewTolerance << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".AdvancedExtrusionMakeGroups("
+ << theIDsOfElements
+ << ", stepVector, "
+ << theNbOfSteps << ","
+ << theExtrFlags << ", "
+ << theSewTolerance << " )";
}
- return advancedExtrusion( theIDsOfElements,
- theStepVector,
- theNbOfSteps,
- theExtrFlags,
- theSewTolerance,
- true);
+ return aGroups;
}
const SMESH::PointStruct& theRefPoint,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ SMESH::ListOfGroups * aGroups = extrusionAlongPath( theIDsOfElements,
+ thePathMesh,
+ thePathShape,
+ theNodeStart,
+ theHasAngles,
+ theAngles,
+ theHasRefPoint,
+ theRefPoint,
+ true,
+ Error);
if ( !myPreviewMode ) {
TPythonDump() << "rotAngles = " << theAngles;
else
TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
- TPythonDump() << "groups = " << this << ".ExtrusionAlongPathMakeGroups( "
- << theIDsOfElements << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << "rotAngles" << ", "
- << theHasRefPoint << ", refPoint )";
+ bool isDumpGroups = aGroups && aGroups->length() > 0;
+ TPythonDump aPythonDump;
+ if(isDumpGroups) {
+ aPythonDump << "("<<aGroups;
+ }
+ if(isDumpGroups)
+ aPythonDump << ", error)";
+ else
+ aPythonDump <<"error";
+
+ aPythonDump<<" = "<< this << ".ExtrusionAlongPathMakeGroups( "
+ << theIDsOfElements << ", "
+ << thePathMesh << ", "
+ << thePathShape << ", "
+ << theNodeStart << ", "
+ << theHasAngles << ", "
+ << "rotAngles" << ", "
+ << theHasRefPoint << ", refPoint )";
}
- return extrusionAlongPath( theIDsOfElements,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- true,
- Error);
+ return aGroups;
}
//=======================================================================
const SMESH::PointStruct& theRefPoint,
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
+ thePathMesh,
+ thePathShape,
+ theNodeStart,
+ theHasAngles,
+ theAngles,
+ theHasRefPoint,
+ theRefPoint,
+ true,
+ Error);
+
if ( !myPreviewMode ) {
TPythonDump() << "rotAngles = " << theAngles;
<< theRefPoint.z << " )";
else
TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
+
+ bool isDumpGroups = aGroups && aGroups->length() > 0;
+ TPythonDump aPythonDump;
+ if(isDumpGroups) {
+ aPythonDump << "("<<aGroups;
+ }
+ if(isDumpGroups)
+ aPythonDump << ", error)";
+ else
+ aPythonDump <<"error";
- TPythonDump() << "groups = " << this << ".ExtrusionAlongPathObjectMakeGroups( "
- << theObject << ", "
- << thePathMesh << ", "
- << thePathShape << ", "
- << theNodeStart << ", "
- << theHasAngles << ", "
- << "rotAngles" << ", "
- << theHasRefPoint << ", refPoint )";
+ aPythonDump << " = " << this << ".ExtrusionAlongPathObjectMakeGroups( "
+ << theObject << ", "
+ << thePathMesh << ", "
+ << thePathShape << ", "
+ << theNodeStart << ", "
+ << theHasAngles << ", "
+ << "rotAngles" << ", "
+ << theHasRefPoint << ", refPoint )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return extrusionAlongPath( anElementsId,
- thePathMesh,
- thePathShape,
- theNodeStart,
- theHasAngles,
- theAngles,
- theHasRefPoint,
- theRefPoint,
- true,
- Error);
+ return aGroups;
}
//================================================================================
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
{
+ SMESH::ListOfGroups * aGroups = mirror(theIDsOfElements, theMirror, theMirrorType, true, true);
if ( !myPreviewMode ) {
- TPythonDump() << this << ".MirrorMakeGroups( "
- << theIDsOfElements << ", "
- << theMirror << ", "
- << mirrorTypeName(theMirrorType) << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".MirrorMakeGroups( "
+ << theIDsOfElements << ", "
+ << theMirror << ", "
+ << mirrorTypeName(theMirrorType) << " )";
}
- return mirror(theIDsOfElements, theMirror, theMirrorType, true, true);
+ return aGroups;
}
//=======================================================================
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = mirror(anElementsId, theMirror, theMirrorType, true, true);
if ( !myPreviewMode ) {
- TPythonDump() << this << ".MirrorObjectMakeGroups( "
- << theObject << ", "
- << theMirror << ", "
- << mirrorTypeName(theMirrorType) << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".MirrorObjectMakeGroups( "
+ << theObject << ", "
+ << theMirror << ", "
+ << mirrorTypeName(theMirrorType) << " )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return mirror(anElementsId, theMirror, theMirrorType, true, true);
+ return aGroups;
}
//=======================================================================
CORBA::Boolean theCopyGroups,
const char* theMeshName)
{
- TPythonDump pydump; // to prevent dump at mesh creation
-
- SMESH::SMESH_Mesh_var mesh = makeMesh( theMeshName );
- if ( SMESH_Mesh_i* mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh ))
- {
- mirror(theIDsOfElements, theMirror, theMirrorType,
- false, theCopyGroups, & mesh_i->GetImpl());
- mesh_i->CreateGroupServants();
+ SMESH_Mesh_i* mesh_i;
+ SMESH::SMESH_Mesh_var mesh;
+ { // open new scope to dump "MakeMesh" command
+ // and then "GetGroups" using SMESH_Mesh::GetGroups()
+
+ TPythonDump pydump; // to prevent dump at mesh creation
+
+ mesh = makeMesh( theMeshName );
+ mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
+ if (mesh_i) {
+ mirror(theIDsOfElements, theMirror, theMirrorType,
+ false, theCopyGroups, & mesh_i->GetImpl());
+ mesh_i->CreateGroupServants();
+ }
+
+ if ( !myPreviewMode ) {
+ pydump << mesh << " = " << this << ".MirrorMakeMesh( "
+ << theIDsOfElements << ", "
+ << theMirror << ", "
+ << mirrorTypeName(theMirrorType) << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
+ }
}
- if ( !myPreviewMode ) {
- pydump << mesh << " = " << this << ".MirrorMakeMesh( "
- << theIDsOfElements << ", "
- << theMirror << ", "
- << mirrorTypeName(theMirrorType) << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
- }
+ //dump "GetGroups"
+ if(!myPreviewMode && mesh_i)
+ mesh_i->GetGroups();
+
return mesh._retn();
}
CORBA::Boolean theCopyGroups,
const char* theMeshName)
{
- TPythonDump pydump; // to prevent dump at mesh creation
+ SMESH_Mesh_i* mesh_i;
+ SMESH::SMESH_Mesh_var mesh;
+ { // open new scope to dump "MakeMesh" command
+ // and then "GetGroups" using SMESH_Mesh::GetGroups()
+
+ TPythonDump pydump; // to prevent dump at mesh creation
+
+ mesh = makeMesh( theMeshName );
+ mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
+ if ( mesh_i ) {
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ mirror(anElementsId, theMirror, theMirrorType,
+ false, theCopyGroups, & mesh_i->GetImpl());
+ mesh_i->CreateGroupServants();
+ }
- SMESH::SMESH_Mesh_var mesh = makeMesh( theMeshName );
- if ( SMESH_Mesh_i* mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh ))
- {
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- mirror(anElementsId, theMirror, theMirrorType,
- false, theCopyGroups, & mesh_i->GetImpl());
- mesh_i->CreateGroupServants();
- }
- if ( !myPreviewMode ) {
- pydump << mesh << " = " << this << ".MirrorObjectMakeMesh( "
- << theObject << ", "
- << theMirror << ", "
- << mirrorTypeName(theMirrorType) << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
- }
+ if ( !myPreviewMode ) {
+ pydump << mesh << " = " << this << ".MirrorObjectMakeMesh( "
+ << theObject << ", "
+ << theMirror << ", "
+ << mirrorTypeName(theMirrorType) << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
+ }
+ }
+
+ //dump "GetGroups"
+ if(!myPreviewMode && mesh_i)
+ mesh_i->GetGroups();
+
return mesh._retn();
}
SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElements,
const SMESH::DirStruct& theVector)
{
+ SMESH::ListOfGroups * aGroups = translate(theIDsOfElements,theVector,true,true);
if ( !myPreviewMode ) {
TPythonDump() << "vector = " << theVector;
- TPythonDump() << this << ".TranslateMakeGroups( "
- << theIDsOfElements
- << ", vector )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".TranslateMakeGroups( "
+ << theIDsOfElements
+ << ", vector )";
}
- return translate(theIDsOfElements,theVector,true,true);
+ return aGroups;
}
//=======================================================================
SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct& theVector)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = translate(anElementsId, theVector, true, true);
+
if ( !myPreviewMode ) {
+
TPythonDump() << "vector = " << theVector;
- TPythonDump() << this << ".TranslateObjectMakeGroups( "
- << theObject
- << ", vector )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".TranslateObjectMakeGroups( "
+ << theObject
+ << ", vector )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return translate(anElementsId, theVector, true, true);
+ return aGroups;
}
//=======================================================================
CORBA::Boolean theCopyGroups,
const char* theMeshName)
{
- TPythonDump pydump; // to prevent dump at mesh creation
- SMESH::SMESH_Mesh_var mesh = makeMesh( theMeshName );
+ SMESH_Mesh_i* mesh_i;
+ SMESH::SMESH_Mesh_var mesh;
+
+ { // open new scope to dump "MakeMesh" command
+ // and then "GetGroups" using SMESH_Mesh::GetGroups()
- if ( SMESH_Mesh_i* mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh )) {
- translate(theIDsOfElements, theVector,
- false, theCopyGroups, & mesh_i->GetImpl());
- mesh_i->CreateGroupServants();
- }
- if ( !myPreviewMode ) {
- pydump << mesh << " = " << this << ".TranslateMakeMesh( "
- << theIDsOfElements << ", "
- << theVector << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ TPythonDump pydump; // to prevent dump at mesh creation
+
+ mesh = makeMesh( theMeshName );
+ mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
+
+ if ( mesh_i ) {
+ translate(theIDsOfElements, theVector,
+ false, theCopyGroups, & mesh_i->GetImpl());
+ mesh_i->CreateGroupServants();
+ }
+
+ if ( !myPreviewMode ) {
+ pydump << mesh << " = " << this << ".TranslateMakeMesh( "
+ << theIDsOfElements << ", "
+ << theVector << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
+ }
}
+
+ //dump "GetGroups"
+ if(!myPreviewMode && mesh_i)
+ mesh_i->GetGroups();
+
return mesh._retn();
}
CORBA::Boolean theCopyGroups,
const char* theMeshName)
{
- TPythonDump pydump; // to prevent dump at mesh creation
- SMESH::SMESH_Mesh_var mesh = makeMesh( theMeshName );
-
- if ( SMESH_Mesh_i* mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh )) {
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- translate(anElementsId, theVector,
- false, theCopyGroups, & mesh_i->GetImpl());
- mesh_i->CreateGroupServants();
- }
- if ( !myPreviewMode ) {
- pydump << mesh << " = " << this << ".TranslateObjectMakeMesh( "
- << theObject << ", "
- << theVector << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ SMESH_Mesh_i* mesh_i;
+ SMESH::SMESH_Mesh_var mesh;
+ { // open new scope to dump "MakeMesh" command
+ // and then "GetGroups" using SMESH_Mesh::GetGroups()
+
+ TPythonDump pydump; // to prevent dump at mesh creation
+ mesh = makeMesh( theMeshName );
+ mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
+
+ if ( mesh_i ) {
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ translate(anElementsId, theVector,
+ false, theCopyGroups, & mesh_i->GetImpl());
+ mesh_i->CreateGroupServants();
+ }
+ if ( !myPreviewMode ) {
+ pydump << mesh << " = " << this << ".TranslateObjectMakeMesh( "
+ << theObject << ", "
+ << theVector << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
+ }
}
+
+ //dump "GetGroups"
+ if(!myPreviewMode && mesh_i)
+ mesh_i->GetGroups();
+
return mesh._retn();
}
const SMESH::AxisStruct& theAxis,
CORBA::Double theAngle)
{
+ SMESH::ListOfGroups * aGroups = rotate(theIDsOfElements,theAxis,theAngle,true,true);
if ( !myPreviewMode ) {
TPythonDump() << "axis = " << theAxis;
- TPythonDump() << this << ".RotateMakeGroups( "
- << theIDsOfElements
- << ", axis, "
- << theAngle << " )";
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".RotateMakeGroups( "
+ << theIDsOfElements
+ << ", axis, "
+ << theAngle << " )";
}
- return rotate(theIDsOfElements,theAxis,theAngle,true,true);
+ return aGroups;
}
//=======================================================================
const SMESH::AxisStruct& theAxis,
CORBA::Double theAngle)
{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = rotate(anElementsId,theAxis,theAngle,true,true);
+
if ( !myPreviewMode ) {
TPythonDump() << "axis = " << theAxis;
- TPythonDump() << this << ".RotateObjectMakeGroups( "
+ TPythonDump aPythonDump;
+ DumpGroupsList(aPythonDump,aGroups);
+ aPythonDump << this << ".RotateObjectMakeGroups( "
<< theObject
<< ", axis, "
<< theAngle << " )";
}
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- return rotate(anElementsId,theAxis,theAngle,true,true);
+ return aGroups;
}
//=======================================================================
CORBA::Boolean theCopyGroups,
const char* theMeshName)
{
- TPythonDump pydump; // to prevent dump at mesh creation
- SMESH::SMESH_Mesh_var mesh = makeMesh( theMeshName );
+ SMESH::SMESH_Mesh_var mesh;
+ SMESH_Mesh_i* mesh_i;
- if ( SMESH_Mesh_i* mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh )) {
- rotate(theIDsOfElements, theAxis, theAngleInRadians,
- false, theCopyGroups, & mesh_i->GetImpl());
- mesh_i->CreateGroupServants();
- }
- if ( !myPreviewMode ) {
- pydump << mesh << " = " << this << ".RotateMakeMesh( "
- << theIDsOfElements << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ { // open new scope to dump "MakeMesh" command
+ // and then "GetGroups" using SMESH_Mesh::GetGroups()
+
+ TPythonDump pydump; // to prevent dump at mesh creation
+
+ mesh = makeMesh( theMeshName );
+ mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
+
+ if ( mesh_i ) {
+ rotate(theIDsOfElements, theAxis, theAngleInRadians,
+ false, theCopyGroups, & mesh_i->GetImpl());
+ mesh_i->CreateGroupServants();
+ }
+ if ( !myPreviewMode ) {
+ pydump << mesh << " = " << this << ".RotateMakeMesh( "
+ << theIDsOfElements << ", "
+ << theAxis << ", "
+ << theAngleInRadians << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
+ }
}
+
+ //dump "GetGroups"
+ if(!myPreviewMode && mesh_i)
+ mesh_i->GetGroups();
+
return mesh._retn();
}
CORBA::Boolean theCopyGroups,
const char* theMeshName)
{
- TPythonDump pydump; // to prevent dump at mesh creation
- SMESH::SMESH_Mesh_var mesh = makeMesh( theMeshName );
-
- if ( SMESH_Mesh_i* mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh )) {
- SMESH::long_array_var anElementsId = theObject->GetIDs();
- rotate(anElementsId, theAxis, theAngleInRadians,
- false, theCopyGroups, & mesh_i->GetImpl());
- mesh_i->CreateGroupServants();
- }
- if ( !myPreviewMode ) {
- pydump << mesh << " = " << this << ".RotateObjectMakeMesh( "
- << theObject << ", "
- << theAxis << ", "
- << theAngleInRadians << ", "
- << theCopyGroups << ", '"
- << theMeshName << "' )";
+ SMESH::SMESH_Mesh_var mesh;
+ SMESH_Mesh_i* mesh_i;
+
+ {// open new scope to dump "MakeMesh" command
+ // and then "GetGroups" using SMESH_Mesh::GetGroups()
+
+ TPythonDump pydump; // to prevent dump at mesh creation
+ mesh = makeMesh( theMeshName );
+ mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
+
+ if (mesh_i ) {
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ rotate(anElementsId, theAxis, theAngleInRadians,
+ false, theCopyGroups, & mesh_i->GetImpl());
+ mesh_i->CreateGroupServants();
+ }
+ if ( !myPreviewMode ) {
+ pydump << mesh << " = " << this << ".RotateObjectMakeMesh( "
+ << theObject << ", "
+ << theAxis << ", "
+ << theAngleInRadians << ", "
+ << theCopyGroups << ", '"
+ << theMeshName << "' )";
+ }
}
+
+ //dump "GetGroups"
+ if(!myPreviewMode && mesh_i)
+ mesh_i->GetGroups();
+
return mesh._retn();
}
return mesh._retn();
}
+
+//=======================================================================
+//function : DumpGroupsList
+//purpose :
+//=======================================================================
+void SMESH_MeshEditor_i::DumpGroupsList(TPythonDump & theDumpPython,
+ const SMESH::ListOfGroups * theGroupList)
+{
+ bool isDumpGroupList = theGroupList && theGroupList->length() > 0;
+ if(isDumpGroupList) {
+ theDumpPython << theGroupList << " = ";
+ }
+}