int idnode4, int idnode5, int idnode6) const;
const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3, int idnode4,
int idnode5, int idnode6, int idnode7, int idnode8) const;
- const SMDS_MeshElement *FindElement(int IDelem) const;
+ virtual const SMDS_MeshElement *FindElement(int IDelem) const;
static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n);
static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n);
static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1,
static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) it->second; }
};
+ template<typename VALUE,typename VALUE_SET_ITERATOR>
+ struct PointerAccessor {
+ static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) &(*it); }
+ };
+
///////////////////////////////////////////////////////////////////////////////
/// Filters of value pointed by iterator
///////////////////////////////////////////////////////////////////////////////
virtual SMDS_ElemIteratorPtr elementGeomIterator(SMDSAbs_GeometryType type) const;
virtual SMDS_ElemIteratorPtr elementEntityIterator(SMDSAbs_EntityType type) const;
+ virtual const SMDS_MeshElement *FindElement(int IDelem) const;
+
private:
TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ];
SMESHDS_Mesh* _meshDS;
{
void Add(const SMDS_MeshElement* e) { SMDS_MeshInfo::addWithPoly( e ); }
};
+ /*!
+ * \brief Element holing its ID only
+ */
+ struct TElemID : public SMDS_MeshElement
+ {
+ TElemID(int ID) : SMDS_MeshElement( ID ) {}
+ virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_All; }
+ virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Last; }
+ virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_NONE; }
+ virtual vtkIdType GetVtkType() const { return -1; }
+ };
};
#endif
myInfo = tmpInfo;
}
// -------------------------------------------------------------------------------------
+const SMDS_MeshElement * SMESH_MeshPartDS::FindElement(int IDelem) const
+{
+ if ( _meshDS ) return _meshDS->FindElement( IDelem );
+
+ TElemID elem( IDelem );
+ for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
+ if ( !_elements[ iType ].empty() )
+ {
+ TIDSortedElemSet::const_iterator it = _elements[ iType ].find( &elem );
+ if ( it != _elements[ iType ].end() )
+ return *it;
+ }
+ return 0;
+}
+// -------------------------------------------------------------------------------------
SMDS_ElemIteratorPtr SMESH_MeshPartDS::elementGeomIterator(SMDSAbs_GeometryType geomType) const
{
if ( _meshDS ) return _meshDS->elementGeomIterator( geomType );