mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-27 09:25:37 +05:00
22656: [CEA 1226] Script blsurf_submesh.py raises an exception
22653: [CEA 1225] RuntimeError at mesh.Compute() Regressions fixed
This commit is contained in:
parent
f5f41a4c46
commit
a1e66f21f0
@ -1004,6 +1004,21 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
|
|||||||
{
|
{
|
||||||
aSubMesh = new SMESH_subMesh(index, this, _myMeshDS, aSubShape);
|
aSubMesh = new SMESH_subMesh(index, this, _myMeshDS, aSubShape);
|
||||||
_subMeshHolder->Add( index, aSubMesh );
|
_subMeshHolder->Add( index, aSubMesh );
|
||||||
|
|
||||||
|
// include non-computable sub-meshes in SMESH_subMesh::_ancestors of sub-submeshes
|
||||||
|
switch ( aSubShape.ShapeType() ) {
|
||||||
|
case TopAbs_COMPOUND:
|
||||||
|
case TopAbs_WIRE:
|
||||||
|
case TopAbs_SHELL:
|
||||||
|
for ( TopoDS_Iterator subIt( aSubShape ); subIt.More(); subIt.Next() )
|
||||||
|
{
|
||||||
|
SMESH_subMesh* sm = GetSubMesh( subIt.Value() );
|
||||||
|
SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*inclideSelf=*/true);
|
||||||
|
while ( smIt->more() )
|
||||||
|
smIt->next()->ClearAncestors();
|
||||||
|
}
|
||||||
|
default:;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return aSubMesh;
|
return aSubMesh;
|
||||||
}
|
}
|
||||||
@ -1157,6 +1172,9 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
|
|||||||
const SMESH_HypoFilter* compatibleHypoKind;
|
const SMESH_HypoFilter* compatibleHypoKind;
|
||||||
list <const SMESHDS_Hypothesis * > usedHyps;
|
list <const SMESHDS_Hypothesis * > usedHyps;
|
||||||
|
|
||||||
|
// keep sub-meshes not to miss ones whose state can change due to notifying others
|
||||||
|
vector< SMESH_subMesh* > smToNotify;
|
||||||
|
|
||||||
SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator() );
|
SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator() );
|
||||||
while ( smIt->more() )
|
while ( smIt->more() )
|
||||||
{
|
{
|
||||||
@ -1184,11 +1202,17 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
|
|||||||
if ( GetHypotheses( aSubMesh, *compatibleHypoKind, usedHyps, true ) &&
|
if ( GetHypotheses( aSubMesh, *compatibleHypoKind, usedHyps, true ) &&
|
||||||
find( usedHyps.begin(), usedHyps.end(), hyp ) != usedHyps.end() )
|
find( usedHyps.begin(), usedHyps.end(), hyp ) != usedHyps.end() )
|
||||||
{
|
{
|
||||||
aSubMesh->AlgoStateEngine(SMESH_subMesh::MODIF_HYP,
|
smToNotify.push_back( aSubMesh );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( size_t i = 0; i < smToNotify.size(); ++i )
|
||||||
|
{
|
||||||
|
smToNotify[i]->AlgoStateEngine(SMESH_subMesh::MODIF_HYP,
|
||||||
const_cast< SMESH_Hypothesis*>( hyp ));
|
const_cast< SMESH_Hypothesis*>( hyp ));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
|
HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
|
||||||
GetMeshDS()->Modified();
|
GetMeshDS()->Modified();
|
||||||
}
|
}
|
||||||
@ -2185,12 +2209,10 @@ void SMESH_Mesh::fillAncestorsMap(const TopoDS_Shape& theShape)
|
|||||||
while ( ancIt.More() && ancIt.Value().ShapeType() >= memberType )
|
while ( ancIt.More() && ancIt.Value().ShapeType() >= memberType )
|
||||||
ancIt.Next();
|
ancIt.Next();
|
||||||
if ( ancIt.More() )
|
if ( ancIt.More() )
|
||||||
{
|
|
||||||
ancList.InsertBefore( theShape, ancIt );
|
ancList.InsertBefore( theShape, ancIt );
|
||||||
GetSubMesh( des.Current() )->ClearAncestors(); // to re-fill _ancestors
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else // else added for 52457: Addition of hypotheses is 8 time longer than meshing
|
||||||
{
|
{
|
||||||
for ( desType = TopAbs_VERTEX; desType > TopAbs_COMPOUND; desType-- )
|
for ( desType = TopAbs_VERTEX; desType > TopAbs_COMPOUND; desType-- )
|
||||||
for ( ancType = desType - 1; ancType >= TopAbs_COMPOUND; ancType-- )
|
for ( ancType = desType - 1; ancType >= TopAbs_COMPOUND; ancType-- )
|
||||||
@ -2202,7 +2224,9 @@ void SMESH_Mesh::fillAncestorsMap(const TopoDS_Shape& theShape)
|
|||||||
// visit COMPOUNDs inside a COMPOUND that are not reachable by TopExp_Explorer
|
// visit COMPOUNDs inside a COMPOUND that are not reachable by TopExp_Explorer
|
||||||
if ( theShape.ShapeType() == TopAbs_COMPOUND )
|
if ( theShape.ShapeType() == TopAbs_COMPOUND )
|
||||||
{
|
{
|
||||||
for ( TopoDS_Iterator sIt(theShape); sIt.More(); sIt.Next() )
|
TopoDS_Iterator sIt(theShape);
|
||||||
|
if ( sIt.More() && sIt.Value().ShapeType() == TopAbs_COMPOUND )
|
||||||
|
for ( ; sIt.More(); sIt.Next() )
|
||||||
if ( sIt.Value().ShapeType() == TopAbs_COMPOUND )
|
if ( sIt.Value().ShapeType() == TopAbs_COMPOUND )
|
||||||
fillAncestorsMap( sIt.Value() );
|
fillAncestorsMap( sIt.Value() );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user