int computeCost;
switch ( _subShape.ShapeType() ) {
case TopAbs_SOLID:
- case TopAbs_SHELL: computeCost = 1000; break;
- case TopAbs_FACE: computeCost = 100; break;
- case TopAbs_EDGE: computeCost = 10; break;
+ case TopAbs_SHELL: computeCost = 5000; break;
+ case TopAbs_FACE: computeCost = 500; break;
+ case TopAbs_EDGE: computeCost = 2; break;
default: computeCost = 1;
}
SMESH_subMeshIteratorPtr childIt = getDependsOnIterator(/*includeSelf=*/false);
}
// Compute
+ // to restore cout that may be redirected by algo
+ std::streambuf* coutBuffer = std::cout.rdbuf();
+
//cleanDependants(); for "UseExisting_*D" algos
//removeSubMeshElementsAndNodes();
loadDependentMeshes();
_computeState = FAILED_TO_COMPUTE;
_computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
+
algo->InitComputeError();
MemoryReserve aMemoryReserve;
else
ret = false;
}
+ std::cout.rdbuf( coutBuffer ); // restore cout that could be redirected by algo
+
// check if an error reported on any sub-shape
bool isComputeErrorSet = !checkComputeError( algo, ret, shape );
if ( isComputeErrorSet )
if (ret)
{
for (; ret && subS.More(); subS.Next())
- ret = _father->GetSubMesh( subS.Current() )->IsMeshComputed();
+ if ( !_father->GetSubMesh( subS.Current() )->IsMeshComputed() &&
+ ( _subShape.ShapeType() != TopAbs_EDGE ||
+ !algo->isDegenerated( TopoDS::Edge( subS.Current() ))))
+ ret = false;
}
// Set _computeError
if (!ret && !isComputeErrorSet)
if ( _computeState != COMPUTE_OK )
{
if ( _subShape.ShapeType() == TopAbs_EDGE &&
- BRep_Tool::Degenerated( TopoDS::Edge( _subShape )) )
+ SMESH_Algo::isDegenerated( TopoDS::Edge( _subShape )) )
_computeState = COMPUTE_OK;
else if ( theComputeOK )
_computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);