X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_SketchBuilder.cpp;h=8359b32448f7c4364eba15947190893696733dbb;hb=580f1752efd9d3e8c2890c4016b04dafd639bab7;hp=4e894827d7f63d037da9748132f9784a6107f721;hpb=35a88fdd724349275bbff32b9596a44e7cd422e2;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp index 4e894827d..8359b3244 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAlgoAPI_SketchBuilder.cpp // Created: 02 Jun 2014 // Author: Artem ZHIDKOV @@ -80,8 +82,9 @@ static void removeWasteEdges(std::list::iterator& theStartVertex, void GeomAlgoAPI_SketchBuilder::createFaces( - const std::shared_ptr& theOrigin, const std::shared_ptr& theDirX, - const std::shared_ptr& theDirY, const std::shared_ptr& theNorm, + const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theNorm, const std::list >& theFeatures, std::list >& theResultFaces, std::list >& theResultWires) @@ -130,8 +133,8 @@ void GeomAlgoAPI_SketchBuilder::createFaces( return; gp_Dir aDirX = theDirX->impl(); - gp_Dir aDirY = theDirY->impl(); gp_Dir aNorm = theNorm->impl(); + gp_Dir aDirY = aNorm.Crossed(aDirX); gp_Pln aPlane(theOrigin->impl(), aNorm); @@ -373,18 +376,28 @@ void GeomAlgoAPI_SketchBuilder::createFaces( void GeomAlgoAPI_SketchBuilder::createFaces(const std::shared_ptr& theOrigin, const std::shared_ptr& theDirX, - const std::shared_ptr& theDirY, const std::shared_ptr& theNorm, const std::shared_ptr& theWire, std::list >& theResultFaces) { - std::shared_ptr aWire = std::dynamic_pointer_cast(theWire); - if(!aWire) - return; - // Filter wires, return only faces. std::list > aFilteredWires; - createFaces(theOrigin, theDirX, theDirY, theNorm, - aWire->getEdges(), theResultFaces, aFilteredWires); + std::shared_ptr aWire = + std::dynamic_pointer_cast(theWire); + if(aWire) { + // Filter wires, return only faces. + createFaces(theOrigin, theDirX, theNorm, + aWire->getEdges(), theResultFaces, aFilteredWires); + + return; + } else { // it may be only one circle + std::shared_ptr anEdge = std::dynamic_pointer_cast(theWire); + if (anEdge) { + std::list > aList; + aList.push_back(anEdge); + createFaces(theOrigin, theDirX, theNorm, + aList, theResultFaces, aFilteredWires); + } + } }