mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-14 02:30:33 +05:00
0020943: EDF 1463 SMESH: additional fonctionnality to the feature 20749
+ class SMESHCONTROLS_EXPORT BareBorderVolume: public Predicate + class SMESHCONTROLS_EXPORT BareBorderFace: public Predicate
This commit is contained in:
parent
d94954d46e
commit
92f6294479
@ -1875,7 +1875,62 @@ SMDSAbs_ElementType BadOrientedVolume::GetType() const
|
|||||||
return SMDSAbs_Volume;
|
return SMDSAbs_Volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Class : BareBorderVolume
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool BareBorderVolume::IsSatisfy(long theElementId )
|
||||||
|
{
|
||||||
|
SMDS_VolumeTool myTool;
|
||||||
|
if ( myTool.Set( myMesh->FindElement(theElementId)))
|
||||||
|
{
|
||||||
|
for ( int iF = 0; iF < myTool.NbFaces(); ++iF )
|
||||||
|
if ( myTool.IsFreeFace( iF ))
|
||||||
|
{
|
||||||
|
const SMDS_MeshNode** n = myTool.GetFaceNodes(iF);
|
||||||
|
vector< const SMDS_MeshNode*> nodes( n, n+myTool.NbFaceNodes(iF));
|
||||||
|
if ( !myMesh->FindElement( nodes, SMDSAbs_Face, /*Nomedium=*/false))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Class : BareBorderFace
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool BareBorderFace::IsSatisfy(long theElementId )
|
||||||
|
{
|
||||||
|
if ( const SMDS_MeshElement* face = myMesh->FindElement(theElementId))
|
||||||
|
if ( face->GetType() == SMDSAbs_Face )
|
||||||
|
{
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
myLinkNodes.resize( 2 + face->IsQuadratic());
|
||||||
|
myLinkNodes[0] = n1;
|
||||||
|
myLinkNodes[1] = n2;
|
||||||
|
if ( face->IsQuadratic() )
|
||||||
|
myLinkNodes[2] = face->GetNode( i+nbN );
|
||||||
|
return !myMesh->FindElement( myLinkNodes, SMDSAbs_Edge, /*noMedium=*/false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : FreeBorders
|
Class : FreeBorders
|
||||||
|
@ -373,11 +373,41 @@ namespace SMESH{
|
|||||||
virtual void SetMesh( const SMDS_Mesh* theMesh );
|
virtual void SetMesh( const SMDS_Mesh* theMesh );
|
||||||
virtual bool IsSatisfy( long theElementId );
|
virtual bool IsSatisfy( long theElementId );
|
||||||
virtual SMDSAbs_ElementType GetType() const;
|
virtual SMDSAbs_ElementType GetType() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const SMDS_Mesh* myMesh;
|
const SMDS_Mesh* myMesh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
BareBorderVolume
|
||||||
|
*/
|
||||||
|
class SMESHCONTROLS_EXPORT BareBorderVolume: public Predicate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BareBorderVolume():myMesh(0) {}
|
||||||
|
virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
|
||||||
|
virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
|
||||||
|
virtual bool IsSatisfy( long theElementId );
|
||||||
|
protected:
|
||||||
|
const SMDS_Mesh* myMesh;
|
||||||
|
};
|
||||||
|
typedef boost::shared_ptr<BareBorderVolume> BareBorderVolumePtr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
BareBorderFace
|
||||||
|
*/
|
||||||
|
class SMESHCONTROLS_EXPORT BareBorderFace: public Predicate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BareBorderFace():myMesh(0) {}
|
||||||
|
virtual void SetMesh( const SMDS_Mesh* theMesh ) { myMesh = theMesh; }
|
||||||
|
virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
|
||||||
|
virtual bool IsSatisfy( long theElementId );
|
||||||
|
protected:
|
||||||
|
const SMDS_Mesh* myMesh;
|
||||||
|
std::vector< const SMDS_MeshNode* > myLinkNodes;
|
||||||
|
};
|
||||||
|
typedef boost::shared_ptr<BareBorderFace> BareBorderFacePtr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : FreeEdges
|
Class : FreeEdges
|
||||||
@ -399,7 +429,7 @@ namespace SMESH{
|
|||||||
};
|
};
|
||||||
typedef std::set<Border> TBorders;
|
typedef std::set<Border> TBorders;
|
||||||
void GetBoreders(TBorders& theBorders);
|
void GetBoreders(TBorders& theBorders);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const SMDS_Mesh* myMesh;
|
const SMDS_Mesh* myMesh;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user