#include <SMESH_ControlsDef.hxx>

Data Structures | |
| struct | Border |
Public Types | |
| typedef long | TElemId |
| typedef std::set< Border > | TBorders |
Public Member Functions | |
| FreeEdges () | |
| virtual void | SetMesh (const SMDS_Mesh *theMesh) |
| virtual bool | IsSatisfy (long theElementId) |
| virtual SMDSAbs_ElementType | GetType () const |
| void | GetBoreders (TBorders &theBorders) |
Static Public Member Functions | |
| static bool | IsFreeEdge (const SMDS_MeshNode **theNodes, const int theFaceId) |
Protected Attributes | |
| const SMDS_Mesh * | myMesh |
Definition at line 452 of file SMESH_ControlsDef.hxx.
| typedef std::set<Border> SMESH.Controls.FreeEdges.TBorders |
Definition at line 466 of file SMESH_ControlsDef.hxx.
| typedef long SMESH.Controls.FreeEdges.TElemId |
Definition at line 459 of file SMESH_ControlsDef.hxx.
| FreeEdges::FreeEdges | ( | ) |
Definition at line 2100 of file SMESH_Controls.cxx.
References SMESH.Controls.NumericalFunctor.myMesh.
{
myMesh = 0;
}
| void FreeEdges::GetBoreders | ( | TBorders & | theBorders | ) |
Definition at line 2204 of file SMESH_Controls.cxx.
References SMDS_Mesh.facesIterator(), SMDS_MeshElement.GetID(), SMDS_MeshElement.IsQuadratic(), SMESH.Controls.FreeEdges.myMesh, SMDS_MeshElement.nodesIterator(), and UpdateBorders().
{
TBorders aRegistry;
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); ){
const SMDS_MeshFace* anElem = anIter->next();
long anElemId = anElem->GetID();
SMDS_ElemIteratorPtr aNodesIter;
if ( anElem->IsQuadratic() )
aNodesIter = static_cast<const SMDS_VtkFace*>(anElem)->
interlacedNodesElemIterator();
else
aNodesIter = anElem->nodesIterator();
long aNodeId[2];
const SMDS_MeshElement* aNode;
if(aNodesIter->more()){
aNode = aNodesIter->next();
aNodeId[0] = aNodeId[1] = aNode->GetID();
}
for(; aNodesIter->more(); ){
aNode = aNodesIter->next();
long anId = aNode->GetID();
Border aBorder(anElemId,aNodeId[1],anId);
aNodeId[1] = anId;
//std::cout<<aBorder.myPntId[0]<<"; "<<aBorder.myPntId[1]<<"; "<<aBorder.myElemId<<endl;
UpdateBorders(aBorder,aRegistry,theBorders);
}
Border aBorder(anElemId,aNodeId[0],aNodeId[1]);
//std::cout<<aBorder.myPntId[0]<<"; "<<aBorder.myPntId[1]<<"; "<<aBorder.myElemId<<endl;
UpdateBorders(aBorder,aRegistry,theBorders);
}
//std::cout<<"theBorders.size() = "<<theBorders.size()<<endl;
}
| SMDSAbs_ElementType FreeEdges::GetType | ( | ) | const [virtual] |
Implements SMESH.Controls.Predicate.
Definition at line 2171 of file SMESH_Controls.cxx.
References SMDSAbs_Face.
{
return SMDSAbs_Face;
}
| bool FreeEdges::IsFreeEdge | ( | const SMDS_MeshNode ** | theNodes, |
| const int | theFaceId | ||
| ) | [static] |
Definition at line 2110 of file SMESH_Controls.cxx.
References SMDS_MeshElement.GetID(), SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.GetType(), and SMDSAbs_Face.
{
TColStd_MapOfInteger aMap;
for ( int i = 0; i < 2; i++ )
{
SMDS_ElemIteratorPtr anElemIter = theNodes[ i ]->GetInverseElementIterator();
while( anElemIter->more() )
{
const SMDS_MeshElement* anElem = anElemIter->next();
if ( anElem != 0 && anElem->GetType() == SMDSAbs_Face )
{
int anId = anElem->GetID();
if ( i == 0 )
aMap.Add( anId );
else if ( aMap.Contains( anId ) && anId != theFaceId )
return false;
}
}
}
return true;
}
| bool FreeEdges::IsSatisfy | ( | long | theElementId | ) | [virtual] |
Implements SMESH.Controls.Predicate.
Definition at line 2133 of file SMESH_Controls.cxx.
References SMDS_Mesh.FindElement(), SMDS_MeshElement.GetType(), SMDS_MeshElement.IsQuadratic(), SMESH.Controls.NumericalFunctor.myMesh, SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), and SMDSAbs_Face.
{
if ( myMesh == 0 )
return false;
const SMDS_MeshElement* aFace = myMesh->FindElement( theId );
if ( aFace == 0 || aFace->GetType() != SMDSAbs_Face || aFace->NbNodes() < 3 )
return false;
SMDS_ElemIteratorPtr anIter;
if ( aFace->IsQuadratic() ) {
anIter = dynamic_cast<const SMDS_VtkFace*>
(aFace)->interlacedNodesElemIterator();
}
else {
anIter = aFace->nodesIterator();
}
if ( anIter == 0 )
return false;
int i = 0, nbNodes = aFace->NbNodes();
std::vector <const SMDS_MeshNode*> aNodes( nbNodes+1 );
while( anIter->more() )
{
const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
if ( aNode == 0 )
return false;
aNodes[ i++ ] = aNode;
}
aNodes[ nbNodes ] = aNodes[ 0 ];
for ( i = 0; i < nbNodes; i++ )
if ( IsFreeEdge( &aNodes[ i ], theId ) )
return true;
return false;
}
| void FreeEdges::SetMesh | ( | const SMDS_Mesh * | theMesh | ) | [virtual] |
Implements SMESH.Controls.Functor.
Definition at line 2105 of file SMESH_Controls.cxx.
References SMESH.Controls.NumericalFunctor.myMesh.
{
myMesh = theMesh;
}
const SMDS_Mesh* SMESH.Controls.FreeEdges.myMesh [protected] |
Definition at line 470 of file SMESH_ControlsDef.hxx.
Referenced by SMESH.Controls.ElemGeomType.ElemGeomType(), SMESH.Controls.FreeFaces.FreeFaces(), SMESH.Controls.FreeNodes.FreeNodes(), SMESH.Controls.FreeEdges.GetBoreders(), SMESH.Controls.ElemGeomType.IsSatisfy(), SMESH.Controls.LinearOrQuadratic.IsSatisfy(), SMESH.Controls.FreeFaces.IsSatisfy(), SMESH.Controls.FreeNodes.IsSatisfy(), SMESH.Controls.LinearOrQuadratic.LinearOrQuadratic(), SMESH.Controls.ElemGeomType.SetMesh(), SMESH.Controls.LinearOrQuadratic.SetMesh(), SMESH.Controls.FreeFaces.SetMesh(), and SMESH.Controls.FreeNodes.SetMesh().