#include <SMESHDS_Group.hxx>

Public Member Functions | |
| SMESHDS_Group (const int theID, const SMESHDS_Mesh *theMesh, const SMDSAbs_ElementType theType) | |
| virtual void | SetType (SMDSAbs_ElementType theType) |
| virtual int | Extent () |
| virtual bool | IsEmpty () |
| virtual bool | Contains (const int theID) |
| virtual bool | Contains (const SMDS_MeshElement *elem) |
| virtual SMDS_ElemIteratorPtr | GetElements () const |
| bool | Add (const int theID) |
| bool | Remove (const int theID) |
| void | Clear () |
| SMDS_MeshGroup & | SMDSGroup () |
| int | GetID () const |
| int | GetID (const int theIndex) |
| const SMESHDS_Mesh * | GetMesh () const |
| SMDSAbs_ElementType | GetType () const |
| void | SetStoreName (const char *theName) |
| const char * | GetStoreName () const |
| void | SetColor (const Quantity_Color &theColor) |
| Quantity_Color | GetColor () const |
| void | SetColorGroup (int theColorGroup) |
| int | GetColorGroup () const |
Protected Member Functions | |
| const SMDS_MeshElement * | findInMesh (const int theID) const |
| void | resetIterator () |
| Internal method: resets cached iterator, should be called by ancestors when they are modified (ex: Add() or Remove() ) | |
Private Attributes | |
| SMDS_MeshGroup | myGroup |
Definition at line 39 of file SMESHDS_Group.hxx.
| SMESHDS_Group::SMESHDS_Group | ( | const int | theID, |
| const SMESHDS_Mesh * | theMesh, | ||
| const SMDSAbs_ElementType | theType | ||
| ) |
Definition at line 39 of file SMESHDS_Group.cxx.
: SMESHDS_GroupBase(theID,theMesh,theType), myGroup(theMesh,theType) { }
Definition at line 99 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.Add(), SMDS_MeshGroup.Contains(), SMESHDS_GroupBase.findInMesh(), SMDS_MeshElement.GetType(), SMDS_MeshGroup.IsEmpty(), myGroup, SMESHDS_GroupBase.resetIterator(), and SetType().
Referenced by SMESH_Group_i.Add(), SMESH_Group_i.AddByPredicate(), SMESH_Group_i.AddFrom(), SMESH_Mesh.ConvertToStandalone(), SMESH_MeshEditor.CreateFlatElementsOnFacesGroups(), and SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().
{
const SMDS_MeshElement* aElem = findInMesh (theID);
if (!aElem || myGroup.Contains(aElem))
return false;
if (myGroup.IsEmpty())
SetType( aElem->GetType() );
myGroup.Add (aElem);
resetIterator();
return true;
}
| void SMESHDS_Group::Clear | ( | ) |
Definition at line 135 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.Clear(), myGroup, and SMESHDS_GroupBase.resetIterator().
Referenced by SMESH_Group_i.Clear().
{
myGroup.Clear();
resetIterator();
}
| bool SMESHDS_Group::Contains | ( | const SMDS_MeshElement * | elem | ) | [virtual] |
Reimplemented from SMESHDS_GroupBase.
Definition at line 86 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.Contains(), and myGroup.
Reimplemented from SMESHDS_GroupBase.
Definition at line 73 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.Contains(), SMESHDS_GroupBase.findInMesh(), and myGroup.
Referenced by SMESH_MeshEditor.AddToSameGroups().
{
const SMDS_MeshElement* aElem = findInMesh (theID);
if (aElem)
return myGroup.Contains(aElem);
return false;
}
| int SMESHDS_Group::Extent | ( | ) | [virtual] |
Reimplemented from SMESHDS_GroupBase.
Definition at line 52 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.Extent(), and myGroup.
| const SMDS_MeshElement * SMESHDS_GroupBase::findInMesh | ( | const int | theID | ) | const [protected, inherited] |
Definition at line 76 of file SMESHDS_GroupBase.cxx.
References SMDS_Mesh.FindElement(), SMDS_Mesh.FindNode(), SMESHDS_GroupBase.GetMesh(), SMDS_MeshElement.GetType(), SMESHDS_GroupBase.GetType(), SMDSAbs_All, and SMDSAbs_Node.
Referenced by Add(), SMESHDS_GroupOnGeom.Contains(), Contains(), and Remove().
{
SMDSAbs_ElementType aType = GetType();
const SMDS_MeshElement* aElem = NULL;
if (aType == SMDSAbs_Node) {
aElem = GetMesh()->FindNode(theID);
}
else if (aType != SMDSAbs_All) {
aElem = GetMesh()->FindElement(theID);
if (aElem && aType != aElem->GetType())
aElem = NULL;
}
return aElem;
}
| Quantity_Color SMESHDS_GroupBase.GetColor | ( | ) | const [inherited] |
Definition at line 79 of file SMESHDS_GroupBase.hxx.
Referenced by SMESH_GroupBase_i.GetColor(), SMESHDS_GroupBase.GetColorGroup(), DriverMED_Family.Init(), and SMESH.Controls.GroupColor.SetMesh().
{ return myColor;}
| int SMESHDS_GroupBase::GetColorGroup | ( | ) | const [inherited] |
Definition at line 195 of file SMESHDS_GroupBase.cxx.
References SMESHDS_GroupBase.GetColor().
Referenced by SMESH_GroupBase_i.GetColorNumber().
| SMDS_ElemIteratorPtr SMESHDS_Group::GetElements | ( | ) | const [virtual] |
Implements SMESHDS_GroupBase.
Definition at line 159 of file SMESHDS_Group.cxx.
References myGroup.
{
return SMDS_ElemIteratorPtr( new MyGroupIterator ( myGroup ));
}
| int SMESHDS_GroupBase.GetID | ( | ) | const [inherited] |
Definition at line 49 of file SMESHDS_GroupBase.hxx.
Referenced by SMESH_GroupBase_i.GetID(), SMESH_GroupBase_i.GetListOfID(), DriverUNV_W_SMDS_Mesh.Perform(), SMESH_Gen_i.Save(), and SMESH.Controls.GroupColor.SetMesh().
{ return myID; }
Definition at line 56 of file SMESHDS_GroupBase.cxx.
References SMESHDS_GroupBase.GetElements(), SMESHDS_GroupBase.myCurID, SMESHDS_GroupBase.myCurIndex, and SMESHDS_GroupBase.myIterator.
{
if (myCurIndex < 1 || myCurIndex > theIndex) {
myIterator = GetElements();
myCurIndex = 0;
myCurID = -1;
}
while (myCurIndex < theIndex && myIterator->more()) {
myCurIndex++;
myCurID = myIterator->next()->GetID();
}
return myCurIndex == theIndex ? myCurID : -1;
}
| const SMESHDS_Mesh* SMESHDS_GroupBase.GetMesh | ( | ) | const [inherited] |
Definition at line 51 of file SMESHDS_GroupBase.hxx.
Referenced by ChangeByPredicate(), SMESHDS_GroupBase.findInMesh(), StdMeshers_ImportSource1D.GetSourceMeshes(), and SMESHDS_GroupOnGeom.SetShape().
{ return myMesh; }
| const char* SMESHDS_GroupBase.GetStoreName | ( | ) | const [inherited] |
Definition at line 59 of file SMESHDS_GroupBase.hxx.
Referenced by SMESH_MeshEditor.generateGroups(), DriverMED_R_SMESHDS_Mesh.GetGroup(), DriverMED_Family.Init(), DriverUNV_W_SMDS_Mesh.Perform(), and SMESH_Gen_i.Save().
{ return myStoreName.c_str(); }
| SMDSAbs_ElementType SMESHDS_GroupBase.GetType | ( | ) | const [inherited] |
Definition at line 55 of file SMESHDS_GroupBase.hxx.
Referenced by SMESH_Mesh.ConvertToStandalone(), SMESH_Gen_i.CopyMesh(), SMESHDS_GroupBase.findInMesh(), SMESH_MeshEditor.generateGroups(), SMESHDS_GroupOnGeom.GetElements(), DriverMED_R_SMESHDS_Mesh.GetGroup(), SMESH_GroupBase_i.GetType(), StdMeshers_Import_1D.importMesh(), DriverMED_Family.Init(), DriverUNV_W_SMDS_Mesh.Perform(), SMESH.Controls.GroupColor.SetMesh(), and SetType().
{ return myType; }
| bool SMESHDS_Group::IsEmpty | ( | ) | [virtual] |
Reimplemented from SMESHDS_GroupBase.
Definition at line 62 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.IsEmpty(), and myGroup.
Referenced by SMESH_MeshEditor.RemoveElemFromGroups(), SMESHDS_Mesh.RemoveFreeElement(), SMESHDS_Mesh.RemoveFreeNode(), and removeFromContainers().
Definition at line 119 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.Contains(), SMESHDS_GroupBase.findInMesh(), myGroup, SMDS_MeshGroup.Remove(), and SMESHDS_GroupBase.resetIterator().
Referenced by SMESH_Group_i.Remove(), and SMESH_Group_i.RemoveByPredicate().
{
const SMDS_MeshElement* aElem = findInMesh (theID);
if (!aElem || !myGroup.Contains(aElem))
return false;
myGroup.Remove (aElem);
resetIterator();
return true;
}
| void SMESHDS_GroupBase::resetIterator | ( | ) | [protected, inherited] |
Internal method: resets cached iterator, should be called by ancestors when they are modified (ex: Add() or Remove() )
Definition at line 97 of file SMESHDS_GroupBase.cxx.
References SMESHDS_GroupBase.myCurID, and SMESHDS_GroupBase.myCurIndex.
Referenced by Add(), Clear(), and Remove().
{
myCurIndex = 0;
myCurID = -1;
}
| void SMESHDS_GroupBase.SetColor | ( | const Quantity_Color & | theColor | ) | [inherited] |
Definition at line 76 of file SMESHDS_GroupBase.hxx.
Referenced by SMESH_Gen_i.Load(), SMESH_GroupBase_i.SetColor(), and SMESHDS_GroupBase.SetColorGroup().
{ myColor = theColor;}
| void SMESHDS_GroupBase::SetColorGroup | ( | int | theColorGroup | ) | [inherited] |
Definition at line 171 of file SMESHDS_GroupBase.cxx.
References SMESHDS_GroupBase.SetColor().
Referenced by DriverMED_R_SMESHDS_Mesh.GetGroup(), and SMESH_GroupBase_i.SetColorNumber().
{
int aRed = ( theColorGroup/1000000 );
int aGreen = ( theColorGroup -aRed*1000000)/1000;
int aBlue = ( theColorGroup - aRed*1000000 - aGreen*1000 );
double aR = aRed/255.0;
double aG = aGreen/255.0;
double aB = aBlue/255.0;
if ( aR < 0. || aR > 1. || // PAL19395
aG < 0. || aG > 1. ||
aB < 0. || aB > 1. )
// #ifdef _DEBUG_
// cout << "SMESHDS_GroupBase::SetColorGroup("<<theColorGroup<<"), invalid color ignored"<<endl;
// #endif
return;
Quantity_Color aColor( aR, aG, aB, Quantity_TOC_RGB );
SetColor( aColor );
}
| void SMESHDS_GroupBase.SetStoreName | ( | const char * | theName | ) | [inherited] |
Definition at line 57 of file SMESHDS_GroupBase.hxx.
Referenced by SMESH_Mesh.ExportUNV(), SMESH_MeshEditor.generateGroups(), SMESH_Gen_i.Load(), SMESH_Mesh.MEDToMesh(), SMESH_Gen_i.Save(), and SMESH_Mesh.UNVToMesh().
{ myStoreName = theName; }
| void SMESHDS_Group::SetType | ( | SMDSAbs_ElementType | theType | ) | [virtual] |
Reimplemented from SMESHDS_GroupBase.
Definition at line 169 of file SMESHDS_Group.cxx.
References SMDS_MeshGroup.GetType(), SMESHDS_GroupBase.GetType(), SMDS_MeshGroup.IsEmpty(), myGroup, SMDS_MeshGroup.SetType(), and SMDSAbs_All.
Referenced by Add(), and SMESH_Mesh.UNVToMesh().
{
if ( myGroup.IsEmpty() || GetType() == SMDSAbs_All ) {
SMESHDS_GroupBase::SetType( theType );
myGroup.SetType ( theType );
}
else
SMESHDS_GroupBase::SetType( myGroup.GetType() );
}
| SMDS_MeshGroup& SMESHDS_Group.SMDSGroup | ( | ) |
Definition at line 65 of file SMESHDS_Group.hxx.
Referenced by SMESH_MeshEditor.AddToSameGroups(), SMESH_Pattern.createElements(), SMESH_MeshEditor.generateGroups(), DriverMED_R_SMESHDS_Mesh.GetGroup(), StdMeshers_Import_1D.importMesh(), SMESH_MeshEditor.RemoveElemFromGroups(), SMESHDS_Mesh.RemoveFreeElement(), SMESHDS_Mesh.RemoveFreeNode(), removeFromContainers(), SMESH_MeshEditor.ReplaceElemInGroups(), and SMESH_Mesh.UNVToMesh().
{ return myGroup; }
SMDS_MeshGroup SMESHDS_Group.myGroup [private] |
Definition at line 69 of file SMESHDS_Group.hxx.
Referenced by Add(), Clear(), Contains(), Extent(), GetElements(), IsEmpty(), Remove(), and SetType().