Fix bug with 2D algorithms, applied to shells (PAOUK). A patch by EAP.

This commit is contained in:
jfa 2006-10-04 13:21:59 +00:00
parent 66503f43bd
commit 0468bfa232

View File

@ -468,7 +468,7 @@ bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) cons
//======================================================================= //=======================================================================
//function : IsApplicableHypotesis //function : IsApplicableHypotesis
//purpose : //purpose :
//======================================================================= //=======================================================================
bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis, bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
@ -480,11 +480,20 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
// hypothesis // hypothesis
switch ( theShapeType ) { switch ( theShapeType ) {
case TopAbs_EDGE: case TopAbs_EDGE:
case TopAbs_FACE: case TopAbs_FACE:
case TopAbs_SHELL:
case TopAbs_SOLID: case TopAbs_SOLID:
return SMESH_Gen::GetShapeDim( theShapeType ) == theHypothesis->GetDim(); return SMESH_Gen::GetShapeDim( theShapeType ) == theHypothesis->GetDim();
case TopAbs_SHELL:
// Special case for algorithms, building 2D mesh on a whole shell.
// Before this fix there was a problem after restoring from study,
// because in that case algorithm is assigned before hypothesis
// (on shell in problem case) and hypothesis is checked on faces
// (because it is 2D), where we have NO_ALGO state.
// Now 2D hypothesis is also applicable to shells.
return (theHypothesis->GetDim() == 2 || theHypothesis->GetDim() == 3);
// case TopAbs_WIRE: // case TopAbs_WIRE:
// case TopAbs_COMPSOLID: // case TopAbs_COMPSOLID:
// case TopAbs_COMPOUND: // case TopAbs_COMPOUND:
@ -842,7 +851,7 @@ SMESH_Hypothesis::Hypothesis_Status
f.And( SMESH_HypoFilter::IsApplicableTo( _subShape )); f.And( SMESH_HypoFilter::IsApplicableTo( _subShape ));
f.AndNot( SMESH_HypoFilter::Is( algo )); f.AndNot( SMESH_HypoFilter::Is( algo ));
const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( _subShape, f, true ); const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( _subShape, f, true );
if (prevAlgo && if (prevAlgo &&
string(algo->GetName()) != string(prevAlgo->GetName()) ) string(algo->GetName()) != string(prevAlgo->GetName()) )
modifiedHyp = true; modifiedHyp = true;
} }
@ -900,7 +909,7 @@ SMESH_Hypothesis::Hypothesis_Status
f.And( SMESH_HypoFilter::IsApplicableTo( _subShape )); f.And( SMESH_HypoFilter::IsApplicableTo( _subShape ));
f.AndNot( SMESH_HypoFilter::Is( algo )); f.AndNot( SMESH_HypoFilter::Is( algo ));
const SMESH_Hypothesis* prevAlgo = _father->GetHypothesis( _subShape, f, true ); const SMESH_Hypothesis* prevAlgo = _father->GetHypothesis( _subShape, f, true );
if (prevAlgo && if (prevAlgo &&
string(algo->GetName()) != string(prevAlgo->GetName()) ) string(algo->GetName()) != string(prevAlgo->GetName()) )
modifiedHyp = true; modifiedHyp = true;
} }