0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups

SMESH_Group* AddGroup (const SMDSAbs_ElementType theType,
                          const char*               theName,
                          int&                      theId,
                          const TopoDS_Shape&       theShape=TopoDS_Shape(),
+                         const SMESH_PredicatePtr& thePredicate=SMESH_PredicatePtr());
This commit is contained in:
eap 2011-06-23 12:12:22 +00:00
parent f1c62974f6
commit b21414354c
2 changed files with 8 additions and 5 deletions

View File

@ -1420,12 +1420,13 @@ bool SMESH_Mesh::IsMainShape(const TopoDS_Shape& theShape) const
SMESH_Group* SMESH_Mesh::AddGroup (const SMDSAbs_ElementType theType, SMESH_Group* SMESH_Mesh::AddGroup (const SMDSAbs_ElementType theType,
const char* theName, const char* theName,
int& theId, 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; return NULL;
theId = _groupId; 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() ); GetMeshDS()->AddGroup( aGroup->GetGroupDS() );
_mapGroup[_groupId++] = aGroup; _mapGroup[_groupId++] = aGroup;
return aGroup; return aGroup;

View File

@ -31,6 +31,7 @@
#include "SMESH_SMESH.hxx" #include "SMESH_SMESH.hxx"
#include "SMESH_Hypothesis.hxx" #include "SMESH_Hypothesis.hxx"
#include "SMESH_Controls.hxx"
#include "SMESHDS_Mesh.hxx" #include "SMESHDS_Mesh.hxx"
#include "SMESHDS_Command.hxx" #include "SMESHDS_Command.hxx"
@ -264,7 +265,8 @@ public:
SMESH_Group* AddGroup (const SMDSAbs_ElementType theType, SMESH_Group* AddGroup (const SMDSAbs_ElementType theType,
const char* theName, const char* theName,
int& theId, 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; typedef boost::shared_ptr< SMDS_Iterator<SMESH_Group*> > GroupIteratorPtr;
GroupIteratorPtr GetGroups() const; GroupIteratorPtr GetGroups() const;