-boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_FaceBuilder::square(
- boost::shared_ptr<GeomAPI_Pnt> theCenter, boost::shared_ptr<GeomAPI_Dir> theNormal,
+//==================================================================================================
+std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::squareFace(
+ const std::shared_ptr<GeomAPI_Pnt> theCenter,
+ const std::shared_ptr<GeomAPI_Dir> theNormal,
+ const double theSize)
+{
+ const gp_Pnt& aCenter = theCenter->impl<gp_Pnt>();
+ const gp_Dir& aDir = theNormal->impl<gp_Dir>();
+ gp_Pln aPlane(aCenter, aDir);
+ // half of the size in each direction from the center
+ BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, -theSize / 2., theSize / 2., -theSize / 2.,
+ theSize / 2.);
+ std::shared_ptr<GeomAPI_Face> aRes(new GeomAPI_Face());
+ aRes->setImpl(new TopoDS_Face(aFaceBuilder.Face()));
+ return aRes;
+}
+
+//==================================================================================================
+std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::squareFace(
+ const std::shared_ptr<GeomAPI_Pln> thePlane,