{
if ( GetVtkType() == VTK_POLYHEDRON )
return static_cast< const SMDS_MeshVolume* >( this )->SMDS_MeshVolume::NbNodes();
- vtkIdType npts;
- vtkIdType const *pts;
- getGrid()->GetCellPoints( GetVtkID(), npts, pts );
+ vtkIdType npts = getGrid()->GetCells()->GetCellSize( GetVtkID() );
return npts;
}
const SMDS_MeshElement* eComplex = invIt2->next();
if ( eComplex->IsQuadratic() && !allMediumNodesIn( eComplex, mediumNodes))
{
- int nbCommonNodes = SMESH_MeshAlgos::GetCommonNodes( e, eComplex ).size();
+ int nbCommonNodes = SMESH_MeshAlgos::NbCommonNodes( e, eComplex );
if ( nbCommonNodes == e->NbNodes())
{
complexFound = true;
const SMDS_MeshElement* prevFace = u_int1->second._face;
while ( ok && u_int2->second._coincides )
{
- if ( SMESH_MeshAlgos::GetCommonNodes(prevFace , u_int2->second._face).empty() )
+ if ( SMESH_MeshAlgos::NbCommonNodes(prevFace , u_int2->second._face) == 0 )
ok = false;
else
{
return ok;
}
-//=======================================================================
-//function : GetCommonNodes
-//purpose : Return nodes common to two elements
-//=======================================================================
+//================================================================================
+/*!
+ * \brief Return nodes common to two elements
+ */
+//================================================================================
+
+int SMESH_MeshAlgos::NbCommonNodes(const SMDS_MeshElement* e1,
+ const SMDS_MeshElement* e2)
+{
+ int nb = 0;
+ for ( int i = 0 ; i < e1->NbNodes(); ++i )
+ nb += ( e2->GetNodeIndex( e1->GetNode( i )) >= 0 );
+ return nb;
+}
+
+//================================================================================
+/*!
+ * \brief Return nodes common to two elements
+ */
+//================================================================================
std::vector< const SMDS_MeshNode*> SMESH_MeshAlgos::GetCommonNodes(const SMDS_MeshElement* e1,
const SMDS_MeshElement* e2)
common.push_back( e1->GetNode( i ));
return common;
}
+
//================================================================================
/*!
* \brief Return true if node1 encounters first in the face and node2, after
SMESHUtils_EXPORT
bool FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool normalized=true);
+ /*!
+ * \brief Return number of nodes common to two elements
+ */
+ SMESHUtils_EXPORT
+ int NbCommonNodes(const SMDS_MeshElement* e1,
+ const SMDS_MeshElement* e2);
/*!
* \brief Return nodes common to two elements
*/
bool isAdded = checkedCoplanar.insert( myLinks[iE].myFace ).second;
if ( !isAdded )
continue;
- toErase = SMESH_MeshAlgos::GetCommonNodes( myLinks[i ].myFace,
- myLinks[iE].myFace ).size() < 1;
+ toErase = ( SMESH_MeshAlgos::NbCommonNodes( myLinks[i ].myFace,
+ myLinks[iE].myFace ) < 1 );
}
}
}
//check if the faces are connected
int nbCommonNodes = 0;
if ( e.myFace && myFace )
- nbCommonNodes = SMESH_MeshAlgos::GetCommonNodes( e.myFace, myFace ).size();
+ nbCommonNodes = SMESH_MeshAlgos::NbCommonNodes( e.myFace, myFace );
bool toReplace = (( myIndex == _INTERNAL && nbCommonNodes > 1 ) ||
( myIndex == _COPLANAR && nbCommonNodes < 2 ));
if ( toReplace )
while ( vIt->more() )
{
const SMDS_MeshElement* PrmJ = vIt->next();
- if ( SMESH_MeshAlgos::GetCommonNodes( PrmI, PrmJ ).size() > 1 )
+ if ( SMESH_MeshAlgos::NbCommonNodes( PrmI, PrmJ ) > 1 )
checkedPyrams.insert( PrmJ );
}
}