From: dbv Date: Thu, 7 Apr 2016 15:38:24 +0000 (+0300) Subject: Removed unused fields from pipe algo X-Git-Tag: V_2.3.0~264 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=01542223df41faf56ce549a789912595e9f1f3b1;p=modules%2Fshaper.git Removed unused fields from pipe algo --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp index 0143ddc94..38b2eb57e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -412,7 +413,26 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh } // Try to cut with base face. If it can not be done then keep result of cut with bounding plane. - TopoDS_Shape aModifiedBaseShape = aBaseShape; + TopoDS_Shape aModifiedBaseShape; + if(aShapeTypeToExp != TopAbs_FACE) { + ListOfShape aList; + GeomShapePtr aSh(new GeomAPI_Shape()); + aSh->setImpl(new TopoDS_Shape(aBaseShape)); + std::shared_ptr theCenter(new GeomAPI_Pnt(aBasePlane->Location().X(), + aBasePlane->Location().Y(), + aBasePlane->Location().Z())); + std::shared_ptr theNormal(new GeomAPI_Dir(aBasePlane->Axis().Direction().X(), + aBasePlane->Axis().Direction().Y(), + aBasePlane->Axis().Direction().Z())); + GeomShapePtr aPln = GeomAlgoAPI_FaceBuilder::planarFace(theCenter, theNormal); + + aList.push_back(aSh); + std::list > aBoundingPoints = GeomAlgoAPI_ShapeTools::getBoundingBox(aList); + + aSh = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPln, aBoundingPoints); + } else { + aModifiedBaseShape = aBaseShape; + } if(isFromFaceSet) { if(aModifiedBaseShape.ShapeType() == TopAbs_FACE) { aModifiedBaseShape.Orientation(TopAbs_REVERSED);