- case ADD_HYP:
- ASSERT(anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO);
- ret = _meshDS->AddHypothesis(_subShape, anHyp);
- if (ret)
- {
- SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
- ASSERT(algo);
- ret = algo->CheckHypothesis((*_father),_subShape);
- if (ret) SetAlgoState(HYP_OK);
- else SetAlgoState(MISSING_HYP);
- }
- break;
- case ADD_ALGO: //already existing algo : on father ?
- ASSERT(anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO);
- if (anHyp->GetDim() <= SMESH_Gen::GetShapeDim(_subShape))
- {
- ret = _meshDS->AddHypothesis(_subShape, anHyp);
-// if (ret &&(anHyp->GetDim() == SMESH_Gen::GetShapeDim(_subShape)))
-// if (ret &&(anHyp->GetShapeType() == _subShape.ShapeType()))
- if (ret &&(anHyp->GetShapeType() & (1<< _subShape.ShapeType())))
- {
- SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
- if (algo == NULL) // two algo on the same subShape...
- {
- MESSAGE("two algo on the same subshape not allowed");
- ret = _meshDS->RemoveHypothesis(_subShape, anHyp);
- ret = false;
- }
- else
- {
- ret = algo->CheckHypothesis((*_father),_subShape);
- if (ret) SetAlgoState(HYP_OK);
- else SetAlgoState(MISSING_HYP);
- }
- }
- }
- break;
- case REMOVE_HYP:
- ASSERT(anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO);
- ret = _meshDS->RemoveHypothesis(_subShape, anHyp);
- break;
- case REMOVE_ALGO: // perhaps a father algo applies ?
- ASSERT(anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO);
- ret = _meshDS->RemoveHypothesis(_subShape, anHyp);
-// if (ret &&(anHyp->GetDim() == SMESH_Gen::GetShapeDim(_subShape)))
-// if (ret &&(anHyp->GetShapeType() == _subShape.ShapeType()))
- if (ret &&(anHyp->GetShapeType() & (1<<_subShape.ShapeType())))
- {
- SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
- if (algo == NULL) // no more algo applying on subShape...
- {
- SetAlgoState(NO_ALGO);
- }
- else
- {
- ret = algo->CheckHypothesis((*_father),_subShape);
- if (ret) SetAlgoState(HYP_OK);
- else SetAlgoState(MISSING_HYP);
- }
- }
- break;
- case ADD_FATHER_HYP:
- ASSERT(anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO);
- {
- SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
- ASSERT(algo);
- ret = algo->CheckHypothesis((*_father),_subShape);
- if (ret) SetAlgoState(HYP_OK);
- else SetAlgoState(MISSING_HYP);
- }
- break;
- case ADD_FATHER_ALGO: // detect if two algo of same dim on father
- ASSERT(anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO);
-// if (anHyp->GetDim() == SMESH_Gen::GetShapeDim(_subShape))
-// if (anHyp->GetShapeType() == _subShape.ShapeType())
- if (anHyp->GetShapeType() & (1<< _subShape.ShapeType()))
- {
- SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
- if (algo == NULL) // two applying algo on father
- {
- MESSAGE("two applying algo on fatherShape...");
- SetAlgoState(NO_ALGO);
- }
- else
- {
- ret = algo->CheckHypothesis((*_father),_subShape);
- if (ret) SetAlgoState(HYP_OK);
- else SetAlgoState(MISSING_HYP);
- }
- }
- break;
- case REMOVE_FATHER_HYP: // nothing to do
- break;
- case REMOVE_FATHER_ALGO:
- ASSERT(anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO);
-// if (anHyp->GetDim() == SMESH_Gen::GetShapeDim(_subShape))
-// if (anHyp->GetShapeType() == _subShape.ShapeType())
- if (anHyp->GetShapeType() & (1<< _subShape.ShapeType()))
- {
- SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
- if (algo == NULL) // no more applying algo on father
- {
- SetAlgoState(NO_ALGO);
- }
- else
- {
- ret = algo->CheckHypothesis((*_father),_subShape);
- if (ret) SetAlgoState(HYP_OK);
- else SetAlgoState(MISSING_HYP);
- }
- }
- break;
- default:
- ASSERT(0);
- break;