mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 09:20:34 +05:00
PAL10158. Add clearMesh() where call ComputeStateEngine(CLEANDEP)
This commit is contained in:
parent
e292bda630
commit
7a320061b4
@ -3466,6 +3466,35 @@ bool SMESH_Pattern::
|
|||||||
return makePoly;
|
return makePoly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : clearMesh
|
||||||
|
//purpose : clear mesh elements existing on myShape in theMesh
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void SMESH_Pattern::clearMesh(SMESH_Mesh* theMesh) const
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( !myShape.IsNull() )
|
||||||
|
{
|
||||||
|
if ( SMESH_subMesh * aSubMesh = theMesh->GetSubMesh/*Containing*/( myShape ))
|
||||||
|
{
|
||||||
|
aSubMesh->ComputeStateEngine( SMESH_subMesh::CLEANDEP );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS();
|
||||||
|
if ( SMESHDS_SubMesh* aSubMeshDS = aMeshDS->MeshElements( myShape ))
|
||||||
|
{
|
||||||
|
SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements();
|
||||||
|
while ( eIt->more() )
|
||||||
|
aMeshDS->RemoveElement( eIt->next() );
|
||||||
|
SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes();
|
||||||
|
while ( nIt->more() )
|
||||||
|
aMeshDS->RemoveNode( static_cast<const SMDS_MeshNode*>( nIt->next() ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : MakeMesh
|
//function : MakeMesh
|
||||||
//purpose : Create nodes and elements in <theMesh> using nodes
|
//purpose : Create nodes and elements in <theMesh> using nodes
|
||||||
@ -3485,26 +3514,12 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh,
|
|||||||
SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS();
|
SMESHDS_Mesh* aMeshDS = theMesh->GetMeshDS();
|
||||||
|
|
||||||
// clear elements and nodes existing on myShape
|
// clear elements and nodes existing on myShape
|
||||||
|
clearMesh(theMesh);
|
||||||
if ( !myShape.IsNull() )
|
|
||||||
{
|
|
||||||
SMESH_subMesh * aSubMesh = theMesh->GetSubMeshContaining( myShape );
|
|
||||||
SMESHDS_SubMesh * aSubMeshDS = aMeshDS->MeshElements( myShape );
|
|
||||||
if ( aSubMesh )
|
|
||||||
aSubMesh->ComputeStateEngine( SMESH_subMesh::CLEAN );
|
|
||||||
else if ( aSubMeshDS )
|
|
||||||
{
|
|
||||||
SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements();
|
|
||||||
while ( eIt->more() )
|
|
||||||
aMeshDS->RemoveElement( eIt->next() );
|
|
||||||
SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes();
|
|
||||||
while ( nIt->more() )
|
|
||||||
aMeshDS->RemoveNode( static_cast<const SMDS_MeshNode*>( nIt->next() ));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool onMeshElements = ( !myElements.empty() );
|
bool onMeshElements = ( !myElements.empty() );
|
||||||
|
|
||||||
|
// Create missing nodes
|
||||||
|
|
||||||
vector< const SMDS_MeshNode* > nodesVector; // i-th point/xyz -> node
|
vector< const SMDS_MeshNode* > nodesVector; // i-th point/xyz -> node
|
||||||
if ( onMeshElements )
|
if ( onMeshElements )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user