Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ILMAB: export GEOM fields to MED file
[modules/smesh.git]
/
src
/
SMESH
/
SMESH_subMesh.cxx
diff --git
a/src/SMESH/SMESH_subMesh.cxx
b/src/SMESH/SMESH_subMesh.cxx
index 483495be5fa4cafabcbf9182920034dcb1f6882c..0b9269fed84d62ef9e4fa8fcaec5780725ba78e8 100644
(file)
--- a/
src/SMESH/SMESH_subMesh.cxx
+++ b/
src/SMESH/SMESH_subMesh.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
3
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
4
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-385,9
+385,9
@@
int SMESH_subMesh::computeCost() const
int computeCost;
switch ( _subShape.ShapeType() ) {
case TopAbs_SOLID:
int computeCost;
switch ( _subShape.ShapeType() ) {
case TopAbs_SOLID:
- case TopAbs_SHELL: computeCost =
1
000; break;
- case TopAbs_FACE: computeCost =
1
00; break;
- case TopAbs_EDGE: computeCost =
10
; break;
+ case TopAbs_SHELL: computeCost =
5
000; break;
+ case TopAbs_FACE: computeCost =
5
00; break;
+ case TopAbs_EDGE: computeCost =
2
; break;
default: computeCost = 1;
}
SMESH_subMeshIteratorPtr childIt = getDependsOnIterator(/*includeSelf=*/false);
default: computeCost = 1;
}
SMESH_subMeshIteratorPtr childIt = getDependsOnIterator(/*includeSelf=*/false);
@@
-1381,7
+1381,7
@@
static void cleanSubMesh( SMESH_subMesh * subMesh )
const SMDS_MeshElement * elt = ite->next();
//MESSAGE( " RM elt: "<<elt->GetID()<<" ( "<<elt->NbNodes()<<" )" );
//meshDS->RemoveElement(elt);
const SMDS_MeshElement * elt = ite->next();
//MESSAGE( " RM elt: "<<elt->GetID()<<" ( "<<elt->NbNodes()<<" )" );
//meshDS->RemoveElement(elt);
- meshDS->RemoveFreeElement(elt,
subMeshDS
);
+ meshDS->RemoveFreeElement(elt,
0
);
}
SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes();
}
SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes();
@@
-1389,10
+1389,11
@@
static void cleanSubMesh( SMESH_subMesh * subMesh )
const SMDS_MeshNode * node = itn->next();
//MESSAGE( " RM node: "<<node->GetID());
if ( node->NbInverseElements() == 0 )
const SMDS_MeshNode * node = itn->next();
//MESSAGE( " RM node: "<<node->GetID());
if ( node->NbInverseElements() == 0 )
- meshDS->RemoveFreeNode(node,
subMeshDS
);
+ meshDS->RemoveFreeNode(node,
0
);
else // for StdMeshers_CompositeSegment_1D: node in one submesh, edge in another
meshDS->RemoveNode(node);
}
else // for StdMeshers_CompositeSegment_1D: node in one submesh, edge in another
meshDS->RemoveNode(node);
}
+ subMeshDS->Clear();
}
}
}
}
}
}
@@
-1560,6
+1561,9
@@
bool SMESH_subMesh::ComputeStateEngine(int event)
}
// Compute
}
// Compute
+ // to restore cout that may be redirected by algo
+ std::streambuf* coutBuffer = std::cout.rdbuf();
+
//cleanDependants(); for "UseExisting_*D" algos
//removeSubMeshElementsAndNodes();
loadDependentMeshes();
//cleanDependants(); for "UseExisting_*D" algos
//removeSubMeshElementsAndNodes();
loadDependentMeshes();
@@
-1567,9
+1571,8
@@
bool SMESH_subMesh::ComputeStateEngine(int event)
_computeState = FAILED_TO_COMPUTE;
_computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
try {
_computeState = FAILED_TO_COMPUTE;
_computeError = SMESH_ComputeError::New(COMPERR_OK,"",algo);
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
+
algo->InitComputeError();
MemoryReserve aMemoryReserve;
algo->InitComputeError();
MemoryReserve aMemoryReserve;
@@
-1640,6
+1643,8
@@
bool SMESH_subMesh::ComputeStateEngine(int event)
else
ret = false;
}
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 )
// check if an error reported on any sub-shape
bool isComputeErrorSet = !checkComputeError( algo, ret, shape );
if ( isComputeErrorSet )
@@
-1649,7
+1654,10
@@
bool SMESH_subMesh::ComputeStateEngine(int event)
if (ret)
{
for (; ret && subS.More(); subS.Next())
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)
}
// Set _computeError
if (!ret && !isComputeErrorSet)
@@
-1964,7
+1972,7
@@
bool SMESH_subMesh::checkComputeError(SMESH_Algo* theAlgo,
if ( _computeState != COMPUTE_OK )
{
if ( _subShape.ShapeType() == TopAbs_EDGE &&
if ( _computeState != COMPUTE_OK )
{
if ( _subShape.ShapeType() == TopAbs_EDGE &&
-
BRep_Tool::
Degenerated( TopoDS::Edge( _subShape )) )
+
SMESH_Algo::is
Degenerated( TopoDS::Edge( _subShape )) )
_computeState = COMPUTE_OK;
else if ( theComputeOK )
_computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);
_computeState = COMPUTE_OK;
else if ( theComputeOK )
_computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);
@@
-2280,7
+2288,7
@@
void SMESH_subMesh::setEventListener(EventListener* listener,
EventListenerData* curData = l_d->second;
if ( curData && curData != data && curData->IsDeletable() )
delete curData;
EventListenerData* curData = l_d->second;
if ( curData && curData != data && curData->IsDeletable() )
delete curData;
- if ( l_d->first->IsDeletable() )
+ if ( l_d->first
!= listener && l_d->first
->IsDeletable() )
delete l_d->first;
_eventListeners.erase( l_d );
break;
delete l_d->first;
_eventListeners.erase( l_d );
break;