mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 01:58:35 +05:00
[SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D
1) algo->Compute() depending on algo->SupportSubmeshes() 2) + /*! + * \brief Return true if no mesh entities is bound to the submesh + */ + bool IsEmpty() const;
This commit is contained in:
parent
5b5ccb2c07
commit
0375a82ed4
@ -186,6 +186,19 @@ void SMESH_subMesh::SetIsAlwaysComputed(bool isAlCo)
|
|||||||
ComputeStateEngine( CHECK_COMPUTE_STATE );
|
ComputeStateEngine( CHECK_COMPUTE_STATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return true if no mesh entities is bound to the submesh
|
||||||
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
bool SMESH_subMesh::IsEmpty() const
|
||||||
|
{
|
||||||
|
if (SMESHDS_SubMesh * subMeshDS = ((SMESH_subMesh*)this)->GetSubMeshDS())
|
||||||
|
return (!subMeshDS->GetNodes()->more() && !subMeshDS->GetElements()->more());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsMeshComputed
|
//function : IsMeshComputed
|
||||||
//purpose : check if _subMeshDS contains mesh elements
|
//purpose : check if _subMeshDS contains mesh elements
|
||||||
@ -968,11 +981,13 @@ SMESH_Hypothesis::Hypothesis_Status
|
|||||||
TopTools_ListIteratorOfListOfShape it( _father->GetAncestors( _subShape ));
|
TopTools_ListIteratorOfListOfShape it( _father->GetAncestors( _subShape ));
|
||||||
for ( ; ( ret == SMESH_Hypothesis::HYP_OK && it.More()); it.Next() ) {
|
for ( ; ( ret == SMESH_Hypothesis::HYP_OK && it.More()); it.Next() ) {
|
||||||
if ( SMESH_Algo* upperAlgo = gen->GetAlgo( *_father, it.Value() ))
|
if ( SMESH_Algo* upperAlgo = gen->GetAlgo( *_father, it.Value() ))
|
||||||
if ( !upperAlgo->NeedDescretBoundary() )
|
if ( !upperAlgo->NeedDescretBoundary() && !upperAlgo->SupportSubmeshes())
|
||||||
ret = SMESH_Hypothesis::HYP_HIDDEN_ALGO;
|
ret = SMESH_Hypothesis::HYP_HIDDEN_ALGO;
|
||||||
}
|
}
|
||||||
// is algo hiding?
|
// is algo hiding?
|
||||||
if ( ret == SMESH_Hypothesis::HYP_OK && !algo->NeedDescretBoundary() ) {
|
if ( ret == SMESH_Hypothesis::HYP_OK &&
|
||||||
|
!algo->NeedDescretBoundary() &&
|
||||||
|
!algo->SupportSubmeshes()) {
|
||||||
map<int, SMESH_subMesh*>::reverse_iterator i_sm = _mapDepend.rbegin();
|
map<int, SMESH_subMesh*>::reverse_iterator i_sm = _mapDepend.rbegin();
|
||||||
for ( ; ( ret == SMESH_Hypothesis::HYP_OK && i_sm != _mapDepend.rend()) ; ++i_sm )
|
for ( ; ( ret == SMESH_Hypothesis::HYP_OK && i_sm != _mapDepend.rend()) ; ++i_sm )
|
||||||
if ( gen->GetAlgo( *_father, i_sm->second->_subShape ))
|
if ( gen->GetAlgo( *_father, i_sm->second->_subShape ))
|
||||||
@ -1309,6 +1324,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
|
|||||||
else
|
else
|
||||||
subComputed = SubMeshesComputed();
|
subComputed = SubMeshesComputed();
|
||||||
ret = ( algo->NeedDescretBoundary() ? subComputed :
|
ret = ( algo->NeedDescretBoundary() ? subComputed :
|
||||||
|
algo->SupportSubmeshes() ? true :
|
||||||
( !subComputed || _father->IsNotConformAllowed() ));
|
( !subComputed || _father->IsNotConformAllowed() ));
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
_computeState = FAILED_TO_COMPUTE;
|
_computeState = FAILED_TO_COMPUTE;
|
||||||
@ -1343,7 +1359,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
|
|||||||
{
|
{
|
||||||
ret = algo->Compute((*_father), shape);
|
ret = algo->Compute((*_father), shape);
|
||||||
}
|
}
|
||||||
if ( !ret )
|
if ( !ret && _computeError->IsOK() ) // algo can set _computeError of submesh
|
||||||
_computeError = algo->GetComputeError();
|
_computeError = algo->GetComputeError();
|
||||||
}
|
}
|
||||||
catch ( std::bad_alloc& exc ) {
|
catch ( std::bad_alloc& exc ) {
|
||||||
@ -1389,7 +1405,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
|
|||||||
else
|
else
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
if (ret && !_alwaysComputed) { // check if anything was built
|
if (ret && !_alwaysComputed && shape == _subShape) { // check if anything was built
|
||||||
ret = ( GetSubMeshDS() && ( GetSubMeshDS()->NbElements() || GetSubMeshDS()->NbNodes() ));
|
ret = ( GetSubMeshDS() && ( GetSubMeshDS()->NbElements() || GetSubMeshDS()->NbNodes() ));
|
||||||
}
|
}
|
||||||
bool isComputeErrorSet = !CheckComputeError( algo, shape );
|
bool isComputeErrorSet = !CheckComputeError( algo, shape );
|
||||||
@ -1579,7 +1595,7 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo, const TopoDS_Shape& t
|
|||||||
for (TopoDS_Iterator subIt( theShape ); subIt.More(); subIt.Next()) {
|
for (TopoDS_Iterator subIt( theShape ); subIt.More(); subIt.Next()) {
|
||||||
SMESH_subMesh* sm = _father->GetSubMesh( subIt.Value() );
|
SMESH_subMesh* sm = _father->GetSubMesh( subIt.Value() );
|
||||||
if ( sm != this ) {
|
if ( sm != this ) {
|
||||||
if ( !sm->CheckComputeError( theAlgo ))
|
if ( !sm->CheckComputeError( theAlgo, sm->GetSubShape() ))
|
||||||
noErrors = false;
|
noErrors = false;
|
||||||
UpdateDependantsState( SUBMESH_COMPUTED ); // send event SUBMESH_COMPUTED
|
UpdateDependantsState( SUBMESH_COMPUTED ); // send event SUBMESH_COMPUTED
|
||||||
}
|
}
|
||||||
@ -1808,8 +1824,8 @@ TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen,
|
|||||||
else if ( subMesh->GetComputeState() == READY_TO_COMPUTE )
|
else if ( subMesh->GetComputeState() == READY_TO_COMPUTE )
|
||||||
{
|
{
|
||||||
SMESH_Algo* anAlgo = theGen->GetAlgo( *_father, S );
|
SMESH_Algo* anAlgo = theGen->GetAlgo( *_father, S );
|
||||||
if (anAlgo == theAlgo &&
|
if (strcmp( anAlgo->GetName(), theAlgo->GetName()) == 0 && // same algo
|
||||||
anAlgo->GetUsedHypothesis( *_father, S, ignoreAuxiliaryHyps ) == aUsedHyp)
|
anAlgo->GetUsedHypothesis( *_father, S, ignoreAuxiliaryHyps ) == aUsedHyp) // same hyps
|
||||||
aBuilder.Add( aCompound, S );
|
aBuilder.Add( aCompound, S );
|
||||||
if ( !subMesh->SubMeshesComputed() )
|
if ( !subMesh->SubMeshesComputed() )
|
||||||
theSubComputed = false;
|
theSubComputed = false;
|
||||||
|
@ -211,6 +211,11 @@ public:
|
|||||||
SMESH_Hypothesis::Hypothesis_Status CheckConcurentHypothesis (const int theHypType);
|
SMESH_Hypothesis::Hypothesis_Status CheckConcurentHypothesis (const int theHypType);
|
||||||
// check if there are several applicable hypothesis on fathers
|
// check if there are several applicable hypothesis on fathers
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Return true if no mesh entities is bound to the submesh
|
||||||
|
*/
|
||||||
|
bool IsEmpty() const;
|
||||||
|
|
||||||
bool IsMeshComputed() const;
|
bool IsMeshComputed() const;
|
||||||
// check if _subMeshDS contains mesh elements
|
// check if _subMeshDS contains mesh elements
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user