SMDS_MeshGroup::SMDS_MeshGroup(const SMDS_Mesh * theMesh,
const SMDSAbs_ElementType theType)
- :myMesh(theMesh),myType(theType), myParent(NULL)
+ :myMesh(theMesh),myType(theType), myParent(NULL)
{
}
SMDS_MeshGroup::SMDS_MeshGroup(SMDS_MeshGroup * theParent,
const SMDSAbs_ElementType theType)
- :myMesh(theParent->myMesh),myType(theType), myParent(theParent)
+ :myMesh(theParent->myMesh),myType(theType), myParent(theParent)
{
}
const SMDS_MeshGroup *SMDS_MeshGroup::AddSubGroup
(const SMDSAbs_ElementType theType)
{
- const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this,theType);
- myChildren.insert(myChildren.end(),subgroup);
- return subgroup;
+ const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this,theType);
+ myChildren.insert(myChildren.end(),subgroup);
+ return subgroup;
}
//=======================================================================
bool SMDS_MeshGroup::RemoveSubGroup(const SMDS_MeshGroup * theGroup)
{
- bool found = false;
- list<const SMDS_MeshGroup*>::iterator itgroup;
- for(itgroup=myChildren.begin(); itgroup!=myChildren.end(); itgroup++)
- {
- const SMDS_MeshGroup* subgroup=*itgroup;
- if (subgroup == theGroup)
- {
- found = true;
- myChildren.erase(itgroup);
- }
- }
-
- return found;
+ bool found = false;
+ list<const SMDS_MeshGroup*>::iterator itgroup;
+ for(itgroup=myChildren.begin(); itgroup!=myChildren.end(); itgroup++)
+ {
+ const SMDS_MeshGroup* subgroup=*itgroup;
+ if (subgroup == theGroup)
+ {
+ found = true;
+ myChildren.erase(itgroup);
+ }
+ }
+
+ return found;
}
//=======================================================================
bool SMDS_MeshGroup::RemoveFromParent()
{
-
- if (myParent==NULL) return false;
- else
- {
- return (myParent->RemoveSubGroup(this));
- }
+
+ if (myParent==NULL) return false;
+ else
+ {
+ return (myParent->RemoveSubGroup(this));
+ }
}
//=======================================================================
//function : Clear
void SMDS_MeshGroup::Clear()
{
- myElements.clear();
- myType = SMDSAbs_All;
+ myElements.clear();
+ myType = SMDSAbs_All;
}
//=======================================================================
void 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();
- else if (theElem->GetType() != myType) {
- MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
- return;
- }
-
- myElements.insert(theElem);
+ // the type of the group is determined by the first element added
+ if (myElements.empty()) myType = theElem->GetType();
+ else if (theElem->GetType() != myType) {
+ MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
+ return;
+ }
+
+ myElements.insert(theElem);
}
//=======================================================================
bool SMDS_MeshGroup::Contains(const SMDS_MeshElement * theElem) const
{
- return myElements.find(theElem)!=myElements.end();
+ return myElements.find(theElem)!=myElements.end();
}
//=======================================================================