022150: [CEA 789] Projection_1D2D not taken into account by BLSURF

enum compute_event {
     ...
+    COMPUTE_SUBMESH
This commit is contained in:
eap 2013-03-06 13:34:53 +00:00
parent 0a56ccc761
commit 71b66afd04
3 changed files with 36 additions and 40 deletions

View File

@ -63,18 +63,16 @@ using namespace std;
SMESH_Gen::SMESH_Gen() SMESH_Gen::SMESH_Gen()
{ {
MESSAGE("SMESH_Gen::SMESH_Gen"); MESSAGE("SMESH_Gen::SMESH_Gen");
_localId = 0; _localId = 0;
_hypId = 0; _hypId = 0;
_segmentation = _nbSegments = 10; _segmentation = _nbSegments = 10;
SMDS_Mesh::_meshList.clear(); SMDS_Mesh::_meshList.clear();
MESSAGE(SMDS_Mesh::_meshList.size()); MESSAGE(SMDS_Mesh::_meshList.size());
//_counters = new counters(100); //_counters = new counters(100);
#ifdef WITH_SMESH_CANCEL_COMPUTE _compute_canceled = false;
_compute_canceled = false; _sm_current = NULL;
_sm_current = NULL; //vtkDebugLeaks::SetExitError(0);
#endif
//vtkDebugLeaks::SetExitError(0);
} }
//============================================================================= //=============================================================================
@ -145,6 +143,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
const int globalAlgoDim = 100; const int globalAlgoDim = 100;
SMESH_subMeshIteratorPtr smIt; 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 ( anUpward ) // is called from below code here
{ {
@ -172,15 +175,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE) if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
{ {
#ifdef WITH_SMESH_CANCEL_COMPUTE
if (_compute_canceled) if (_compute_canceled)
return false; return false;
_sm_current = smToCompute; _sm_current = smToCompute;
#endif smToCompute->ComputeStateEngine( computeEvent );
smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
#ifdef WITH_SMESH_CANCEL_COMPUTE
_sm_current = NULL; _sm_current = NULL;
#endif
} }
// we check all the submeshes here and detect if any of them failed to compute // we check all the submeshes here and detect if any of them failed to compute
@ -258,15 +257,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
} }
else else
{ {
#ifdef WITH_SMESH_CANCEL_COMPUTE
if (_compute_canceled) if (_compute_canceled)
return false; return false;
_sm_current = smToCompute; _sm_current = smToCompute;
#endif smToCompute->ComputeStateEngine( computeEvent );
smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
#ifdef WITH_SMESH_CANCEL_COMPUTE
_sm_current = NULL; _sm_current = NULL;
#endif
if ( aShapesId ) if ( aShapesId )
aShapesId->insert( smToCompute->GetId() ); aShapesId->insert( smToCompute->GetId() );
} }
@ -342,15 +337,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
if ( aShapesId && GetShapeDim( aShType ) > (int)aDim ) if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
continue; continue;
#ifdef WITH_SMESH_CANCEL_COMPUTE
if (_compute_canceled) if (_compute_canceled)
return false; return false;
_sm_current = sm; _sm_current = sm;
#endif sm->ComputeStateEngine( computeEvent );
sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
#ifdef WITH_SMESH_CANCEL_COMPUTE
_sm_current = NULL; _sm_current = NULL;
#endif
if ( aShapesId ) if ( aShapesId )
aShapesId->insert( sm->GetId() ); aShapesId->insert( sm->GetId() );
} }

View File

