-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "SMESH_Mesh.hxx"
#include "SMESHDS_Group.hxx"
#include "SMESHDS_GroupOnGeom.hxx"
+#include "SMESHDS_GroupOnFilter.hxx"
//=============================================================================
/*!
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);
+}
+
+//================================================================================
+/*!
+ * \brief Constructor accesible to SMESH_Mesh only
+ */
+//================================================================================
+
+SMESH_Group::SMESH_Group (SMESHDS_GroupBase* groupDS): myGroupDS( groupDS )
+{
+ if ( myGroupDS )
+ myName = myGroupDS->GetStoreName();
}
//=============================================================================