mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 17:00:34 +05:00
+ const SMDS_MeshNode* GetNodeWrap(const int ind) const { return GetNode( WrappedIndex( ind )); }
+// ============================================================ +/*! + * \brief Comparator of elements by ID for usage in std containers + */ +// ============================================================ + +struct TIDCompare { + bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const + { return e1->GetID() < e2->GetID(); } +};
This commit is contained in:
parent
b6986ac1b1
commit
91d01b7efe
@ -40,9 +40,12 @@ class SMDS_MeshNode;
|
|||||||
class SMDS_MeshEdge;
|
class SMDS_MeshEdge;
|
||||||
class SMDS_MeshFace;
|
class SMDS_MeshFace;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
// ============================================================
|
||||||
/// Base class for elements
|
/*!
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
* \brief Base class for elements
|
||||||
|
*/
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObject
|
class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -70,6 +73,13 @@ public:
|
|||||||
// ===========================
|
// ===========================
|
||||||
// Access to nodes by index
|
// Access to nodes by index
|
||||||
// ===========================
|
// ===========================
|
||||||
|
/*!
|
||||||
|
* \brief Return node by its index
|
||||||
|
* \param ind - node index
|
||||||
|
* \retval const SMDS_MeshNode* - the node
|
||||||
|
*/
|
||||||
|
virtual const SMDS_MeshNode* GetNode(const int ind) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return node by its index
|
* \brief Return node by its index
|
||||||
* \param ind - node index
|
* \param ind - node index
|
||||||
@ -77,7 +87,7 @@ public:
|
|||||||
*
|
*
|
||||||
* Index is wrapped if it is out of a valid range
|
* Index is wrapped if it is out of a valid range
|
||||||
*/
|
*/
|
||||||
virtual const SMDS_MeshNode* GetNode(const int ind) const;
|
const SMDS_MeshNode* GetNodeWrap(const int ind) const { return GetNode( WrappedIndex( ind )); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return true if index of node is valid (0 <= ind < NbNodes())
|
* \brief Return true if index of node is valid (0 <= ind < NbNodes())
|
||||||
@ -112,4 +122,15 @@ private:
|
|||||||
int myID;
|
int myID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ============================================================
|
||||||
|
/*!
|
||||||
|
* \brief Comparator of elements by ID for usage in std containers
|
||||||
|
*/
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
struct TIDCompare {
|
||||||
|
bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const
|
||||||
|
{ return e1->GetID() < e2->GetID(); }
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user