#include <SMDS_IteratorOfElements.hxx>

Public Member Functions | |
| SMDS_IteratorOfElements (const SMDS_MeshElement *element, SMDSAbs_ElementType type, const SMDS_ElemIteratorPtr &it) | |
| Create an iterator which look for elements of type type which are linked to the element element. | |
| bool | more () |
| Return true if and only if there are other object in this iterator. | |
| const SMDS_MeshElement * | next () |
| Return the current object and step to the next one. | |
| virtual void | remove () |
| Delete the current element and step to the next one. | |
Private Member Functions | |
| bool | subMore () |
| const SMDS_MeshElement * | subNext () |
Private Attributes | |
| SMDS_ElemIteratorPtr | t2Iterator |
| SMDS_ElemIteratorPtr | t1Iterator |
| SMDSAbs_ElementType | myType |
| const SMDS_MeshElement * | myProxyElement |
| const SMDS_MeshElement * | myElement |
| bool | myReverseIteration |
| std::set< const SMDS_MeshElement * > | alreadyReturnedElements |
| std::set< const SMDS_MeshElement * >::iterator | itAlreadyReturned |
Definition at line 32 of file SMDS_IteratorOfElements.hxx.
| SMDS_IteratorOfElements::SMDS_IteratorOfElements | ( | const SMDS_MeshElement * | element, |
| SMDSAbs_ElementType | type, | ||
| const SMDS_ElemIteratorPtr & | it | ||
| ) |
Create an iterator which look for elements of type type which are linked to the element element.
it is the iterator to get connectivity of element
Definition at line 57 of file SMDS_IteratorOfElements.cxx.
References alreadyReturnedElements, SMDS_MeshElement.GetType(), itAlreadyReturned, myElement, myReverseIteration, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, SMDSAbs_Volume, subMore(), and subNext().
: t1Iterator(it), t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)), myType(type), myElement(element), myProxyElement(NULL) { while(subMore()) alreadyReturnedElements.insert(subNext()); itAlreadyReturned= alreadyReturnedElements.begin(); switch(myElement->GetType()) { case SMDSAbs_Node: case SMDSAbs_Edge: myReverseIteration=true; break; case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break; default: myReverseIteration=false; } }
| bool SMDS_IteratorOfElements::more | ( | ) | [virtual] |
Return true if and only if there are other object in this iterator.
Implements SMDS_Iterator< const SMDS_MeshElement * >.
Definition at line 77 of file SMDS_IteratorOfElements.cxx.
References alreadyReturnedElements, SMDS_MeshElement.elementsIterator(), SMDS_MeshElement.GetType(), itAlreadyReturned, myElement, myProxyElement, and myReverseIteration.
Referenced by next().
{
if(myProxyElement==NULL)
{
while(itAlreadyReturned!=alreadyReturnedElements.end())
{
myProxyElement=*itAlreadyReturned;
itAlreadyReturned++;
if(myReverseIteration)
{
SMDS_ElemIteratorPtr it=
myProxyElement->elementsIterator(myElement->GetType());
while(it->more())
{
if(it->next()==myElement) return true;
}
}
else return true;
}
myProxyElement=NULL;
return false;
}
else return true;
}
| const SMDS_MeshElement * SMDS_IteratorOfElements::next | ( | ) | [virtual] |
Return the current object and step to the next one.
Implements SMDS_Iterator< const SMDS_MeshElement * >.
Definition at line 103 of file SMDS_IteratorOfElements.cxx.
References more(), and myProxyElement.
{
more();
const SMDS_MeshElement *e=myProxyElement;
myProxyElement=NULL;
return e;
}
| virtual void SMDS_Iterator< const SMDS_MeshElement * >.remove | ( | ) | [virtual, inherited] |
Delete the current element and step to the next one.
Definition at line 44 of file SMDS_Iterator.hxx.
{}
| bool SMDS_IteratorOfElements::subMore | ( | ) | [private] |
Definition at line 31 of file SMDS_IteratorOfElements.cxx.
References myType, t1Iterator, and t2Iterator.
Referenced by SMDS_IteratorOfElements().
{
if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
{
if(t1Iterator->more())
{
t2Iterator=t1Iterator->next()->elementsIterator(myType);
return subMore();
}
else return false;
}
else return true;
}
| const SMDS_MeshElement * SMDS_IteratorOfElements::subNext | ( | ) | [private] |
Definition at line 45 of file SMDS_IteratorOfElements.cxx.
References myType, t1Iterator, and t2Iterator.
Referenced by SMDS_IteratorOfElements().
{
if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
if(t1Iterator->more())
t2Iterator=t1Iterator->next()->elementsIterator(myType);
return t2Iterator->next();
}
std::set<const SMDS_MeshElement*> SMDS_IteratorOfElements.alreadyReturnedElements [private] |
Definition at line 53 of file SMDS_IteratorOfElements.hxx.
Referenced by more(), and SMDS_IteratorOfElements().
std::set<const SMDS_MeshElement*>::iterator SMDS_IteratorOfElements.itAlreadyReturned [private] |
Definition at line 54 of file SMDS_IteratorOfElements.hxx.
Referenced by more(), and SMDS_IteratorOfElements().
const SMDS_MeshElement* SMDS_IteratorOfElements.myElement [private] |
Definition at line 50 of file SMDS_IteratorOfElements.hxx.
Referenced by more(), and SMDS_IteratorOfElements().
const SMDS_MeshElement* SMDS_IteratorOfElements.myProxyElement [private] |
Definition at line 49 of file SMDS_IteratorOfElements.hxx.
Definition at line 51 of file SMDS_IteratorOfElements.hxx.
Referenced by more(), and SMDS_IteratorOfElements().
Definition at line 48 of file SMDS_IteratorOfElements.hxx.
Definition at line 47 of file SMDS_IteratorOfElements.hxx.
Definition at line 46 of file SMDS_IteratorOfElements.hxx.