From 5c4e117c1af698ec77ad2f01055ca271fd5d0014 Mon Sep 17 00:00:00 2001 From: szy Date: Fri, 24 Jan 2014 14:37:30 +0000 Subject: [PATCH] 24.01.2014. Fix for bug of limiting bounding wire name.. --- src/HYDROData/HYDROData_SplitToZonesTool.cxx | 23 ++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/HYDROData/HYDROData_SplitToZonesTool.cxx b/src/HYDROData/HYDROData_SplitToZonesTool.cxx index e4015d4a..d076706f 100644 --- a/src/HYDROData/HYDROData_SplitToZonesTool.cxx +++ b/src/HYDROData/HYDROData_SplitToZonesTool.cxx @@ -311,6 +311,8 @@ HYDROData_SplitToZonesTool::SplitDataList // make limiting face HYDROData_DataMapOfShapeListOfShape aDM4; Standard_Boolean hasLimits(Standard_False); + QString aBndName; + HYDROData_MapOfShape aBndView; if (! thePolyline.IsNull()) { const TopoDS_Wire aBndWire = TopoDS::Wire(thePolyline->GetShape()); if(!aBndWire.IsNull()) { @@ -325,10 +327,16 @@ HYDROData_SplitToZonesTool::SplitDataList #ifdef DEB_SPLIT_TO_ZONES BRepTools::Write(aComResult,"CommonV.brep"); #endif - + aBndName = thePolyline->GetName(); hasLimits = Standard_True; // DM2 should be filled here + TopExp_Explorer exp (limFace, TopAbs_EDGE); + for (int i =1;exp.More();exp.Next(),i++) { + const TopoDS_Shape& anEdge = exp.Current(); + if(anEdge.IsNull()) continue; + aBndView.Add(anEdge); + } HYDROData_MapOfShape aView; - TopExp_Explorer exp (aResult, TopAbs_FACE); + exp.Init (aResult, TopAbs_FACE); for (int i =1;exp.More();exp.Next(),i++) { const TopoDS_Shape& aFace = exp.Current(); if(!aFace.IsNull()) { @@ -502,13 +510,20 @@ HYDROData_SplitToZonesTool::SplitDataList for(int j =1;it.More();it.Next(),j++) { const TopoDS_Shape& aSh = it.Value(); //old if(aDM3.IsBound(aSh)) { - const QStringList& ObjectNames = aDM3.Find(aSh); + const QStringList& ObjectNames = aDM3.Find(aSh); aListOfNames.append(ObjectNames); #ifdef DEB_SPLIT_TO_ZONES TCollection_AsciiString aName = aNam4 + i +"_" + j + ".brep"; BRepTools::Write(aSh ,aName.ToCString()); #endif - } + } else { + if(aBndView.Contains(aSh) && hasLimits) { + aListOfNames.append(aBndName); +#ifdef DEB_SPLIT_TO_ZONES + cout << " BndName = "<