From 3c3a34a6515ac15f7cb8a77e2f307d3835b72b78 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 13 Mar 2018 13:14:39 +0300 Subject: [PATCH] Support of the newer version of OCCT 7.2.0 with patches --- src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp | 2 +- src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp | 15 ++++--- src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp | 4 +- .../GeomAlgoAPI_UnifySameDomain.cpp | 1 - src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx | 40 ++++++++----------- src/GeomAlgoImpl/GEOMAlgo_Splitter.hxx | 9 ++--- src/ModelAPI/Test/Test1512.py | 6 +-- src/ModelAPI/Test/Test2358_2.py | 2 +- 8 files changed, 34 insertions(+), 45 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp index 39a18c4af..de0eee7eb 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp @@ -41,7 +41,7 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids) { BOPAlgo_PaveFiller* aPaveFiller = new BOPAlgo_PaveFiller; - BOPCol_ListOfShape aListOfShape; + TopTools_ListOfShape aListOfShape; for(ListOfShape::const_iterator anIt = theListOfShape.cbegin(); anIt != theListOfShape.cend(); anIt++) { const TopoDS_Shape& aShape = (*anIt)->impl(); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index d03f8e05c..901e257c6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -182,8 +181,8 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( } // Map subshapes and shapes. - BOPCol_IndexedDataMapOfShapeListOfShape aMapSA; - BOPTools::MapShapesAndAncestors(aShapesComp, aTS, aTA, aMapSA); + TopTools_IndexedDataMapOfShapeListOfShape aMapSA; + TopExp::MapShapesAndAncestors(aShapesComp, aTS, aTA, aMapSA); if(aMapSA.IsEmpty()) { return aResult; } @@ -191,10 +190,10 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( // Get all shapes with common subshapes and free shapes. NCollection_Map aFreeShapes; NCollection_Vector> aShapesWithCommonSubshapes; - for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator + for(TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) { const TopoDS_Shape& aShape = anIter.Key(); - BOPCol_ListOfShape& aListOfShape = anIter.ChangeValue(); + TopTools_ListOfShape& aListOfShape = anIter.ChangeValue(); if(aListOfShape.IsEmpty()) { continue; } @@ -217,9 +216,9 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( for(NCollection_List::Iterator aTempIter(aTempList); aTempIter.More(); aTempIter.Next()) { const TopoDS_Shape& aTempShape = aTempIter.Value(); - for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator + for(TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) { - BOPCol_ListOfShape& aTempListOfShape = anIter.ChangeValue(); + TopTools_ListOfShape& aTempListOfShape = anIter.ChangeValue(); if(aTempListOfShape.IsEmpty()) { continue; } else if(aTempListOfShape.Size() == 1 && aTempListOfShape.First() == aTempShape) { @@ -351,7 +350,7 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::groupSharedTopology( // Iterate over all shapes and find shapes with shared vertices. TopTools_ListOfShape aMapOrder; - BOPCol_DataMapOfShapeListOfShape aVertexShapesMap; + TopTools_DataMapOfShapeListOfShape aVertexShapesMap; for(NCollection_List::Iterator aShapesIt(anUngroupedShapes); aShapesIt.More(); aShapesIt.Next()) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp index bf58316e8..fb1699226 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp @@ -209,8 +209,8 @@ void GeomAlgoAPI_SketchBuilder::createFaces( BOPAlgo_Builder aBB; aBB.AddArgument(aPlnFace); - BOPCol_ListOfShape anEdges; - BOPCol_ListIteratorOfListOfShape aShapeIt; + NCollection_List anEdges; + NCollection_List::Iterator aShapeIt; std::list >::const_iterator aFeatIt = theFeatures.begin(); for (; aFeatIt != theFeatures.end(); aFeatIt++) { std::shared_ptr aShape(*aFeatIt); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp index 356c15be1..290d5bd52 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp @@ -58,7 +58,6 @@ void GeomAlgoAPI_UnifySameDomain::build(const ListOfShape& theShapes) this->setImpl(aUnifyAlgo); aUnifyAlgo->Initialize(aShell); - aUnifyAlgo->UnifyFacesAndEdges(); aUnifyAlgo->Build(); TopoDS_Shape aResult = aUnifyAlgo->Shape(); diff --git a/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx b/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx index ed3fd90d4..0bdebe8c1 100755 --- a/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx +++ b/src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx @@ -23,22 +23,16 @@ #include #include - +#include #include #include #include #include -#include -#include - -#include - - static void TreatCompound(const TopoDS_Shape& aC, - BOPCol_ListOfShape& aLSX); + NCollection_List& aLSX); //======================================================================= //function : @@ -90,7 +84,7 @@ void GEOMAlgo_Splitter::AddTool(const TopoDS_Shape& theShape) //function : Tools //purpose : //======================================================================= -const BOPCol_ListOfShape& GEOMAlgo_Splitter::Tools()const +const NCollection_List& GEOMAlgo_Splitter::Tools()const { return myTools; } @@ -145,8 +139,8 @@ void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType) { TopAbs_ShapeEnum aType; BRep_Builder aBB; - BOPCol_MapOfShape aM; - BOPCol_ListIteratorOfListOfShape aIt, aItIm; + NCollection_Map aM; + NCollection_List::Iterator aIt, aItIm; // aIt.Initialize(myArguments); for (; aIt.More(); aIt.Next()) { @@ -154,7 +148,7 @@ void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType) aType=aS.ShapeType(); if (aType==theType && !myMapTools.Contains(aS)) { if (myImages.IsBound(aS)) { - const BOPCol_ListOfShape& aLSIm=myImages.Find(aS); + const NCollection_List& aLSIm=myImages.Find(aS); aItIm.Initialize(aLSIm); for (; aItIm.More(); aItIm.Next()) { const TopoDS_Shape& aSIm=aItIm.Value(); @@ -181,11 +175,11 @@ void GEOMAlgo_Splitter::PostTreat() Standard_Integer i, aNbS; BRep_Builder aBB; TopoDS_Compound aC; - BOPCol_IndexedMapOfShape aMx; + TopTools_IndexedMapOfShape aMx; // aBB.MakeCompound(aC); // - BOPTools::MapShapes(myShape, myLimit, aMx); + TopExp::MapShapes(myShape, myLimit, aMx); aNbS=aMx.Extent(); for (i=1; i<=aNbS; ++i) { const TopoDS_Shape& aS=aMx(i); @@ -194,9 +188,9 @@ void GEOMAlgo_Splitter::PostTreat() if (myLimitMode) { Standard_Integer iType, iLimit, iTypeX; TopAbs_ShapeEnum aType, aTypeX; - BOPCol_ListOfShape aLSP, aLSX; - BOPCol_ListIteratorOfListOfShape aIt, aItX, aItIm; - BOPCol_MapOfShape aM; + NCollection_List aLSP, aLSX; + NCollection_List::Iterator aIt, aItX, aItIm; + NCollection_Map aM; // iLimit=(Standard_Integer)myLimit; // @@ -234,13 +228,13 @@ void GEOMAlgo_Splitter::PostTreat() }// for (; aIt.More(); aIt.Next()) { // aMx.Clear(); - BOPTools::MapShapes(aC, aMx); + TopExp::MapShapes(aC, aMx); // 2. Add them to aC aIt.Initialize(aLSP); for (; aIt.More(); aIt.Next()) { const TopoDS_Shape& aS=aIt.Value(); if (myImages.IsBound(aS)) { - const BOPCol_ListOfShape& aLSIm=myImages.Find(aS); + const NCollection_List& aLSIm=myImages.Find(aS); aItIm.Initialize(aLSIm); for (; aItIm.More(); aItIm.Next()) { const TopoDS_Shape& aSIm=aItIm.Value(); @@ -265,7 +259,7 @@ void GEOMAlgo_Splitter::PostTreat() // Standard_Integer aNbS; TopoDS_Iterator aIt; - BOPCol_ListOfShape aLS; + NCollection_List aLS; // aIt.Initialize(myShape); for (; aIt.More(); aIt.Next()) { @@ -284,12 +278,12 @@ void GEOMAlgo_Splitter::PostTreat() //purpose : //======================================================================= void TreatCompound(const TopoDS_Shape& aC1, - BOPCol_ListOfShape& aLSX) + NCollection_List& aLSX) { Standard_Integer aNbC1; TopAbs_ShapeEnum aType; - BOPCol_ListOfShape aLC, aLC1; - BOPCol_ListIteratorOfListOfShape aIt, aIt1; + NCollection_List aLC, aLC1; + NCollection_List::Iterator aIt, aIt1; TopoDS_Iterator aItC; // aLC.Append (aC1); diff --git a/src/GeomAlgoImpl/GEOMAlgo_Splitter.hxx b/src/GeomAlgoImpl/GEOMAlgo_Splitter.hxx index ad827f3e4..a698781e9 100644 --- a/src/GeomAlgoImpl/GEOMAlgo_Splitter.hxx +++ b/src/GeomAlgoImpl/GEOMAlgo_Splitter.hxx @@ -36,9 +36,6 @@ #include -#include -#include - #include //======================================================================= @@ -67,7 +64,7 @@ GEOMALGOIMPL_EXPORT void AddTool(const TopoDS_Shape& theShape); /// Returns list of tool shapes - GEOMALGOIMPL_EXPORT const BOPCol_ListOfShape& Tools()const; + GEOMALGOIMPL_EXPORT const NCollection_List& Tools()const; /// Set type of used shapes /// \param aLimit a shape type @@ -96,10 +93,10 @@ protected: /// List of tools - BOPCol_ListOfShape myTools; + NCollection_List myTools; /// Map of tools - BOPCol_MapOfShape myMapTools; + NCollection_Map myMapTools; /// A limit type TopAbs_ShapeEnum myLimit; diff --git a/src/ModelAPI/Test/Test1512.py b/src/ModelAPI/Test/Test1512.py index b9e7e44ae..9afa65d1c 100755 --- a/src/ModelAPI/Test/Test1512.py +++ b/src/ModelAPI/Test/Test1512.py @@ -158,10 +158,10 @@ def check_owner(selection, topology_type, feature): check_owner("Extrusion_1_1/Generated_Face_1", "face", aBox) check_owner("Boolean_2_1/Modified_Face_3", "face", aBox) check_owner("Boolean_1_1/Modified_Face_1", "face", aHoleExt) -check_owner("Boolean_2_1/Modified_Face_2", "face", aTower) +check_owner("Boolean_2_1/Modified_Face_1", "face", aTower) # check edges without ambiguity -check_owner("Boolean_2_1/Modified_Face_3&Extrusion_1_1/Generated_Face_2", "edge", aBox) -check_owner("Boolean_2_1/Modified_Face_2&Extrusion_3_1/To_Face_1_1", "edge", aTower) +check_owner("Boolean_2_1/Modified_Face_2&Extrusion_1_1/Generated_Face_2", "edge", aBox) +check_owner("Boolean_2_1/Modified_Face_1&Extrusion_3_1/To_Face_1_1", "edge", aTower) # check the connected topology method: solid is not a compound of connected topology assert(aFuse.firstResult().shape().isConnectedTopology() == False) diff --git a/src/ModelAPI/Test/Test2358_2.py b/src/ModelAPI/Test/Test2358_2.py index 02922ebf6..9429879bc 100644 --- a/src/ModelAPI/Test/Test2358_2.py +++ b/src/ModelAPI/Test/Test2358_2.py @@ -112,7 +112,7 @@ Fillet_1 = model.addFillet(Part_1_doc, Fillet_1_objects, 2) Group_1_objects = [model.selection("FACE", "Fillet_1_1/Modified_Face_3"), model.selection("FACE", "Fillet_1_1/Modified_Face_5"), model.selection("FACE", "Fillet_1_1/Modified_Face_9"), model.selection("FACE", "Fillet_1_1/Modified_Face_15")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) Group_2 = model.addGroup(Part_1_doc, [model.selection("EDGE", "Fillet_1_1/Fillet_Face_13&Fillet_1_1/Modified_Face_4"), model.selection("EDGE", "Fillet_1_1/Modified_Face_11&Fillet_1_1/Fillet_Face_13")]) -Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Fillet_1_1/Modified_Face_12&ExtrusionCut_1_1/Modfied_6&Fillet_1_1/Modified_Face_11"), model.selection("VERTEX", "ExtrusionCut_1_1/Modfied_6&Fillet_1_1/Modified_Face_11&Fillet_1_1/Modified_Face_6")]) +Group_3 = model.addGroup(Part_1_doc, [model.selection("VERTEX", "Fillet_1_1/Modified_Face_12&ExtrusionCut_1_1/Generated_Face_4&Fillet_1_1/Modified_Face_11"), model.selection("VERTEX", "ExtrusionCut_1_1/Generated_Face_4&Fillet_1_1/Modified_Face_11&Fillet_1_1/Modified_Face_6")]) model.do() Folder_1 = model.addFolder(Part_1_doc, Sketch_3, ExtrusionCut_2) -- 2.39.2