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

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());
This commit is contained in:
eap 2011-06-23 12:11:40 +00:00
parent d73cacdd51
commit f1c62974f6
2 changed files with 16 additions and 7 deletions

View File

@ -30,6 +30,7 @@
#include "SMESH_Mesh.hxx" #include "SMESH_Mesh.hxx"
#include "SMESHDS_Group.hxx" #include "SMESHDS_Group.hxx"
#include "SMESHDS_GroupOnGeom.hxx" #include "SMESHDS_GroupOnGeom.hxx"
#include "SMESHDS_GroupOnFilter.hxx"
//============================================================================= //=============================================================================
/*! /*!
@ -41,18 +42,24 @@ SMESH_Group::SMESH_Group (int theID,
const SMESH_Mesh* theMesh, const SMESH_Mesh* theMesh,
const SMDSAbs_ElementType theType, const SMDSAbs_ElementType theType,
const char* theName, const char* theName,
const TopoDS_Shape& theShape) const TopoDS_Shape& theShape,
const SMESH_PredicatePtr& thePredicate)
: myName(theName) : myName(theName)
{ {
if ( theShape.IsNull() ) if ( !theShape.IsNull() )
myGroupDS = new SMESHDS_Group (theID,
const_cast<SMESH_Mesh*>(theMesh)->GetMeshDS(),
theType);
else
myGroupDS = new SMESHDS_GroupOnGeom (theID, myGroupDS = new SMESHDS_GroupOnGeom (theID,
const_cast<SMESH_Mesh*>(theMesh)->GetMeshDS(), const_cast<SMESH_Mesh*>(theMesh)->GetMeshDS(),
theType, theType,
theShape); 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);
} }
//============================================================================= //=============================================================================

View File

@ -31,6 +31,7 @@
#include "SMESH_SMESH.hxx" #include "SMESH_SMESH.hxx"
#include "SMDSAbs_ElementType.hxx" #include "SMDSAbs_ElementType.hxx"
#include "SMESH_Controls.hxx"
#include <string> #include <string>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
@ -46,7 +47,8 @@ class SMESH_EXPORT SMESH_Group
const SMESH_Mesh* theMesh, const SMESH_Mesh* theMesh,
const SMDSAbs_ElementType theType, const SMDSAbs_ElementType theType,
const char* theName, const char* theName,
const TopoDS_Shape& theShape = TopoDS_Shape()); const TopoDS_Shape& theShape = TopoDS_Shape(),
const SMESH_PredicatePtr& thePredicate = SMESH_PredicatePtr());
~SMESH_Group (); ~SMESH_Group ();
void SetName (const char* theName) { myName = theName; } void SetName (const char* theName) { myName = theName; }