Salome HOME
Fix for GeomAlgoAPI_FaceBuidler method name change.
authordbv <dbv@opencascade.com>
Fri, 22 May 2015 17:01:39 +0000 (20:01 +0300)
committerdbv <dbv@opencascade.com>
Fri, 22 May 2015 17:01:39 +0000 (20:01 +0300)
src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.h

index d03b76169da3c224762f41fcdb5057e3885333cb..fd014f73fafc53c9cf7e3b67b5baf5621efad207 100644 (file)
@@ -42,18 +42,6 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_FaceBuilder::square(
   return aRes;
 }
 
-std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_FaceBuilder::plane(std::shared_ptr<GeomAPI_Pnt> theCenter,
-                                                              std::shared_ptr<GeomAPI_Dir> theNormal)
-{
-  const gp_Pnt& aCenter = theCenter->impl<gp_Pnt>();
-  const gp_Dir& aDir = theNormal->impl<gp_Dir>();
-  gp_Pln aPlane(aCenter, aDir);
-  BRepBuilderAPI_MakeFace aFaceBuilder(aPlane);
-  std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
-  aRes->setImpl(new TopoDS_Shape(aFaceBuilder.Face()));
-  return aRes;
-}
-
 std::shared_ptr<GeomAPI_Pln> GeomAlgoAPI_FaceBuilder::plane(
     std::shared_ptr<GeomAPI_Shape> theFace)
 {
@@ -82,6 +70,23 @@ std::shared_ptr<GeomAPI_Pln> GeomAlgoAPI_FaceBuilder::plane(
   return aResult;
 }
 
+std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_FaceBuilder::planarFace(std::shared_ptr<GeomAPI_Ax1> theAxis)
+{
+  return planarFace(theAxis->origin(), theAxis->dir());
+}
+
+std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_FaceBuilder::planarFace(std::shared_ptr<GeomAPI_Pnt> theCenter,
+                                                                   std::shared_ptr<GeomAPI_Dir> theNormal)
+{
+  const gp_Pnt& aCenter = theCenter->impl<gp_Pnt>();
+  const gp_Dir& aDir = theNormal->impl<gp_Dir>();
+  gp_Pln aPlane(aCenter, aDir);
+  BRepBuilderAPI_MakeFace aFaceBuilder(aPlane);
+  std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
+  aRes->setImpl(new TopoDS_Shape(aFaceBuilder.Face()));
+  return aRes;
+}
+
 std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_FaceBuilder::planarFace(std::shared_ptr<GeomAPI_Pln> thePlane,
              double theX, double theY,
              double theWidth, double theHeight)
index 9f15bb5c090b3da652499945e128a3636ab65094..204e0f36c7877e6dd92dcb6ccd55e95582983415 100644 (file)
@@ -8,6 +8,7 @@
 #define GeomAlgoAPI_FaceBuilder_H_
 
 #include <GeomAlgoAPI.h>
+#include <GeomAPI_Ax1.h>
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Pln.h>
@@ -32,13 +33,16 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_FaceBuilder
   static std::shared_ptr<GeomAPI_Shape> square(std::shared_ptr<GeomAPI_Pln> thePlane,
                                                const double theSize);
 
-  /// Creates the plane by given point of the center and normal to the plane.
-  static std::shared_ptr<GeomAPI_Shape> plane(std::shared_ptr<GeomAPI_Pnt> theCenter,
-                                            std::shared_ptr<GeomAPI_Dir> theNormal);
-
   /// Returns the plane of the planar face. If it is not planar, returns empty ptr.
   static std::shared_ptr<GeomAPI_Pln> plane(std::shared_ptr<GeomAPI_Shape> theFace);
 
+  /// Creates the planar face by given axis.
+  static std::shared_ptr<GeomAPI_Shape> planarFace(std::shared_ptr<GeomAPI_Ax1> theAxis);
+
+  /// Creates the planar face by given point of the center and normal to the plane.
+  static std::shared_ptr<GeomAPI_Shape> planarFace(std::shared_ptr<GeomAPI_Pnt> theCenter,
+                                                   std::shared_ptr<GeomAPI_Dir> theNormal);
+
   /// Creates a planar face by given plane, left lower point and size.
   static std::shared_ptr<GeomAPI_Shape> planarFace(std::shared_ptr<GeomAPI_Pln> thePlane,
                                                    double theX, double theY,