Salome HOME
Revert "bos#35152 [EDF] (2023-T1) Sketch Circle should allow user to position constru...
[modules/shaper.git] / src / SketchAPI / SketchAPI_MacroCircle.cpp
index 64089321421253a697f567044c716a66cd0c904c..f5e459a407c5343d524dd51f019453d3a9e78980 100644 (file)
@@ -26,9 +26,6 @@
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
-#include <SketchAPI_Point.h>
-#include <SketchPlugin_ConstraintCoincidenceInternal.h>
-
 //==================================================================================================
 SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature)
 : SketchAPI_SketchEntity(theFeature)
@@ -41,24 +38,22 @@ SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feat
                                              double theCenterX,
                                              double theCenterY,
                                              double thePassedX,
-                                             double thePassedY,
-                                             double theAngle)
+                                             double thePassedY)
 : SketchAPI_SketchEntity(theFeature)
 {
   if(initialize()) {
-    setByCenterAndPassedPoints(theCenterX, theCenterY, thePassedX, thePassedY, theAngle);
+    setByCenterAndPassedPoints(theCenterX, theCenterY, thePassedX, thePassedY);
   }
 }
 
 //==================================================================================================
 SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                              const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
-                                             const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint,
-                                             double theAngle)
+                                             const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint)
 : SketchAPI_SketchEntity(theFeature)
 {
   if(initialize()) {
-    setByCenterAndPassedPoints(theCenterPoint, thePassedPoint, theAngle);
+    setByCenterAndPassedPoints(theCenterPoint, thePassedPoint);
   }
 }
 
@@ -66,12 +61,11 @@ SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feat
 SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                              double theX1, double theY1,
                                              double theX2, double theY2,
-                                             double theX3, double theY3,
-                                             double theAngle)
+                                             double theX3, double theY3)
 : SketchAPI_SketchEntity(theFeature)
 {
   if(initialize()) {
-    setByThreePoints(theX1, theY1, theX2, theY2, theX3, theY3, theAngle);
+    setByThreePoints(theX1, theY1, theX2, theY2, theX3, theY3);
   }
 }
 
@@ -79,12 +73,11 @@ SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feat
 SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                              const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
                                              const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
-                                             const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3,
-                                             double theAngle)
+                                             const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3)
 : SketchAPI_SketchEntity(theFeature)
 {
   if(initialize()) {
-    setByThreePoints(thePoint1, thePoint2, thePoint3, theAngle);
+    setByThreePoints(thePoint1, thePoint2, thePoint3);
   }
 }
 
@@ -97,95 +90,49 @@ SketchAPI_MacroCircle::~SketchAPI_MacroCircle()
 void SketchAPI_MacroCircle::setByCenterAndPassedPoints(double theCenterX,
                                                        double theCenterY,
                                                        double thePassedX,
-                                                       double thePassedY,
-                                                       double theAngle)
+                                                       double thePassedY)
 {
   fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS(), mycircleType);
   fillAttribute(centerPoint(), theCenterX, theCenterY);
   fillAttribute(passedPoint(), thePassedX, thePassedY);
 
-  bool isNeedPoint =
-    feature()->integer(SketchPlugin_MacroCircle::VERSION_ID())->value() > 0;
-
-  if (isNeedPoint)
-    fillAttribute(theAngle, angle());
-
   execute();
 }
 
 //==================================================================================================
 void SketchAPI_MacroCircle::setByCenterAndPassedPoints(
     const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
-    const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint,
-    double theAngle)
+    const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint)
 {
   fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS(), mycircleType);
   fillAttribute(theCenterPoint, mycenterPoint);
   fillAttribute(thePassedPoint, mypassedPoint);
 
-  bool isNeedPoint =
-    feature()->integer(SketchPlugin_MacroCircle::VERSION_ID())->value() > 0;
-
-  if (isNeedPoint)
-    fillAttribute(theAngle, angle());
-
   execute();
 }
 
 //==================================================================================================
 void SketchAPI_MacroCircle::setByThreePoints(double theX1, double theY1,
                                              double theX2, double theY2,
-                                             double theX3, double theY3,
-                                             double theAngle)
+                                             double theX3, double theY3)
 {
   fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
   fillAttribute(firstPoint(), theX1, theY1);
   fillAttribute(secondPoint(), theX2, theY2);
   fillAttribute(thirdPoint(), theX3, theY3);
 
-  bool isNeedPoint =
-    feature()->integer(SketchPlugin_MacroCircle::VERSION_ID())->value() > 0;
-
-  if (isNeedPoint)
-    fillAttribute(theAngle, angle());
-
   execute();
 }
 
 //==================================================================================================
 void SketchAPI_MacroCircle::setByThreePoints(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
                                              const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
-                                             const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3,
-                                             double theAngle)
+                                             const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3)
 {
   fillAttribute(SketchPlugin_MacroCircle::CIRCLE_TYPE_BY_THREE_POINTS(), mycircleType);
   fillAttribute(thePoint1, myfirstPoint);
   fillAttribute(thePoint2, mysecondPoint);
   fillAttribute(thePoint3, mythirdPoint);
 
-  bool isNeedPoint =
-    feature()->integer(SketchPlugin_MacroCircle::VERSION_ID())->value() > 0;
-
-  if (isNeedPoint)
-    fillAttribute(theAngle, angle());
-
   execute();
 }
-
-// return created point
-std::shared_ptr<SketchAPI_SketchEntity> SketchAPI_MacroCircle::createdPoint() const
-{
-  std::shared_ptr<SketchAPI_SketchEntity> anEnt;
-
-  AttributeRefAttrPtr anRef = feature()->refattr(SketchPlugin_MacroCircle::ROTATE_POINT_REF_ID());
-  if (!anRef->isInitialized())
-    return anEnt;
-
-  ObjectPtr aPointObj = anRef->object();
-  FeaturePtr aFeature = ModelAPI_Feature::feature(aPointObj);
-  if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID())
-  {
-    anEnt = std::shared_ptr < SketchAPI_SketchEntity>(new SketchAPI_Point(aFeature));
-  }
-  return anEnt;
-}