X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchAPI%2FSketchAPI_MacroCircle.cpp;fp=src%2FSketchAPI%2FSketchAPI_MacroCircle.cpp;h=f5e459a407c5343d524dd51f019453d3a9e78980;hb=86f4ec4eb5ff5f119914f3d44cf945b49845d8c2;hp=64089321421253a697f567044c716a66cd0c904c;hpb=f64e1300ed35bb1e9a2486cdb5713355e832dd39;p=modules%2Fshaper.git diff --git a/src/SketchAPI/SketchAPI_MacroCircle.cpp b/src/SketchAPI/SketchAPI_MacroCircle.cpp index 640893214..f5e459a40 100644 --- a/src/SketchAPI/SketchAPI_MacroCircle.cpp +++ b/src/SketchAPI/SketchAPI_MacroCircle.cpp @@ -26,9 +26,6 @@ #include #include -#include -#include - //================================================================================================== SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr& theFeature) : SketchAPI_SketchEntity(theFeature) @@ -41,24 +38,22 @@ SketchAPI_MacroCircle::SketchAPI_MacroCircle(const std::shared_ptr& theFeature, const std::shared_ptr& theCenterPoint, - const std::shared_ptr& thePassedPoint, - double theAngle) + const std::shared_ptr& 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& 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& theFeature, const std::shared_ptr& thePoint1, const std::shared_ptr& thePoint2, - const std::shared_ptr& thePoint3, - double theAngle) + const std::shared_ptr& 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& theCenterPoint, - const std::shared_ptr& thePassedPoint, - double theAngle) + const std::shared_ptr& 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& thePoint1, const std::shared_ptr& thePoint2, - const std::shared_ptr& thePoint3, - double theAngle) + const std::shared_ptr& 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_MacroCircle::createdPoint() const -{ - std::shared_ptr 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; -}