From: skv Date: Wed, 15 Apr 2015 11:04:22 +0000 (+0300) Subject: 0023043: EDF 10596 GEOM: GetShapesOnShape does not return all shapes expected X-Git-Tag: V7_6_0rc1~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=01816571514e819ba417e0512b92f12c885ab3c4;p=modules%2Fgeom.git 0023043: EDF 10596 GEOM: GetShapesOnShape does not return all shapes expected --- diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 2afb575f3..affb64b9c 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -2787,9 +2787,31 @@ Handle(TColStd_HSequenceOfInteger) return aSeqOfIDs; } + // Compute classification tolerance. + TopTools_IndexedMapOfShape aMapVtx; + Standard_Real aTol = Precision::Confusion(); + + TopExp::MapShapes(aShape, TopAbs_VERTEX, aMapVtx); + + Standard_Integer i; + Standard_Integer aNbVtx = aMapVtx.Extent(); + + for (i = 1; i <= aNbVtx; ++i) { + const TopoDS_Vertex aVtx = TopoDS::Vertex(aMapVtx.FindKey(i)); + const Standard_Real aVtxTol = BRep_Tool::Tolerance(aVtx); + + if (aTol < aVtxTol) { + aTol = aVtxTol; + } + } + + // Bound the tolerance value. + if (aTol > 0.0001) { + aTol = 0.0001; + } + // Call algo GEOMAlgo_FinderShapeOn2 aFinder; - Standard_Real aTol = 0.0001; // default value Handle(GEOMAlgo_ClsfSolid) aClsfSolid = new GEOMAlgo_ClsfSolid; aClsfSolid->SetShape(aCheckShape);