*/
//================================================================================
-namespace {
+namespace
+{
int dependsOnMapKey( const SMESH_subMesh* sm )
{
int type = sm->GetSubShape().ShapeType();
for ( ; sub.More(); sub.Next() )
{
SMESH_subMesh *aSubMesh = _father->GetSubMesh( sub.Current() );
+ if ( aSubMesh->GetId() == 0 )
+ continue; // not a sub-shape of the shape to mesh
int cle = dependsOnMapKey( aSubMesh );
if ( _mapDepend.find( cle ) == _mapDepend.end())
{
// le retour des evenement father n'indiquent pas que add ou remove fait
SMESH_Hypothesis::Hypothesis_Status aux_ret, ret = SMESH_Hypothesis::HYP_OK;
+ if ( _Id == 0 ) return ret; // not a sub-shape of the shape to mesh
SMESHDS_Mesh* meshDS =_father->GetMeshDS();
SMESH_Algo* algo = 0;
f.AndNot( SMESH_HypoFilter::Is( algo ));
const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( this, f, true );
if (prevAlgo &&
- string(algo->GetName()) != string(prevAlgo->GetName()) )
+ string( algo->GetName()) != prevAlgo->GetName())
modifiedHyp = true;
}
else
// detect algorithm hiding
//
- if ( ret == SMESH_Hypothesis::HYP_OK &&
- ( event == ADD_ALGO || event == ADD_FATHER_ALGO ) &&
+ if ( ret == SMESH_Hypothesis::HYP_OK &&
+ ( event == ADD_ALGO || event == ADD_FATHER_ALGO ) && algo &&
algo->GetName() == anHyp->GetName() )
{
// is algo hidden?
if ( !sm->IsEmpty() )
{
const bool sameShapeType = ( prevShapeType == sm->GetSubShape().ShapeType() );
- bool keepSubMeshes = ( sameShapeType && toKeepPrevShapeType );
+ bool keepSubMeshes = ( sameShapeType && toKeepPrevShapeType );
if ( !sameShapeType )
{
// check if the algo allows presence of global algos of dimension the algo
// remember all sub-meshes of sm
if ( keepSubMeshes )
{
- SMESH_subMeshIteratorPtr smIt2 = getDependsOnIterator(false,true);
+ SMESH_subMeshIteratorPtr smIt2 = getDependsOnIterator(false);
while ( smIt2->more() )
smToKeep.insert( smIt2->next() );
}
SMESH_Hypothesis::Hypothesis_Status hyp_status;
algo = GetAlgo();
- if(algo && !aResMap.count(this) )
+ if( algo && !aResMap.count( this ))
{
ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
if (!ret) return false;
- if (_father->HasShapeToMesh() && algo->NeedDiscreteBoundary())
+ if (_father->HasShapeToMesh() && algo->NeedDiscreteBoundary() )
{
// check submeshes needed
bool subMeshEvaluated = true;
return false;
}
_computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
- ret = algo->Evaluate((*_father), _subShape, aResMap);
+ if ( IsMeshComputed() )
+ {
+ vector<int> & nbEntities = aResMap[ this ];
+ nbEntities.resize( SMDSEntity_Last, 0 );
+ if ( SMESHDS_SubMesh* sm = GetSubMeshDS() )
+ {
+ nbEntities[ SMDSEntity_Node ] = sm->NbNodes();
+ SMDS_ElemIteratorPtr elemIt = sm->GetElements();
+ while ( elemIt->more() )
+ nbEntities[ elemIt->next()->GetEntityType() ]++;
+ }
+ }
+ else
+ {
+ ret = algo->Evaluate((*_father), _subShape, aResMap);
+ }
aResMap.insert( make_pair( this,vector<int>(0)));
}