From: srn Date: Mon, 27 Nov 2006 11:53:51 +0000 (+0000) Subject: SRN: Added method GetSame that returns a subshape of the main shape equal to the... X-Git-Tag: V3_2_4pre1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=acbab5295b4917bc339f9cc3094dd006889437b1;p=modules%2Fgeom.git SRN: Added method GetSame that returns a subshape of the main shape equal to the give shape --- diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index f9e44d18a..48f6dd2fc 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -2499,9 +2499,6 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2) if(P.Z() > zmaxB2) zmaxB2 = P.Z(); } - //cout << "Face1 = " << xminB1 << " " << yminB1 << " " << zminB1 << " " << xmaxB1 << " " << ymaxB1 << " " << zmaxB1 << endl; - //cout << "Face2 = " << xminB2 << " " << yminB2 << " " << zminB2 << " " << xmaxB2 << " " << ymaxB2 << " " << zmaxB2 << endl; - //Compare the bounding boxes of both faces if(gp_Pnt(xminB1, yminB1, zminB1).Distance(gp_Pnt(xminB2, yminB2, zminB2)) > MAX_TOLERANCE) return false; @@ -2509,14 +2506,6 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2) if(gp_Pnt(xmaxB1, ymaxB1, zmaxB1).Distance(gp_Pnt(xmaxB2, ymaxB2, zmaxB2)) > MAX_TOLERANCE) return false; - /* - TopTools_ListIteratorOfListOfShape LSI2t(LS2); - for(; LSI2t.More(); LSI2t.Next()) { - TopoDS_Shape aValue = LSI2t.Value(); - cout << (int)((void*)(aValue.TShape()->This()))<< endl; - } - */ - //Check that each edge of the Face1 has a counterpart in the Face2 TopTools_MapOfOrientedShape aMap; TopTools_ListIteratorOfListOfShape LSI1(LS1); @@ -2660,8 +2649,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object gp_Pnt P = BRep_Tool::Pnt(TopoDS::Vertex(aWhat)); TopExp_Explorer E(aWhere, TopAbs_VERTEX); for(; E.More(); E.Next()) { + if(!aMap.Add(E.Current())) continue; gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(E.Current())); - if(P.Distance(P2) < MAX_TOLERANCE) { + if(P.Distance(P2) <= MAX_TOLERANCE) { + isFound = true; aSubShape = E.Current(); break; }