]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ConstructionAPI/ConstructionAPI_Plane.cpp
Salome HOME
Issue #1649: Added options to create plane by three points;
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Plane.cpp
index b8160ca89367790a266a78be6792c27dd6245459..b33d4d74611c3d39ee3ae8d7c6cb9cdf1756f83d 100644 (file)
@@ -7,8 +7,7 @@
 //--------------------------------------------------------------------------------------
 #include "ConstructionAPI_Plane.h"
 //--------------------------------------------------------------------------------------
-#include <ModelHighAPI_Double.h>
-#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
 //--------------------------------------------------------------------------------------
 ConstructionAPI_Plane::ConstructionAPI_Plane(
     const std::shared_ptr<ModelAPI_Feature> & theFeature)
@@ -49,8 +48,9 @@ void ConstructionAPI_Plane::setFaceAndDistance(
     const ModelHighAPI_Selection & theFace,
     const ModelHighAPI_Double & theDistance)
 {
-  theFace.fillAttribute(myface);
-  theDistance.fillAttribute(mydistance);
+  fillAttribute("PlaneByFaceAndDistance", mycreationMethod);
+  fillAttribute(theFace, myplane);
+  fillAttribute(theDistance, mydistance);
 
   execute();
 }
@@ -61,17 +61,16 @@ void ConstructionAPI_Plane::setGeneralEquation(
     const ModelHighAPI_Double & theC,
     const ModelHighAPI_Double & theD)
 {
-  theA.fillAttribute(myA);
-  theB.fillAttribute(myB);
-  theC.fillAttribute(myC);
-  theD.fillAttribute(myD);
+  fillAttribute("PlaneByGeneralEquation", mycreationMethod);
+  fillAttribute(theA, myA);
+  fillAttribute(theB, myB);
+  fillAttribute(theC, myC);
+  fillAttribute(theD, myD);
 
   execute();
 }
 
 //--------------------------------------------------------------------------------------
-// TODO(spo): make add* as static functions of the class
-
 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document> & thePart,
                   const ModelHighAPI_Selection & theFace,
                   const ModelHighAPI_Double & theDistance)