]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ConstructionAPI/ConstructionAPI_Plane.cpp
Salome HOME
Use ID() static functions of ConstructionAPI_Plane & ConstructionAPI_Point in add...
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Plane.cpp
index 103d9d6eb36ad0cf618a0800f0a8d725d9a82889..b8160ca89367790a266a78be6792c27dd6245459 100644 (file)
@@ -44,6 +44,7 @@ ConstructionAPI_Plane::~ConstructionAPI_Plane()
 
 }
 
+//--------------------------------------------------------------------------------------
 void ConstructionAPI_Plane::setFaceAndDistance(
     const ModelHighAPI_Selection & theFace,
     const ModelHighAPI_Double & theDistance)
@@ -67,3 +68,26 @@ void ConstructionAPI_Plane::setGeneralEquation(
 
   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)
+{
+  // TODO(spo): check that thePart is not empty
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ConstructionAPI_Plane::ID());
+  return PlanePtr(new ConstructionAPI_Plane(aFeature, theFace, theDistance));
+}
+
+PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document> & thePart,
+                  const ModelHighAPI_Double & theA,
+                  const ModelHighAPI_Double & theB,
+                  const ModelHighAPI_Double & theC,
+                  const ModelHighAPI_Double & theD)
+{
+  // TODO(spo): check that thePart is not empty
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ConstructionAPI_Plane::ID());
+  return PlanePtr(new ConstructionAPI_Plane(aFeature, theA, theB, theC, theD));
+}