Salome HOME
021860: EDF 2196 SMESH : Create all the groups in an extrusion operation
authoreap <eap@opencascade.com>
Fri, 11 Jan 2013 11:58:50 +0000 (11:58 +0000)
committereap <eap@opencascade.com>
Fri, 11 Jan 2013 11:58:50 +0000 (11:58 +0000)
-        void Add(const SMDS_MeshElement * theElem);
+        bool Add(const SMDS_MeshElement * theElem);

src/SMDS/SMDS_MeshGroup.cxx
src/SMDS/SMDS_MeshGroup.hxx

index b81ffe55a4dcaf614a0be982932c51e61fae2bfc..e945c285e506ad5c927e4d3a626936cd72f51e57 100644 (file)
@@ -122,17 +122,21 @@ void SMDS_MeshGroup::Clear()
 //purpose  : 
 //=======================================================================
 
-void SMDS_MeshGroup::Add(const SMDS_MeshElement * theElem)
+bool SMDS_MeshGroup::Add(const SMDS_MeshElement * theElem)
 {
   // the type of the group is determined by the first element added
-  if (myElements.empty()) myType = theElem->GetType();
+  if (myElements.empty()) {
+    myType = theElem->GetType();
+  }
   else if (theElem->GetType() != myType) {
     MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
-    return;
+    return false;
   }
         
   myElements.insert(myElements.end(), theElem);
   ++myTic;
+
+  return true;
 }
 
 //=======================================================================
index c46184ea9dac57799f8c721207b4a5f04036626a..25e9027d101f3650a12b0ffac8189b674ded8b7b 100644 (file)
@@ -46,7 +46,7 @@ class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject
 
         void SetType (const SMDSAbs_ElementType theType);
         void Clear();
-        void Add(const SMDS_MeshElement * theElem);
+        bool Add(const SMDS_MeshElement * theElem);
         bool Remove(const SMDS_MeshElement * theElem);
         bool IsEmpty() const { return myElements.empty(); }
         int Extent() const { return myElements.size(); }