SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
{
// naturally always sorted by ID
- if ( type == SMDSAbs_All )
- {
+ switch ( type ) {
+
+ case SMDSAbs_All:
return SMDS_ElemIteratorPtr (new ElemVecIterator<const SMDS_MeshElement*>(myCells));
- }
- else
- {
+
+ case SMDSAbs_Node:
+ return SMDS_ElemIteratorPtr
+ ( new ElemVecIterator<const SMDS_MeshElement*, SMDS_MeshNode*>( myNodes ));
+
+ default:
typedef ElemVecIterator
< const SMDS_MeshElement*, SMDS_MeshCell*, SMDS_MeshElement::TypeFilter > TIterator;
return SMDS_ElemIteratorPtr (new TIterator(myCells, SMDS_MeshElement::TypeFilter( type )));
}
+ return SMDS_ElemIteratorPtr();
}
///////////////////////////////////////////////////////////////////////////////