From 16aefcb790904af961ab38a73c7cb55a45139ccb Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 29 Aug 2013 10:45:59 +0000 Subject: [PATCH] 0022172: [CEA 790] create the groups corresponding to domains "To make groups of domains" option is by default on for a mesh w/o shape and off for a mesh on shape --- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx | 7 ++--- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx | 2 +- src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx | 28 ++++++++++---------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index ac76a9d..29cd1e1 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -1376,14 +1376,15 @@ bool GHS3DPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS //================================================================================ /*! - * \brief Return false + * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not */ //================================================================================ bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& /*dflts*/, - const SMESH_Mesh* /*theMesh*/) + const SMESH_Mesh* theMesh) { - return false; + myToMakeGroupsOfDomains = ( !theMesh || !theMesh->HasShapeToMesh() ); + return true; } //================================================================================ diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx index f3b2028..de11dc9 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx @@ -319,7 +319,7 @@ public: virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); /*! - * \brief Does nothing + * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not */ virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index ce53a9d..6d7ed26 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx @@ -951,8 +951,8 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo MESSAGE("Required type is FACE"); break; default: - MESSAGE("Incompatible required type: " << theType); - return false; + MESSAGE("Incompatible required type: " << theType); + return false; } // MESSAGE("Required type is "<GetTypes(); @@ -980,20 +980,20 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo string enfMeshName = theName; if (enfMeshName.empty()) - enfMeshName = SObj->GetName(); + enfMeshName = SObj->GetName(); if (theMesh_i) { try { - bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName); - if (theGroupName != "") { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " - << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )"; - } - else { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " - << theSource << ".GetMesh(), " << theType << " )"; - } + bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName); + if (theGroupName != "") { + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " + << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )"; + } + else { + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " + << theSource << ".GetMesh(), " << theType << " )"; + } return res; } @@ -1013,7 +1013,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo { MESSAGE("The source is a group") try { - bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); + bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); if (theGroupName != "") { SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " << theSource << ", " << theType << ", \"" << theGroupName << "\" )"; @@ -1040,7 +1040,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo { MESSAGE("The source is a group on geom") try { - bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); + bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); if (theGroupName != "") { SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " << theSource << ", " << theType << ", \"" << theGroupName << "\" )"; -- 2.39.2