]> 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:12:22 +0000 (12:12 +0000)
committereap <eap@opencascade.com>
Thu, 23 Jun 2011 12:12:22 +0000 (12:12 +0000)
   SMESH_Group* AddGroup (const SMDSAbs_ElementType theType,
                          const char*               theName,
                          int&                      theId,
                          const TopoDS_Shape&       theShape=TopoDS_Shape(),
+                         const SMESH_PredicatePtr& thePredicate=SMESH_PredicatePtr());

src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_Mesh.hxx

index 8e22cc24d5bb57a5fa24763be100d3161fe080be..2a9b64909709ec0fea40f72aedbed524494ba309 100644 (file)
@@ -1420,12 +1420,13 @@ bool SMESH_Mesh::IsMainShape(const TopoDS_Shape& theShape) const
 SMESH_Group* SMESH_Mesh::AddGroup (const SMDSAbs_ElementType theType,
                                    const char*               theName,
                                    int&                      theId,
-                                   const TopoDS_Shape&       theShape)
+                                   const TopoDS_Shape&       theShape,
+                                   const SMESH_PredicatePtr& thePredicate)
 {
-  if (_mapGroup.find(_groupId) != _mapGroup.end())
+  if (_mapGroup.count(_groupId))
     return NULL;
   theId = _groupId;
-  SMESH_Group* aGroup = new SMESH_Group (theId, this, theType, theName, theShape);
+  SMESH_Group* aGroup = new SMESH_Group (theId, this, theType, theName, theShape, thePredicate);
   GetMeshDS()->AddGroup( aGroup->GetGroupDS() );
   _mapGroup[_groupId++] = aGroup;
   return aGroup;
index f1406685ba52b2c4976a6dbe4e78c4201a1bd05a..79fdc39187b9ef00caa81f010bdd411008ab9b2e 100644 (file)
@@ -31,6 +31,7 @@
 #include "SMESH_SMESH.hxx"
 
 #include "SMESH_Hypothesis.hxx"
+#include "SMESH_Controls.hxx"
 
 #include "SMESHDS_Mesh.hxx"
 #include "SMESHDS_Command.hxx"
@@ -260,11 +261,12 @@ public:
   int NbSubMesh() const throw(SALOME_Exception);
   
   int NbGroup() const { return _mapGroup.size(); }
-  
+
   SMESH_Group* AddGroup (const SMDSAbs_ElementType theType,
                          const char*               theName,
                          int&                      theId,
-                         const TopoDS_Shape&       theShape=TopoDS_Shape());
+                         const TopoDS_Shape&       theShape=TopoDS_Shape(),
+                         const SMESH_PredicatePtr& thePredicate=SMESH_PredicatePtr());
   
   typedef boost::shared_ptr< SMDS_Iterator<SMESH_Group*> > GroupIteratorPtr;
   GroupIteratorPtr GetGroups() const;