#include "Face.hxx"
#include "CdmathException.hxx"
-#include <cmath>
+#include <algorithm>
using namespace std;
void
Face::setGroupName(const string groupName)
{
- _groupNames.insert(_groupNames.begin(),groupName);
- _region=0;
+ if(std::find(_groupNames.begin(), _groupNames.end(), groupName) == _groupNames.end())//No group named groupName
+ {
+ _groupNames.insert(_groupNames.begin(),groupName);
+ _region=0;
+ }
+ else
+ cout<<"Warning Face::setGroupName, group name "<< groupName <<" is already present. No duplication"<<endl;
}
bool
void
Node::setGroupName(const std::string groupName)
{
- _groupNames.insert(_groupNames.begin(),groupName);
- _region=0;
+ if(std::find(_groupNames.begin(), _groupNames.end(), groupName) == _groupNames.end())//No group named groupName
+ {
+ _groupNames.insert(_groupNames.begin(),groupName);
+ _region=0;
+ }
+ else
+ std::cout<<"Warning Node::setGroupName, group name "<< groupName <<" is already present. No duplication"<<std::endl;
}
bool