#include <SMESH_ControlsDef.hxx>

Public Member Functions | |
| OverConstrainedFace () | |
| virtual void | SetMesh (const SMDS_Mesh *theMesh) |
| virtual SMDSAbs_ElementType | GetType () const |
| virtual bool | IsSatisfy (long theElementId) |
Protected Attributes | |
| const SMDS_Mesh * | myMesh |
| std::vector< const SMDS_MeshNode * > | myLinkNodes |
Definition at line 435 of file SMESH_ControlsDef.hxx.
| SMESH.Controls.OverConstrainedFace.OverConstrainedFace | ( | ) |
Definition at line 438 of file SMESH_ControlsDef.hxx.
:myMesh(0) {}
| virtual SMDSAbs_ElementType SMESH.Controls.OverConstrainedFace.GetType | ( | ) | const [virtual] |
Implements SMESH.Controls.Predicate.
Definition at line 440 of file SMESH_ControlsDef.hxx.
References SMDSAbs_Face.
{ return SMDSAbs_Face; }
| bool OverConstrainedFace::IsSatisfy | ( | long | theElementId | ) | [virtual] |
Implements SMESH.Controls.Predicate.
Definition at line 2041 of file SMESH_Controls.cxx.
References PAL_MESH_043_3D.face, SMDS_Mesh.FindElement(), SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.GetNodeIndex(), SMESH.Controls.NumericalFunctor.myMesh, SMESH_AdvancedEditor.n1, SMESH_AdvancedEditor.n2, and SMDSAbs_Face.
{
// An element is over-constrained if it has N-1 free borders where
// N is the number of edges/faces for a 2D/3D element.
if ( const SMDS_MeshElement* face = myMesh->FindElement(theElementId))
if ( face->GetType() == SMDSAbs_Face )
{
int nbSharedBorders = 0;
int nbN = face->NbCornerNodes();
for ( int i = 0; i < nbN; ++i )
{
// check if a link is shared by another face
const SMDS_MeshNode* n1 = face->GetNode( i );
const SMDS_MeshNode* n2 = face->GetNode( (i+1)%nbN );
SMDS_ElemIteratorPtr fIt = n1->GetInverseElementIterator( SMDSAbs_Face );
bool isShared = false;
while ( !isShared && fIt->more() )
{
const SMDS_MeshElement* f = fIt->next();
isShared = ( f != face && f->GetNodeIndex(n2) != -1 );
}
if ( isShared && ++nbSharedBorders > 1 )
break;
}
return ( nbSharedBorders == 1 );
}
return false;
}
| virtual void SMESH.Controls.OverConstrainedFace.SetMesh | ( | const SMDS_Mesh * | theMesh | ) | [virtual] |
Implements SMESH.Controls.Functor.
Definition at line 439 of file SMESH_ControlsDef.hxx.
{ myMesh = theMesh; }
std::vector< const SMDS_MeshNode* > SMESH.Controls.OverConstrainedFace.myLinkNodes [protected] |
Definition at line 444 of file SMESH_ControlsDef.hxx.
const SMDS_Mesh* SMESH.Controls.OverConstrainedFace.myMesh [protected] |
Definition at line 443 of file SMESH_ControlsDef.hxx.