From: nds Date: Wed, 4 Oct 2017 08:09:43 +0000 (+0300) Subject: #2205 Ability to customize the arrows and texts of dimensions: location type is not... X-Git-Tag: V_2.9.0~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ded5bcb481e90e9df0738c0850d8398586160fc0;p=modules%2Fshaper.git #2205 Ability to customize the arrows and texts of dimensions: location type is not obligatory parameter --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp index 0bc856f0a..89c61105c 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp @@ -24,6 +24,8 @@ #include #include +#include +#include #include @@ -69,7 +71,7 @@ void SketchPlugin_ConstraintAngle::initAttributes() data()->addAttribute(SketchPlugin_ConstraintAngle::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); } void SketchPlugin_ConstraintAngle::colorConfigInfo(std::string& theSection, std::string& theName, diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 1ee864766..e75dcde94 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include @@ -59,7 +61,7 @@ void SketchPlugin_ConstraintDistance::initAttributes() data()->addAttribute(SketchPlugin_ConstraintDistance::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); } void SketchPlugin_ConstraintDistance::colorConfigInfo(std::string& theSection, std::string& theName, diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp index d2e0ef793..355292413 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp @@ -33,6 +33,8 @@ #include #include +#include +#include const double tolerance = 1e-7; @@ -52,7 +54,7 @@ void SketchPlugin_ConstraintDistanceHorizontal::initAttributes() data()->addAttribute(SketchPlugin_ConstraintDistanceHorizontal::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); } //************************************************************************************* diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp index 6cebbd4f5..8823c3aa0 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp @@ -33,6 +33,8 @@ #include #include +#include +#include const double tolerance = 1e-7; @@ -52,7 +54,7 @@ void SketchPlugin_ConstraintDistanceVertical::initAttributes() data()->addAttribute(SketchPlugin_ConstraintDistanceVertical::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); } //************************************************************************************* diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index 35986de79..b1cc7010d 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include @@ -57,7 +59,7 @@ void SketchPlugin_ConstraintLength::initAttributes() data()->addAttribute(SketchPlugin_ConstraintLength::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); } void SketchPlugin_ConstraintLength::colorConfigInfo(std::string& theSection, std::string& theName, diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp index b38de08ee..08b8b9be7 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include @@ -57,7 +59,7 @@ void SketchPlugin_ConstraintRadius::initAttributes() data()->addAttribute(SketchPlugin_ConstraintRadius::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); } void SketchPlugin_ConstraintRadius::colorConfigInfo(std::string& theSection, std::string& theName,