*/
//================================================================================
-static bool sameGroupType( const _pyID& grpID,
- const TCollection_AsciiString& theType)
-{
- // define group type as smesh.Mesh.Group() does
- int type = -1;
- SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
- SALOMEDS::SObject_var aSObj = study->FindObjectID( grpID.ToCString() );
- if ( !aSObj->_is_nil() ) {
- GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( aSObj->GetObject() );
- if ( !aGeomObj->_is_nil() ) {
- switch ( aGeomObj->GetShapeType() ) {
- case GEOM::VERTEX: type = SMESH::NODE; break;
- case GEOM::EDGE: type = SMESH::EDGE; break;
- case GEOM::FACE: type = SMESH::FACE; break;
- case GEOM::SOLID:
- case GEOM::SHELL: type = SMESH::VOLUME; break;
- case GEOM::COMPOUND: {
- GEOM::GEOM_Gen_ptr aGeomGen = SMESH_Gen_i::GetSMESHGen()->GetGeomEngine();
- if ( !aGeomGen->_is_nil() ) {
- GEOM::GEOM_IGroupOperations_var aGrpOp =
- aGeomGen->GetIGroupOperations( study->StudyId() );
- if ( !aGrpOp->_is_nil() ) {
- switch ( aGrpOp->GetType( aGeomObj )) {
- case TopAbs_VERTEX: type = SMESH::NODE; break;
- case TopAbs_EDGE: type = SMESH::EDGE; break;
- case TopAbs_FACE: type = SMESH::FACE; break;
- case TopAbs_SOLID: type = SMESH::VOLUME; break;
- default:;
- }
- }
- }
- }
- default:;
- }
- }
- }
- if ( type < 0 ) {
- MESSAGE("Type of the group " << grpID << " not found");
- return false;
- }
- if ( theType.IsIntegerValue() )
- return type == theType.IntegerValue();
-
- switch ( type ) {
- case SMESH::NODE: return theType.Location( "NODE", 1, theType.Length() );
- case SMESH::EDGE: return theType.Location( "EDGE", 1, theType.Length() );
- case SMESH::FACE: return theType.Location( "FACE", 1, theType.Length() );
- case SMESH::VOLUME: return theType.Location( "VOLUME", 1, theType.Length() );
- default:;
- }
- return false;
-}
+// static bool sameGroupType( const _pyID& grpID,
+// const TCollection_AsciiString& theType)
+// {
+// // define group type as smesh.Mesh.Group() does
+// int type = -1;
+// SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
+// SALOMEDS::SObject_var aSObj = study->FindObjectID( grpID.ToCString() );
+// if ( !aSObj->_is_nil() ) {
+// GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( aSObj->GetObject() );
+// if ( !aGeomObj->_is_nil() ) {
+// switch ( aGeomObj->GetShapeType() ) {
+// case GEOM::VERTEX: type = SMESH::NODE; break;
+// case GEOM::EDGE: type = SMESH::EDGE; break;
+// case GEOM::FACE: type = SMESH::FACE; break;
+// case GEOM::SOLID:
+// case GEOM::SHELL: type = SMESH::VOLUME; break;
+// case GEOM::COMPOUND: {
+// GEOM::GEOM_Gen_ptr aGeomGen = SMESH_Gen_i::GetSMESHGen()->GetGeomEngine();
+// if ( !aGeomGen->_is_nil() ) {
+// GEOM::GEOM_IGroupOperations_var aGrpOp =
+// aGeomGen->GetIGroupOperations( study->StudyId() );
+// if ( !aGrpOp->_is_nil() ) {
+// switch ( aGrpOp->GetType( aGeomObj )) {
+// case TopAbs_VERTEX: type = SMESH::NODE; break;
+// case TopAbs_EDGE: type = SMESH::EDGE; break;
+// case TopAbs_FACE: type = SMESH::FACE; break;
+// case TopAbs_SOLID: type = SMESH::VOLUME; break;
+// default:;
+// }
+// }
+// }
+// }
+// default:;
+// }
+// }
+// }
+// if ( type < 0 ) {
+// MESSAGE("Type of the group " << grpID << " not found");
+// return false;
+// }
+// if ( theType.IsIntegerValue() )
+// return type == theType.IntegerValue();
+
+// switch ( type ) {
+// case SMESH::NODE: return theType.Location( "NODE", 1, theType.Length() );
+// case SMESH::EDGE: return theType.Location( "EDGE", 1, theType.Length() );
+// case SMESH::FACE: return theType.Location( "FACE", 1, theType.Length() );
+// case SMESH::VOLUME: return theType.Location( "VOLUME", 1, theType.Length() );
+// default:;
+// }
+// return false;
+// }
//================================================================================
/*!
// ----------------------------------------------------------------------
else if ( method == "CreateGroupFromGEOM" ) {// (type, name, grp)
_pyID grp = theCommand->GetArg( 3 );
- if ( sameGroupType( grp, theCommand->GetArg( 1 )) ) { // --> Group(grp)
- theCommand->SetMethod( "Group" );
- theCommand->RemoveArgs();
- theCommand->SetArg( 1, grp );
- }
- else {
+ // VSR 24/12/2010. PAL21106: always use GroupOnGeom() function on dump
+ // next if(){...} section is commented
+ //if ( sameGroupType( grp, theCommand->GetArg( 1 )) ) { // --> Group(grp)
+ // theCommand->SetMethod( "Group" );
+ // theCommand->RemoveArgs();
+ // theCommand->SetArg( 1, grp );
+ //}
+ //else {
_pyID type = theCommand->GetArg( 1 );
_pyID name = theCommand->GetArg( 2 );
theCommand->SetMethod( "GroupOnGeom" );
theCommand->SetArg( 1, grp );
theCommand->SetArg( 2, name );
theCommand->SetArg( 3, type );
- }
+ //}
}
// ----------------------------------------------------------------------
else if ( method == "ExportToMED" || // ExportToMED() --> ExportMED()
bool isPyMeshMethod = sameMethods.Contains( method );
if ( !isPyMeshMethod )
{
- //Replace SMESH_MeshEditor "MakeGroups" functions on the Mesh
+ //Replace SMESH_MeshEditor "MakeGroups" functions by the Mesh
//functions with the flag "theMakeGroups = True" like:
//SMESH_MeshEditor.CmdMakeGroups => Mesh.Cmd(...,True)
int pos = method.Search("MakeGroups");
theCommand->SetMethod("FindCoincidentNodesOnPart");
}
// DoubleNodeElemGroupNew() -> DoubleNodeElemGroup()
- if ( !isPyMeshMethod && ( method == "DoubleNodeElemGroupNew" || method == "DoubleNodeGroupNew"))
+ // DoubleNodeGroupNew() -> DoubleNodeGroup()
+ // DoubleNodeGroupsNew() -> DoubleNodeGroups()
+ // DoubleNodeElemGroupsNew() -> DoubleNodeElemGroups()
+ if ( !isPyMeshMethod && ( method == "DoubleNodeElemGroupNew" ||
+ method == "DoubleNodeElemGroupsNew" ||
+ method == "DoubleNodeGroupNew" ||
+ method == "DoubleNodeGroupsNew"))
{
isPyMeshMethod=true;
theCommand->SetMethod( method.SubString( 1, method.Length()-3));
theCommand->SetArg(theCommand->GetNbArgs()+1,"True");
}
+ // ConvertToQuadraticObject(bool,obj) -> ConvertToQuadratic(bool,obj)
+ // ConvertFromQuadraticObject(obj) -> ConvertFromQuadratic(obj)
+ if ( !isPyMeshMethod && ( method == "ConvertToQuadraticObject" ||
+ method == "ConvertFromQuadraticObject" ))
+ {
+ isPyMeshMethod=true;
+ theCommand->SetMethod( method.SubString( 1, method.Length()-6));
+ // prevent moving creation of the converted sub-mesh to the end of the script
+ bool isFromQua = ( method.Value( 8 ) == 'F' );
+ Handle(_pySubMesh) sm = theGen->FindSubMesh( theCommand->GetArg( isFromQua ? 1 : 2 ));
+ if ( !sm.IsNull() )
+ sm->Process( theCommand );
+ }
// meshes made by *MakeMesh() methods are not wrapped by _pyMesh,
// so let _pyMesh care of it (TMP?)
//================================================================================
/*!
- * \brief Clear creatin command if no commands invoked
+ * \brief Clear creation command if no commands invoked
*/
//================================================================================