SMESH_Gen::SMESH_Gen()
{
- MESSAGE("SMESH_Gen::SMESH_Gen");
- _localId = 0;
- _hypId = 0;
- _segmentation = _nbSegments = 10;
- SMDS_Mesh::_meshList.clear();
- MESSAGE(SMDS_Mesh::_meshList.size());
- //_counters = new counters(100);
-#ifdef WITH_SMESH_CANCEL_COMPUTE
- _compute_canceled = false;
- _sm_current = NULL;
-#endif
- //vtkDebugLeaks::SetExitError(0);
+ MESSAGE("SMESH_Gen::SMESH_Gen");
+ _localId = 0;
+ _hypId = 0;
+ _segmentation = _nbSegments = 10;
+ SMDS_Mesh::_meshList.clear();
+ MESSAGE(SMDS_Mesh::_meshList.size());
+ //_counters = new counters(100);
+ _compute_canceled = false;
+ _sm_current = NULL;
+ //vtkDebugLeaks::SetExitError(0);
}
//=============================================================================
const int globalAlgoDim = 100;
SMESH_subMeshIteratorPtr smIt;
+ SMESH_subMesh::compute_event computeEvent;
+ if ( !anUpward && aShape.IsSame( aMesh.GetShapeToMesh() ))
+ computeEvent = SMESH_subMesh::COMPUTE;
+ else
+ computeEvent = SMESH_subMesh::COMPUTE_SUBMESH;
if ( anUpward ) // is called from below code here
{
if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
{
-#ifdef WITH_SMESH_CANCEL_COMPUTE
if (_compute_canceled)
return false;
_sm_current = smToCompute;
-#endif
- smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+ smToCompute->ComputeStateEngine( computeEvent );
_sm_current = NULL;
-#endif
}
// we check all the submeshes here and detect if any of them failed to compute
}
else
{
-#ifdef WITH_SMESH_CANCEL_COMPUTE
if (_compute_canceled)
return false;
_sm_current = smToCompute;
-#endif
- smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+ smToCompute->ComputeStateEngine( computeEvent );
_sm_current = NULL;
-#endif
if ( aShapesId )
aShapesId->insert( smToCompute->GetId() );
}
if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
continue;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
if (_compute_canceled)
return false;
_sm_current = sm;
-#endif
- sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+ sm->ComputeStateEngine( computeEvent );
_sm_current = NULL;
-#endif
if ( aShapesId )
aShapesId->insert( sm->GetId() );
}
switch ( event ) {
case MODIF_ALGO_STATE:
case COMPUTE:
+ case COMPUTE_SUBMESH:
//case COMPUTE_CANCELED:
case CLEAN:
//case SUBMESH_COMPUTED:
_computeState = READY_TO_COMPUTE;
break;
case COMPUTE: // nothing to do
+ case COMPUTE_SUBMESH:
break;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
- case COMPUTE_CANCELED: // nothing to do
+ case COMPUTE_CANCELED: // nothing to do
break;
-#endif
case CLEAN:
cleanDependants();
removeSubMeshElementsAndNodes();
}
break;
case COMPUTE:
+ case COMPUTE_SUBMESH:
{
algo = GetAlgo();
ASSERT(algo);
// check submeshes needed
if (_father->HasShapeToMesh() ) {
bool subComputed = false, subFailed = false;
- if (!algo->OnlyUnaryInput())
- shape = getCollection( gen, algo, subComputed, subFailed );
- else
+ if (!algo->OnlyUnaryInput()) {
+ if ( event == COMPUTE &&
+ ( algo->NeedDiscreteBoundary() || algo->SupportSubmeshes() ))
+ shape = getCollection( gen, algo, subComputed, subFailed );
+ else
+ subComputed = SubMeshesComputed( & subFailed );
+ }
+ else {
subComputed = SubMeshesComputed();
+ }
ret = ( algo->NeedDiscreteBoundary() ? subComputed :
algo->SupportSubmeshes() ? !subFailed :
( !subComputed || _father->IsNotConformAllowed() ));
}
}
break;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
case COMPUTE_CANCELED: // nothing to do
break;
-#endif
case CLEAN:
cleanDependants();
removeSubMeshElementsAndNodes();
break;
case COMPUTE: // nothing to do
break;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
- case COMPUTE_CANCELED: // nothing to do
+ case COMPUTE_CANCELED: // nothing to do
break;
-#endif
case CLEAN:
cleanDependants(); // clean sub-meshes, dependant on this one, with event CLEAN
removeSubMeshElementsAndNodes();
else
_computeState = NOT_READY;
break;
- case COMPUTE: // nothing to do
+ case COMPUTE: // nothing to do
+ case COMPUTE_SUBMESH:
break;
case COMPUTE_CANCELED:
{
(*smIt)->ComputeStateEngine( event );
break;
case SMESH_subMesh::COMPUTE:
+ case SMESH_subMesh::COMPUTE_SUBMESH:
if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK )
for ( ; smIt != smEnd; ++ smIt)
(*smIt)->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED );
};
enum compute_event
{
- MODIF_ALGO_STATE, COMPUTE, COMPUTE_CANCELED,
+ MODIF_ALGO_STATE, COMPUTE, COMPUTE_SUBMESH, COMPUTE_CANCELED,
CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, SUBMESH_LOADED,
MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
};