]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups
authoreap <eap@opencascade.com>
Thu, 23 Jun 2011 12:11:40 +0000 (12:11 +0000)
committereap <eap@opencascade.com>
Thu, 23 Jun 2011 12:11:40 +0000 (12:11 +0000)
  SMESH_Group (int                       theID,
               const SMESH_Mesh*         theMesh,
               const SMDSAbs_ElementType theType,
               const char*               theName,
               const TopoDS_Shape&       theShape = TopoDS_Shape(),
+              const SMESH_PredicatePtr& thePredicate = SMESH_PredicatePtr());

src/SMESH/SMESH_Group.cxx
src/SMESH/SMESH_Group.hxx

index 27ef1f3f79e89ccbc2098f505f002bbf44704f55..1546940b783aaa2a215f9aa70e181c786442e8ff 100644 (file)
@@ -30,6 +30,7 @@
 #include "SMESH_Mesh.hxx"
 #include "SMESHDS_Group.hxx"
 #include "SMESHDS_GroupOnGeom.hxx"
+#include "SMESHDS_GroupOnFilter.hxx"
 
 //=============================================================================
 /*!
@@ -41,18 +42,24 @@ SMESH_Group::SMESH_Group (int                       theID,
                           const SMESH_Mesh*         theMesh,
                           const SMDSAbs_ElementType theType,
                           const char*               theName,
-                          const TopoDS_Shape&       theShape)
+                          const TopoDS_Shape&       theShape,
+                          const SMESH_PredicatePtr& thePredicate)
      : myName(theName)
 {
-  if ( theShape.IsNull() )
-    myGroupDS = new SMESHDS_Group (theID,
-                                   const_cast<SMESH_Mesh*>(theMesh)->GetMeshDS(),
-                                   theType);
-  else
+  if ( !theShape.IsNull() )
     myGroupDS = new SMESHDS_GroupOnGeom (theID,
                                          const_cast<SMESH_Mesh*>(theMesh)->GetMeshDS(),
                                          theType,
                                          theShape);
+  else if ( thePredicate )
+    myGroupDS = new SMESHDS_GroupOnFilter (theID,
+                                           const_cast<SMESH_Mesh*>(theMesh)->GetMeshDS(),
+                                           theType,
+                                           thePredicate);
+  else
+    myGroupDS = new SMESHDS_Group (theID,
+                                   const_cast<SMESH_Mesh*>(theMesh)->GetMeshDS(),
+                                   theType);
 }
 
 //=============================================================================
index 51c4ae79675ab59618dec0f7bff8ba235baff183..3f460188b63e82ff697afd3e30f01dfaccd7f04c 100644 (file)
@@ -31,6 +31,7 @@
 #include "SMESH_SMESH.hxx"
 
 #include "SMDSAbs_ElementType.hxx"
+#include "SMESH_Controls.hxx"
 
 #include <string>
 #include <TopoDS_Shape.hxx>
@@ -46,7 +47,8 @@ class SMESH_EXPORT  SMESH_Group
                const SMESH_Mesh*         theMesh,
                const SMDSAbs_ElementType theType,
                const char*               theName,
-               const TopoDS_Shape&       theShape = TopoDS_Shape());
+               const TopoDS_Shape&       theShape = TopoDS_Shape(),
+               const SMESH_PredicatePtr& thePredicate = SMESH_PredicatePtr());
   ~SMESH_Group ();
 
   void SetName (const char* theName) { myName = theName; }