From: nds Date: Wed, 4 Oct 2017 04:14:36 +0000 (+0300) Subject: #2205 Ability to customize the arrows and texts of dimensions: Default value is set... X-Git-Tag: V_2.9.0~23^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FDev_2.8.0;p=modules%2Fshaper.git #2205 Ability to customize the arrows and texts of dimensions: Default value is set into Location type attribute. --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp index e1d15b68c..0bc856f0a 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp @@ -20,11 +20,10 @@ #include "SketchPlugin_ConstraintAngle.h" #include +#include #include #include -#include -#include #include @@ -70,7 +69,7 @@ void SketchPlugin_ConstraintAngle::initAttributes() data()->addAttribute(SketchPlugin_ConstraintAngle::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); + data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); } 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 e75dcde94..1ee864766 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -35,8 +35,6 @@ #include #include #include -#include -#include #include @@ -61,7 +59,7 @@ void SketchPlugin_ConstraintDistance::initAttributes() data()->addAttribute(SketchPlugin_ConstraintDistance::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); + data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); } 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 355292413..d2e0ef793 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp @@ -33,8 +33,6 @@ #include #include -#include -#include const double tolerance = 1e-7; @@ -54,7 +52,7 @@ void SketchPlugin_ConstraintDistanceHorizontal::initAttributes() data()->addAttribute(SketchPlugin_ConstraintDistanceHorizontal::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); + data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); } //************************************************************************************* diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp index 8823c3aa0..6cebbd4f5 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp @@ -33,8 +33,6 @@ #include #include -#include -#include const double tolerance = 1e-7; @@ -54,7 +52,7 @@ void SketchPlugin_ConstraintDistanceVertical::initAttributes() data()->addAttribute(SketchPlugin_ConstraintDistanceVertical::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); + data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); } //************************************************************************************* diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index 70f004441..35986de79 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -24,13 +24,12 @@ #include #include +#include #include #include #include #include -#include -#include #include @@ -58,7 +57,7 @@ void SketchPlugin_ConstraintLength::initAttributes() data()->addAttribute(SketchPlugin_ConstraintLength::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); + data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); } 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 0b34c183c..b38de08ee 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp @@ -25,12 +25,11 @@ #include #include +#include #include #include #include -#include -#include #include #include @@ -58,7 +57,7 @@ void SketchPlugin_ConstraintRadius::initAttributes() data()->addAttribute(SketchPlugin_ConstraintRadius::LOCATION_TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID()); + data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC); } void SketchPlugin_ConstraintRadius::colorConfigInfo(std::string& theSection, std::string& theName,