]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
0022172: [CEA 790] create the groups corresponding to domains
authoreap <eap@opencascade.com>
Thu, 29 Aug 2013 10:45:59 +0000 (10:45 +0000)
committereap <eap@opencascade.com>
Thu, 29 Aug 2013 10:45:59 +0000 (10:45 +0000)
   "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
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx

index ac76a9d1735afcf38556e61052d330576b3e4809..29cd1e16fb30e0979a1fce5556d17dac68ad210c 100644 (file)
@@ -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;
 }
 
 //================================================================================
index f3b202890534dcc0578e6aab88c864be91f6bcc5..de11dc984367da3bf3a9a3f6fdf8cbeaa6959e96 100644 (file)
@@ -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);
 
index ce53a9d5d4e85cfa3c6daa493c6db3fa943d6935..6d7ed26e66e921d6a1bce75c4bbcbfe9fcb15550 100644 (file)
@@ -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 "<<theType);
   SMESH::array_of_ElementType_var types = theSource->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 << "\" )";