From 3b0a356cbc6871f23ad9d93eedad7ba1c536f40e Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 6 Mar 2007 10:44:59 +0000 Subject: [PATCH] NPAL14978: EDF373: GEOM Script working on 3.2.1, not in 3.2.4, 3.2.5. Improved Partition to correctly process shapes, contained in compounds several times. A fix by PKV. --- src/NMTDS/NMTDS_ShapesDataStructure.cxx | 42 +++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/NMTDS/NMTDS_ShapesDataStructure.cxx b/src/NMTDS/NMTDS_ShapesDataStructure.cxx index 229f3c543..c7355995b 100644 --- a/src/NMTDS/NMTDS_ShapesDataStructure.cxx +++ b/src/NMTDS/NMTDS_ShapesDataStructure.cxx @@ -24,17 +24,19 @@ #include + +#include + #include #include + +#include #include +#include + #include #include -#include #include -// -#include -#include -#include //=========================================================================== //function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure @@ -152,27 +154,29 @@ NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors aLx; NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors aLit; TopoDS_Iterator anIt; - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors aMSA; - // Contribution of Samtech www.samcef.com END // anIt.Initialize(myCompositeShape); - for (i=0; anIt.More(); anIt.Next(), ++i) { - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN + for (; anIt.More(); anIt.Next()) { const TopoDS_Shape& aSx=anIt.Value(); BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors aMS; - FillMap(aSx, aMSA, aMS); - aLx.Append(aMS); - // Contribution of Samtech www.samcef.com END + //modified by NIZNHY-PKV Tue Feb 27 17:05:47 2007f + //FillMap(aSx, aMSA, aMS); + //aLx.Append(aMS); + // + if (!aMSA.Contains(aSx)) { + FillMap(aSx, aMSA, aMS); + aLx.Append(aMS); + } + //modified by NIZNHY-PKV Tue Feb 27 17:06:03 2007t } - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN + // aNbS=aMSA.Extent(); - // Contribution of Samtech www.samcef.com END // // Fill myRanges + //modified by NIZNHY-PKV Tue Feb 27 17:10:07 2007f + i=aLx.Extent(); + //modified by NIZNHY-PKV Tue Feb 27 17:10:10 2007t myRanges.Resize(i); aLit.Initialize(aLx); for (i=1; aLit.More(); aLit.Next(), ++i) { @@ -210,8 +214,6 @@ // Contribution of Samtech www.samcef.com BEGIN // // Fill the table - //modified by NIZNHY-PKV Tue May 16 11:47:28 2006f - //aShift=0; //for (i=0; i<2; ++i) { // if (i) { @@ -224,7 +226,7 @@ // InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift); // } //} - + aShift=0; for (j=1; j<=aNbS; ++j) { const TopoDS_Shape& aSx=aMSA.FindKey(j); -- 2.30.2