From: azv Date: Mon, 27 Mar 2017 09:10:13 +0000 (+0300) Subject: Revert change for MacroArc attribute names X-Git-Tag: V_2.7.0~180 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=099946a7d91982c9a2c4ca2ccdd934320f196413;p=modules%2Fshaper.git Revert change for MacroArc attribute names --- diff --git a/src/SketchAPI/SketchAPI_MacroArc.cpp b/src/SketchAPI/SketchAPI_MacroArc.cpp index a82f44a70..2fa73d5a3 100644 --- a/src/SketchAPI/SketchAPI_MacroArc.cpp +++ b/src/SketchAPI/SketchAPI_MacroArc.cpp @@ -28,10 +28,10 @@ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr & //================================================================================================ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& theFeature, - double theCenterX, double theCenterY, - double theStartX, double theStartY, - double theEndX, double theEndY, - bool theInversed) + double theCenterX, double theCenterY, + double theStartX, double theStartY, + double theEndX, double theEndY, + bool theInversed) : SketchAPI_SketchEntity(theFeature) { if(initialize()) { @@ -42,10 +42,10 @@ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& //================================================================================================ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& theFeature, - const std::shared_ptr& theCenter, - const std::shared_ptr& theStart, - const std::shared_ptr& theEnd, - bool theInversed) + const std::shared_ptr& theCenter, + const std::shared_ptr& theStart, + const std::shared_ptr& theEnd, + bool theInversed) : SketchAPI_SketchEntity(theFeature) { if(initialize()) { @@ -55,9 +55,9 @@ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& //================================================================================================ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& theFeature, - double theStartX, double theStartY, - double theEndX, double theEndY, - double thePassedX, double thePassedY) + double theStartX, double theStartY, + double theEndX, double theEndY, + double thePassedX, double thePassedY) : SketchAPI_SketchEntity(theFeature) { if (initialize()) { @@ -67,9 +67,9 @@ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& //=============================================================================================== SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& theFeature, - const std::shared_ptr& theStart, - const std::shared_ptr& theEnd, - const std::shared_ptr& thePassed) + const std::shared_ptr& theStart, + const std::shared_ptr& theEnd, + const std::shared_ptr& thePassed) : SketchAPI_SketchEntity(theFeature) { if (initialize()) { @@ -79,9 +79,9 @@ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& //================================================================================================ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& theFeature, - const ModelHighAPI_RefAttr& theTangentPoint, - double theEndX, double theEndY, - bool theInversed) + const ModelHighAPI_RefAttr& theTangentPoint, + double theEndX, double theEndY, + bool theInversed) : SketchAPI_SketchEntity(theFeature) { if (initialize()) { @@ -91,9 +91,9 @@ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& //================================================================================================ SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr& theFeature, - const ModelHighAPI_RefAttr& theTangentPoint, - const std::shared_ptr& theEnd, - bool theInversed) + const ModelHighAPI_RefAttr& theTangentPoint, + const std::shared_ptr& theEnd, + bool theInversed) : SketchAPI_SketchEntity(theFeature) { if (initialize()) { @@ -109,14 +109,14 @@ SketchAPI_MacroArc::~SketchAPI_MacroArc() //================================================================================================ void SketchAPI_MacroArc::setByCenterStartEnd(double theCenterX, double theCenterY, - double theStartX, double theStartY, - double theEndX, double theEndY, - bool theInversed) + double theStartX, double theStartY, + double theEndX, double theEndY, + bool theInversed) { fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_CENTER_AND_POINTS(), myarcType); fillAttribute(center(), theCenterX, theCenterY); - fillAttribute(startPoint(), theStartX, theStartY); - fillAttribute(endPoint(), theEndX, theEndY); + fillAttribute(startPoint1(), theStartX, theStartY); + fillAttribute(endPoint1(), theEndX, theEndY); fillAttribute(theInversed, myreversed); execute(); @@ -124,14 +124,14 @@ void SketchAPI_MacroArc::setByCenterStartEnd(double theCenterX, double theCenter //================================================================================================ void SketchAPI_MacroArc::setByCenterStartEnd(const std::shared_ptr& theCenter, - const std::shared_ptr& theStart, - const std::shared_ptr& theEnd, - bool theInversed) + const std::shared_ptr& theStart, + const std::shared_ptr& theEnd, + bool theInversed) { fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_CENTER_AND_POINTS(), myarcType); fillAttribute(theCenter, mycenter); - fillAttribute(theStart, mystartPoint); - fillAttribute(theEnd, myendPoint); + fillAttribute(theStart, mystartPoint1); + fillAttribute(theEnd, myendPoint1); fillAttribute(theInversed, myreversed); execute(); @@ -139,12 +139,12 @@ void SketchAPI_MacroArc::setByCenterStartEnd(const std::shared_ptr& theStart, - const std::shared_ptr& theEnd, - const std::shared_ptr& thePassed) + const std::shared_ptr& theEnd, + const std::shared_ptr& thePassed) { fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_THREE_POINTS(), myarcType); - fillAttribute(theStart, mystartPoint); - fillAttribute(theEnd, myendPoint); + fillAttribute(theStart, mystartPoint2); + fillAttribute(theEnd, myendPoint2); fillAttribute(thePassed, mypassedPoint); execute(); @@ -165,12 +165,12 @@ void SketchAPI_MacroArc::setByStartEndPassed(const std::shared_ptr& theEnd, - bool theInversed) + const std::shared_ptr& theEnd, + bool theInversed) { fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_TANGENT_EDGE(), myarcType); fillAttribute(theTangentPoint, mytangentPoint); - fillAttribute(theEnd, myendPoint); + fillAttribute(theEnd, myendPoint3); fillAttribute(theInversed, myreversed); execute(); diff --git a/src/SketchAPI/SketchAPI_MacroArc.h b/src/SketchAPI/SketchAPI_MacroArc.h index 9350e5427..c24e24750 100644 --- a/src/SketchAPI/SketchAPI_MacroArc.h +++ b/src/SketchAPI/SketchAPI_MacroArc.h @@ -79,25 +79,31 @@ public: SketchPlugin_MacroArc::ID(); } - INTERFACE_9(SketchPlugin_MacroArc::ID(), - arcType, SketchPlugin_MacroArc::ARC_TYPE(), - ModelAPI_AttributeString, /** Arc type */, - center, SketchPlugin_MacroArc::CENTER_POINT_ID(), - GeomDataAPI_Point2D, /** Center point */, - startPoint, SketchPlugin_MacroArc::START_POINT_ID(), - GeomDataAPI_Point2D, /** Start point */, - endPoint, SketchPlugin_MacroArc::END_POINT_ID(), - GeomDataAPI_Point2D, /** End point */, - passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(), - GeomDataAPI_Point2D, /** Passed point */, - tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(), - ModelAPI_AttributeRefAttr, /** Tangent point */, - reversed, SketchPlugin_MacroArc::REVERSED_ID(), - ModelAPI_AttributeBoolean, /** Reversed flag */, - radius, SketchPlugin_MacroArc::RADIUS_ID(), - ModelAPI_AttributeDouble, /** Radius */, - angle, SketchPlugin_MacroArc::ANGLE_ID(), - ModelAPI_AttributeDouble, /** Angle */) + INTERFACE_12(SketchPlugin_MacroArc::ID(), + arcType, SketchPlugin_MacroArc::ARC_TYPE(), + ModelAPI_AttributeString, /** Arc type */, + center, SketchPlugin_MacroArc::CENTER_POINT_ID(), + GeomDataAPI_Point2D, /** Center point */, + startPoint1, SketchPlugin_MacroArc::START_POINT_1_ID(), + GeomDataAPI_Point2D, /** Start point */, + endPoint1, SketchPlugin_MacroArc::END_POINT_1_ID(), + GeomDataAPI_Point2D, /** End point */, + startPoint2, SketchPlugin_MacroArc::START_POINT_2_ID(), + GeomDataAPI_Point2D, /** Start point */, + endPoint2, SketchPlugin_MacroArc::END_POINT_2_ID(), + GeomDataAPI_Point2D, /** End point */, + passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(), + GeomDataAPI_Point2D, /** Passed point */, + tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(), + ModelAPI_AttributeRefAttr, /** Tangent point */, + endPoint3, SketchPlugin_MacroArc::END_POINT_3_ID(), + GeomDataAPI_Point2D, /** End point */, + reversed, SketchPlugin_MacroArc::REVERSED_ID(), + ModelAPI_AttributeBoolean, /** Reversed flag */, + radius, SketchPlugin_MacroArc::RADIUS_ID(), + ModelAPI_AttributeDouble, /** Radius */, + angle, SketchPlugin_MacroArc::ANGLE_ID(), + ModelAPI_AttributeDouble, /** Angle */) private: diff --git a/src/SketchPlugin/SketchPlugin_MacroArc.cpp b/src/SketchPlugin/SketchPlugin_MacroArc.cpp index e53b85efe..2ebb18dd4 100644 --- a/src/SketchPlugin/SketchPlugin_MacroArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroArc.cpp @@ -60,12 +60,15 @@ void SketchPlugin_MacroArc::initAttributes() data()->addAttribute(ARC_TYPE(), ModelAPI_AttributeString::typeId()); data()->addAttribute(CENTER_POINT_ID(), GeomDataAPI_Point2D::typeId()); - data()->addAttribute(START_POINT_ID(), GeomDataAPI_Point2D::typeId()); - data()->addAttribute(END_POINT_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(START_POINT_1_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(END_POINT_1_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(START_POINT_2_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(END_POINT_2_ID(), GeomDataAPI_Point2D::typeId()); data()->addAttribute(PASSED_POINT_ID(), GeomDataAPI_Point2D::typeId()); data()->addAttribute(TANGENT_POINT_ID(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(END_POINT_3_ID(), GeomDataAPI_Point2D::typeId()); data()->addAttribute(REVERSED_ID(), ModelAPI_AttributeBoolean::typeId()); @@ -95,13 +98,16 @@ void SketchPlugin_MacroArc::attributeChanged(const std::string& theID) if(theID == ARC_TYPE()) { SketchPlugin_Tools::resetAttribute(this, CENTER_POINT_ID()); SketchPlugin_Tools::resetAttribute(this, CENTER_POINT_REF_ID()); - SketchPlugin_Tools::resetAttribute(this, START_POINT_ID()); + SketchPlugin_Tools::resetAttribute(this, START_POINT_1_ID()); SketchPlugin_Tools::resetAttribute(this, START_POINT_REF_ID()); - SketchPlugin_Tools::resetAttribute(this, END_POINT_ID()); + SketchPlugin_Tools::resetAttribute(this, END_POINT_1_ID()); SketchPlugin_Tools::resetAttribute(this, END_POINT_REF_ID()); + SketchPlugin_Tools::resetAttribute(this, START_POINT_2_ID()); + SketchPlugin_Tools::resetAttribute(this, END_POINT_2_ID()); SketchPlugin_Tools::resetAttribute(this, PASSED_POINT_ID()); SketchPlugin_Tools::resetAttribute(this, PASSED_POINT_REF_ID()); SketchPlugin_Tools::resetAttribute(this, TANGENT_POINT_ID()); + SketchPlugin_Tools::resetAttribute(this, END_POINT_3_ID()); SketchPlugin_Tools::resetAttribute(this, REVERSED_ID()); SketchPlugin_Tools::resetAttribute(this, RADIUS_ID()); SketchPlugin_Tools::resetAttribute(this, ANGLE_ID()); @@ -274,7 +280,7 @@ void SketchPlugin_MacroArc::fillByCenterAndTwoPassed() return; AttributePoint2DPtr aStartPointAttr = - std::dynamic_pointer_cast(attribute(START_POINT_ID())); + std::dynamic_pointer_cast(attribute(START_POINT_1_ID())); if (!aStartPointAttr->isInitialized()) return; @@ -283,7 +289,7 @@ void SketchPlugin_MacroArc::fillByCenterAndTwoPassed() myEnd = myStart; AttributePoint2DPtr anEndPointAttr = - std::dynamic_pointer_cast(attribute(END_POINT_ID())); + std::dynamic_pointer_cast(attribute(END_POINT_1_ID())); if (!anEndPointAttr->isInitialized()) return; @@ -315,12 +321,12 @@ void SketchPlugin_MacroArc::recalculateReversedFlagByEnd(const GeomAPI_Circ2d& t void SketchPlugin_MacroArc::fillByThreePassedPoints() { AttributePoint2DPtr aStartPointAttr = - std::dynamic_pointer_cast(attribute(START_POINT_ID())); + std::dynamic_pointer_cast(attribute(START_POINT_2_ID())); if (!aStartPointAttr->isInitialized()) return; AttributePoint2DPtr anEndPointAttr = - std::dynamic_pointer_cast(attribute(END_POINT_ID())); + std::dynamic_pointer_cast(attribute(END_POINT_2_ID())); if (!anEndPointAttr->isInitialized()) return; @@ -381,7 +387,7 @@ void SketchPlugin_MacroArc::fillByTangentEdge() return; AttributePoint2DPtr anEndPointAttr = - std::dynamic_pointer_cast(attribute(END_POINT_ID())); + std::dynamic_pointer_cast(attribute(END_POINT_3_ID())); if (!anEndPointAttr->isInitialized()) return; diff --git a/src/SketchPlugin/SketchPlugin_MacroArc.h b/src/SketchPlugin/SketchPlugin_MacroArc.h index 0a191342c..9fb6bdb3f 100644 --- a/src/SketchPlugin/SketchPlugin_MacroArc.h +++ b/src/SketchPlugin/SketchPlugin_MacroArc.h @@ -71,9 +71,16 @@ class SketchPlugin_MacroArc: public SketchPlugin_SketchEntity, } /// Start 2D point of the arc - inline static const std::string& START_POINT_ID() + inline static const std::string& START_POINT_1_ID() { - static const std::string ID = "start_point"; + static const std::string ID = "start_point_1"; + return ID; + } + + /// Start 2D point of the arc + inline static const std::string& START_POINT_2_ID() + { + static const std::string ID = "start_point_2"; return ID; } @@ -84,9 +91,23 @@ class SketchPlugin_MacroArc: public SketchPlugin_SketchEntity, } /// End 2D point of the arc - inline static const std::string& END_POINT_ID() + inline static const std::string& END_POINT_1_ID() + { + static const std::string ID = "end_point_1"; + return ID; + } + + /// End 2D point of the arc + inline static const std::string& END_POINT_2_ID() + { + static const std::string ID = "end_point_2"; + return ID; + } + + /// End 2D point of the arc + inline static const std::string& END_POINT_3_ID() { - static const std::string ID = "end_point"; + static const std::string ID = "end_point_3"; return ID; } diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index bffe18309..00298e297 100755 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -1173,10 +1173,10 @@ static void threePointsOfFeature(const FeaturePtr& theMacroFeature, SketchPlugin_MacroCircle::THIRD_POINT_REF_ID()); } else if (theMacroFeature->getKind() == SketchPlugin_MacroArc::ID()) { thePoints[0] = toPoint(theMacroFeature, - SketchPlugin_MacroArc::START_POINT_ID(), + SketchPlugin_MacroArc::START_POINT_2_ID(), SketchPlugin_MacroArc::START_POINT_REF_ID()); thePoints[1] = toPoint(theMacroFeature, - SketchPlugin_MacroArc::END_POINT_ID(), + SketchPlugin_MacroArc::END_POINT_2_ID(), SketchPlugin_MacroArc::END_POINT_REF_ID()); thePoints[2] = toPoint(theMacroFeature, SketchPlugin_MacroArc::PASSED_POINT_ID(), diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index 416f478d3..f4d726156 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -205,30 +205,30 @@ tooltip="Center of a circle" accept_expressions="0" enable_value="enable_by_preferences" /> - - - + - - - + -