}
else if ( algoRequiringCleaning && algoRequiringCleaning->SupportSubmeshes() )
{
- SMESHDS_Mesh* meshDS = _father->GetMeshDS();
-
// find sub-meshes to keep elements on
set< SMESH_subMesh* > smToKeep;
TopAbs_ShapeEnum prevShapeType = TopAbs_SHAPE;
}
if ( !keepSubMeshes )
{
- // look for an algo assigned to sm
- bool algoFound = false;
- const list<const SMESHDS_Hypothesis*>& hyps = meshDS->GetHypothesis( sm->_subShape );
- list<const SMESHDS_Hypothesis*>::const_iterator h = hyps.begin();
- for ( ; ( !algoFound && h != hyps.end() ); ++h )
- algoFound = ((*h)->GetType() != SMESHDS_Hypothesis::PARAM_ALGO );
- keepSubMeshes = algoFound;
+ // look for a local algo used to mesh sm
+ TopoDS_Shape algoShape = SMESH_MesherHelper::GetShapeOfHypothesis
+ ( algoRequiringCleaning, _subShape, _father );
+ SMESH_HypoFilter moreLocalAlgo;
+ moreLocalAlgo.Init( SMESH_HypoFilter::IsMoreLocalThan( algoShape, *_father ));
+ moreLocalAlgo.And ( SMESH_HypoFilter::IsAlgo() );
+ bool localAlgoFound = _father->GetHypothesis( sm->_subShape, moreLocalAlgo, true );
+ keepSubMeshes = localAlgoFound;
}
// remember all sub-meshes of sm
if ( keepSubMeshes )
TopAbs_ShapeEnum aShapeType = aShape.ShapeType();
// IPAL18558: Wrong information of the created sub-mesh is shown. (Sub-mesh on a FACE
- // with only 1D algo assigned
+ // with only 1D algo assigned)
// Find dimension of sub-meshes to return as highest dimension of the assigned algorithm
- if ( theSubMesh->IsEmpty() && !theSubMesh->GetAlgo() )
+ if (( theSubMesh->IsEmpty() || ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )) &&
+ ( !theSubMesh->GetAlgo() ))
{
// on father sub-meshes, check presence of an algo which will mesh this sub-mesh
// even if no algo is assigned to this sub-mesh
if ( !topAlgoPresent )
{
- // look for a sub-mesh with an algo
- SMESH_subMeshIteratorPtr smIt =
- theSubMesh->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/true);
+ // find max dimension of an assigned algo
TopAbs_ShapeEnum algoShape = TopAbs_SHAPE;
- while ( smIt->more() && algoShape == TopAbs_SHAPE )
- {
- sm = smIt->next();
- if ( sm->GetAlgo() )
- algoShape = sm->GetSubShape().ShapeType();
- }
+ const std::list <const SMESHDS_Hypothesis * >& hyps = aMesh->GetHypothesisList( aShape );
+ std::list <const SMESHDS_Hypothesis * >::const_iterator hypIt = hyps.begin();
+ for ( ; hypIt != hyps.end(); ++hypIt )
+ if ( const SMESH_Algo* algo = dynamic_cast< const SMESH_Algo* >( *hypIt ))
+ switch ( algo->GetDim() ) {
+ case 1: algoShape = TopAbs_EDGE; break;
+ case 2: algoShape = TopAbs_FACE; break;
+ case 3: algoShape = TopAbs_SOLID; break;
+ case 0: algoShape = TopAbs_VERTEX; break;
+ }
if ( algoShape != TopAbs_SHAPE )
{
- // return all sub-meshes on this shape type
- smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/true);
+ // return all sub-meshes on this dimension
+ SMESH_subMeshIteratorPtr smIt = theSubMesh->getDependsOnIterator(/*includeSelf=*/false);
while ( smIt->more() )
{
sm = smIt->next();
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
+ if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
+ aSubMeshDS = 0;
int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0;
}
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
+ if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
+ aSubMeshDS = 0;
if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
{
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
+ if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
+ aSubMeshDS = 0;
int nbElems = aSubMeshDS ? aSubMeshDS->NbElements() : 0;
TListOfSubMeshes smList;
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
SMESHDS_SubMesh* aSubMeshDS = aSubMesh->GetSubMeshDS();
+ if ( aSubMeshDS && aSubMeshDS->IsComplexSubmesh() )
+ aSubMeshDS = 0;
// PAL5440, return all nodes belonging to elements of submesh
set<int> nodeIds;