X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_WireBuilder.cpp;h=f342ccdef0386d1c104975ad780397709dc16ead;hb=b06cf1477fb1ee46d7ae260c234cac5d0000abf2;hp=539ddb44a6d7e1d2f7b75162e6ca351f2e8ed469;hpb=8b8d6a8bc075c674a106ab8c484d28058a1f0ea2;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp index 539ddb44a..f342ccdef 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp @@ -31,11 +31,12 @@ #include //================================================================================================= -std::shared_ptr GeomAlgoAPI_WireBuilder::wire(const ListOfShape& theShapes) +GeomShapePtr GeomAlgoAPI_WireBuilder::wire(const ListOfShape& theShapes) { TopTools_ListOfShape aListOfEdges; - for(ListOfShape::const_iterator anIt = theShapes.cbegin(); anIt != theShapes.cend(); ++anIt) { + ListOfShape::const_iterator anIt = theShapes.cbegin(); + for(; anIt != theShapes.cend(); ++anIt) { const TopoDS_Shape& aShape = (*anIt)->impl(); switch(aShape.ShapeType()) { case TopAbs_EDGE: { @@ -66,25 +67,26 @@ std::shared_ptr GeomAlgoAPI_WireBuilder::wire(const ListOfShape& } //================================================================================================= -bool GeomAlgoAPI_WireBuilder::isSelfIntersected(const std::shared_ptr& theWire) +bool GeomAlgoAPI_WireBuilder::isSelfIntersected(const GeomShapePtr& theWire) { // Collect edges. ListOfShape anEdges; - for (GeomAPI_ShapeExplorer anExp(theWire, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { + GeomAPI_ShapeExplorer anExp(theWire, GeomAPI_Shape::EDGE); + for (; anExp.more(); anExp.next()) { GeomShapePtr anEdge = anExp.current(); anEdges.push_back(anEdge); } // Check intersections between edges pair-wise int aNbEdges = (int)anEdges.size(); - std::list >::const_iterator anEdgesIt = anEdges.begin(); + std::list::const_iterator anEdgesIt = anEdges.begin(); for (int i = 0; anEdgesIt != anEdges.end(); ++anEdgesIt, i++) { - std::shared_ptr anEdge1(new GeomAPI_Edge(*anEdgesIt)); + GeomEdgePtr anEdge1(new GeomAPI_Edge(*anEdgesIt)); - std::list >::const_iterator anOtherEdgesIt = std::next(anEdgesIt); + std::list::const_iterator anOtherEdgesIt = std::next(anEdgesIt); for (int j = i + 1; anOtherEdgesIt != anEdges.end(); ++anOtherEdgesIt, j++) { - std::shared_ptr anEdge2(new GeomAPI_Edge(*anOtherEdgesIt)); + GeomEdgePtr anEdge2(new GeomAPI_Edge(*anOtherEdgesIt)); GeomShapePtr anInter = anEdge1->intersect(anEdge2); if (!anInter.get()) { continue; @@ -93,8 +95,8 @@ bool GeomAlgoAPI_WireBuilder::isSelfIntersected(const std::shared_ptrisVertex()) { - std::shared_ptr aVertex(new GeomAPI_Vertex(anInter)); - std::shared_ptr aPnt = aVertex->point(); + GeomVertexPtr aVertex(new GeomAPI_Vertex(anInter)); + GeomPointPtr aPnt = aVertex->point(); GeomPointPtr aFirstPnt1 = anEdge1->orientation() == GeomAPI_Shape::FORWARD ? anEdge1->firstPoint() : anEdge1->lastPoint(); @@ -105,7 +107,7 @@ bool GeomAlgoAPI_WireBuilder::isSelfIntersected(const std::shared_ptrorientation() == GeomAPI_Shape::FORWARD ? anEdge2->lastPoint() : anEdge2->firstPoint(); - std::shared_ptr aCommonEndPnt; + GeomPointPtr aCommonEndPnt; if (aFirstPnt1->isEqual(aLastPnt2)) { aCommonEndPnt = aFirstPnt1; } else if(aLastPnt1->isEqual(aFirstPnt2)) {