@ -1336,6 +1336,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
switch ( event ) { switch ( event ) {
case MODIF_ALGO_STATE: case MODIF_ALGO_STATE:
case COMPUTE: case COMPUTE:
case COMPUTE_SUBMESH:
//case COMPUTE_CANCELED: //case COMPUTE_CANCELED:
case CLEAN: case CLEAN:
//case SUBMESH_COMPUTED: //case SUBMESH_COMPUTED:
@ -1393,11 +1394,10 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
_computeState = READY_TO_COMPUTE; _computeState = READY_TO_COMPUTE;
break; break;
case COMPUTE: // nothing to do case COMPUTE: // nothing to do
case COMPUTE_SUBMESH:
break; break;
#ifdef WITH_SMESH_CANCEL_COMPUTE case COMPUTE_CANCELED: // nothing to do
case COMPUTE_CANCELED: // nothing to do
break; break;
#endif
case CLEAN: case CLEAN:
cleanDependants(); cleanDependants();
removeSubMeshElementsAndNodes(); removeSubMeshElementsAndNodes();
@ -1440,6 +1440,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
} }
break; break;
case COMPUTE: case COMPUTE:
case COMPUTE_SUBMESH:
{ {
algo = GetAlgo(); algo = GetAlgo();
ASSERT(algo); ASSERT(algo);
@ -1455,10 +1456,16 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
// check submeshes needed // check submeshes needed
if (_father->HasShapeToMesh() ) { if (_father->HasShapeToMesh() ) {
bool subComputed = false, subFailed = false; bool subComputed = false, subFailed = false;
if (!algo->OnlyUnaryInput()) if (!algo->OnlyUnaryInput()) {
shape = getCollection( gen, algo, subComputed, subFailed ); if ( event == COMPUTE &&
else ( algo->NeedDiscreteBoundary() || algo->SupportSubmeshes() ))
shape = getCollection( gen, algo, subComputed, subFailed );
else
subComputed = SubMeshesComputed( & subFailed );
}
else {
subComputed = SubMeshesComputed(); subComputed = SubMeshesComputed();
}
ret = ( algo->NeedDiscreteBoundary() ? subComputed : ret = ( algo->NeedDiscreteBoundary() ? subComputed :
algo->SupportSubmeshes() ? !subFailed : algo->SupportSubmeshes() ? !subFailed :
( !subComputed || _father->IsNotConformAllowed() )); ( !subComputed || _father->IsNotConformAllowed() ));
@ -1607,10 +1614,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
} }
} }
break; break;
#ifdef WITH_SMESH_CANCEL_COMPUTE
case COMPUTE_CANCELED: // nothing to do case COMPUTE_CANCELED: // nothing to do
break; break;
#endif
case CLEAN: case CLEAN:
cleanDependants(); cleanDependants();
removeSubMeshElementsAndNodes(); removeSubMeshElementsAndNodes();
@ -1664,10 +1669,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
break; break;
case COMPUTE: // nothing to do case COMPUTE: // nothing to do
break; break;
#ifdef WITH_SMESH_CANCEL_COMPUTE case COMPUTE_CANCELED: // nothing to do
case COMPUTE_CANCELED: // nothing to do
break; break;
#endif
case CLEAN: case CLEAN:
cleanDependants(); // clean sub-meshes, dependant on this one, with event CLEAN cleanDependants(); // clean sub-meshes, dependant on this one, with event CLEAN
removeSubMeshElementsAndNodes(); removeSubMeshElementsAndNodes();
@ -1721,7 +1724,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
else else
_computeState = NOT_READY; _computeState = NOT_READY;
break; break;
case COMPUTE: // nothing to do case COMPUTE: // nothing to do
case COMPUTE_SUBMESH:
break; break;
case COMPUTE_CANCELED: case COMPUTE_CANCELED:
{ {
@ -2369,6 +2373,7 @@ void SMESH_subMeshEventListener::ProcessEvent(const int event,
(*smIt)->ComputeStateEngine( event ); (*smIt)->ComputeStateEngine( event );
break; break;
case SMESH_subMesh::COMPUTE: case SMESH_subMesh::COMPUTE:
case SMESH_subMesh::COMPUTE_SUBMESH:
if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK ) if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK )
for ( ; smIt != smEnd; ++ smIt) for ( ; smIt != smEnd; ++ smIt)
(*smIt)->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED ); (*smIt)->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED );

View File

@ -107,7 +107,7 @@ class SMESH_EXPORT SMESH_subMesh
}; };
enum compute_event enum compute_event
{ {
MODIF_ALGO_STATE, COMPUTE, COMPUTE_CANCELED, MODIF_ALGO_STATE, COMPUTE, COMPUTE_SUBMESH, COMPUTE_CANCELED,
CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, SUBMESH_LOADED, CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, SUBMESH_LOADED,
MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
}; };