]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2559: Fix too long line.
authormzn <mzn@opencascade.com>
Fri, 13 Jul 2018 09:32:48 +0000 (12:32 +0300)
committermzn <mzn@opencascade.com>
Fri, 13 Jul 2018 09:32:48 +0000 (12:32 +0300)
src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.h

index 539ddb44a6d7e1d2f7b75162e6ca351f2e8ed469..f342ccdef0386d1c104975ad780397709dc16ead 100644 (file)
 #include <TopExp_Explorer.hxx>
 
 //=================================================================================================
-std::shared_ptr<GeomAPI_Shape> 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<TopoDS_Shape>();
     switch(aShape.ShapeType()) {
       case TopAbs_EDGE: {
@@ -66,25 +67,26 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_WireBuilder::wire(const ListOfShape&
 }
 
 //=================================================================================================
-bool GeomAlgoAPI_WireBuilder::isSelfIntersected(const std::shared_ptr<GeomAPI_Shape>& 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<std::shared_ptr<GeomAPI_Shape> >::const_iterator anEdgesIt = anEdges.begin();
+  std::list<GeomShapePtr>::const_iterator anEdgesIt = anEdges.begin();
   for (int i = 0; anEdgesIt != anEdges.end(); ++anEdgesIt, i++) {
-    std::shared_ptr<GeomAPI_Edge> anEdge1(new GeomAPI_Edge(*anEdgesIt));
+    GeomEdgePtr anEdge1(new GeomAPI_Edge(*anEdgesIt));
 
-    std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator anOtherEdgesIt = std::next(anEdgesIt);
+    std::list<GeomShapePtr>::const_iterator anOtherEdgesIt = std::next(anEdgesIt);
     for (int j = i + 1; anOtherEdgesIt != anEdges.end(); ++anOtherEdgesIt, j++) {
-      std::shared_ptr<GeomAPI_Edge> 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_ptr<GeomAPI_Sh
       bool isOk = false;
 
       if (anInter->isVertex()) {
-        std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex(anInter));
-        std::shared_ptr<GeomAPI_Pnt> 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_ptr<GeomAPI_Sh
         GeomPointPtr aLastPnt2 = anEdge2->orientation() == GeomAPI_Shape::FORWARD ?
                                  anEdge2->lastPoint() : anEdge2->firstPoint();
 
-        std::shared_ptr<GeomAPI_Pnt> aCommonEndPnt;
+        GeomPointPtr aCommonEndPnt;
         if (aFirstPnt1->isEqual(aLastPnt2)) {
           aCommonEndPnt = aFirstPnt1;
         } else if(aLastPnt1->isEqual(aFirstPnt2)) {
index 2599083e174ac512ca4335d178038a7be9a5497c..9d204ade706018e8c3b52733b44961095416941c 100644 (file)
@@ -36,12 +36,12 @@ class GeomAlgoAPI_WireBuilder
    /// The edges are not to be consecutive.
    /// But they are to be all connected geometrically or topologically.
    /// \return wire created from theShapes. Empty in case of error or bad input.
-   GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> wire(const ListOfShape& theShapes);
+   GEOMALGOAPI_EXPORT static GeomShapePtr wire(const ListOfShape& theShapes);
 
    /// \brief Checks if the wire is self-intersected.
    /// \param[in] theWire the wire to be checked
    /// \return true if the wire is self-intersected, otherwise - false.
-   GEOMALGOAPI_EXPORT static bool isSelfIntersected(const std::shared_ptr<GeomAPI_Shape>& theWire);
+   GEOMALGOAPI_EXPORT static bool isSelfIntersected(const GeomShapePtr& theWire);
 };
 
 #endif