X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchAPI%2FSketchAPI_Circle.cpp;h=ddb26aef5fae0fd0f42914abcff005accd82336e;hb=bd953380ed26bbef84337e8b2148d930969b5abe;hp=9cac0bd31cbf58bee789d7d87dd9fe9d78f92ba7;hpb=f127a007a7ab9b148ddf98b6848b1dfb8ef733db;p=modules%2Fshaper.git diff --git a/src/SketchAPI/SketchAPI_Circle.cpp b/src/SketchAPI/SketchAPI_Circle.cpp index 9cac0bd31..ddb26aef5 100644 --- a/src/SketchAPI/SketchAPI_Circle.cpp +++ b/src/SketchAPI/SketchAPI_Circle.cpp @@ -43,30 +43,6 @@ SketchAPI_Circle::SketchAPI_Circle(const std::shared_ptr& theF } } -//================================================================================================== -SketchAPI_Circle::SketchAPI_Circle(const std::shared_ptr& theFeature, - double theX1, double theY1, - double theX2, double theY2, - double theX3, double theY3) -: SketchAPI_SketchEntity(theFeature) -{ - if (initialize()) { - setByThreePoints(theX1, theY1, theX2, theY2, theX3, theY3); - } -} - -//================================================================================================== -SketchAPI_Circle::SketchAPI_Circle(const std::shared_ptr& theFeature, - const std::shared_ptr& thePoint1, - const std::shared_ptr& thePoint2, - const std::shared_ptr& thePoint3) -: SketchAPI_SketchEntity(theFeature) -{ - if (initialize()) { - setByThreePoints(thePoint1, thePoint2, thePoint3); - } -} - //================================================================================================== SketchAPI_Circle::SketchAPI_Circle(const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theExternal) @@ -96,7 +72,6 @@ SketchAPI_Circle::~SketchAPI_Circle() //================================================================================================== void SketchAPI_Circle::setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius) { - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType); fillAttribute(center(), theCenterX, theCenterY); fillAttribute(theRadius, myradius); @@ -107,39 +82,12 @@ void SketchAPI_Circle::setByCenterAndRadius(double theCenterX, double theCenterY void SketchAPI_Circle::setByCenterAndRadius(const std::shared_ptr& theCenter, double theRadius) { - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType); fillAttribute(theCenter, mycenter); fillAttribute(theRadius, myradius); execute(); } -//================================================================================================== -void SketchAPI_Circle::setByThreePoints(double theX1, double theY1, - double theX2, double theY2, - double theX3, double theY3) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(firstPoint(), theX1, theY1); - fillAttribute(secondPoint(), theX2, theY2); - fillAttribute(thirdPoint(), theX3, theY3); - - execute(); -} - -//================================================================================================== -void SketchAPI_Circle::setByThreePoints(const std::shared_ptr& thePoint1, - const std::shared_ptr& thePoint2, - const std::shared_ptr& thePoint3) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(thePoint1, myfirstPoint); - fillAttribute(thePoint2, mysecondPoint); - fillAttribute(thePoint3, mythirdPoint); - - execute(); -} - //================================================================================================== void SketchAPI_Circle::setByExternal(const ModelHighAPI_Selection & theExternal) { @@ -159,7 +107,6 @@ void SketchAPI_Circle::setByExternalName(const std::string & theExternalName) //================================================================================================== void SketchAPI_Circle::setCenter(double theX, double theY) { - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType); fillAttribute(center(), theX, theY); execute(); @@ -168,7 +115,6 @@ void SketchAPI_Circle::setCenter(double theX, double theY) //================================================================================================== void SketchAPI_Circle::setCenter(const std::shared_ptr & theCenter) { - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType); fillAttribute(theCenter, mycenter); execute(); @@ -177,66 +123,11 @@ void SketchAPI_Circle::setCenter(const std::shared_ptr & theCente //================================================================================================== void SketchAPI_Circle::setRadius(double theRadius) { - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType); fillAttribute(ModelHighAPI_Double(theRadius), myradius); execute(); } -//================================================================================================== -void SketchAPI_Circle::setFirstPoint(double theX, double theY) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(firstPoint(), theX, theY); - - execute(); -} - -//================================================================================================== -void SketchAPI_Circle::setFirstPoint(const std::shared_ptr& thePoint) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(thePoint, myfirstPoint); - - execute(); -} - -//================================================================================================== -void SketchAPI_Circle::setSecondPoint(double theX, double theY) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(secondPoint(), theX, theY); - - execute(); -} - -//================================================================================================== -void SketchAPI_Circle::setSecondPoint(const std::shared_ptr& thePoint) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(thePoint, mysecondPoint); - - execute(); -} - -//================================================================================================== -void SketchAPI_Circle::setThirdPoint(double theX, double theY) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(thirdPoint(), theX, theY); - - execute(); -} - -//================================================================================================== -void SketchAPI_Circle::setThirdPoint(const std::shared_ptr& thePoint) -{ - fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_THREE_POINTS(), mycircleType); - fillAttribute(thePoint, mythirdPoint); - - execute(); -} - //================================================================================================== void SketchAPI_Circle::dump(ModelHighAPI_Dumper& theDumper) const { @@ -251,16 +142,9 @@ void SketchAPI_Circle::dump(ModelHighAPI_Dumper& theDumper) const // circle is external theDumper << aBase << " = " << aSketchName << ".addCircle(" << anExternal << ")" << std::endl; } else { - AttributeStringPtr aType = circleType(); - if (aType->value() == SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS()) { - // circle given by center and radius - theDumper << aBase << " = " << aSketchName << ".addCircle(" - << center() << ", " << radius() << ")" << std::endl; - } else { - // circle given by three points - theDumper << aBase << " = " << aSketchName << ".addCircle(" << firstPoint() << ", " - << secondPoint() << ", " << thirdPoint() << ")" << std::endl; - } + // circle given by center and radius + theDumper << aBase << " = " << aSketchName << ".addCircle(" + << center() << ", " << radius() << ")" << std::endl; } // dump "auxiliary" flag if necessary SketchAPI_SketchEntity::dump(theDumper);