From: spo Date: Tue, 14 Jun 2016 10:10:32 +0000 (+0300) Subject: Add fillAttribute(double...) and fillAttribute(const char*,) and use it in SketchAPI_... X-Git-Tag: V_2.4.0~91^2~58 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fb1e3d841fa2eb6d7525c34575ba2ef848b20921;p=modules%2Fshaper.git Add fillAttribute(double...) and fillAttribute(const char*,) and use it in SketchAPI_Circle --- diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.cpp b/src/ModelHighAPI/ModelHighAPI_Tools.cpp index dc74b7ae1..9a6c10e97 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Tools.cpp @@ -73,6 +73,11 @@ void fillAttribute(const ModelHighAPI_Double & theValue, { theValue.fillAttribute(theAttribute); } +void fillAttribute(double theValue, + const std::shared_ptr & theAttribute) +{ + theAttribute->setValue(theValue); +} //-------------------------------------------------------------------------------------- void fillAttribute(const ModelHighAPI_Integer & theValue, @@ -110,4 +115,10 @@ void fillAttribute(const std::string & theValue, { theAttribute->setValue(theValue); } +void fillAttribute(const char * theValue, + const std::shared_ptr & theAttribute) +{ + theAttribute->setValue(theValue); +} + //-------------------------------------------------------------------------------------- diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.h b/src/ModelHighAPI/ModelHighAPI_Tools.h index 17d7f0523..a0e44c693 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.h +++ b/src/ModelHighAPI/ModelHighAPI_Tools.h @@ -65,6 +65,10 @@ MODELHIGHAPI_EXPORT void fillAttribute(const ModelHighAPI_Double & theValue, const std::shared_ptr & theAttribute); +MODELHIGHAPI_EXPORT +void fillAttribute(double theValue, + const std::shared_ptr & theAttribute); + MODELHIGHAPI_EXPORT void fillAttribute(const ModelHighAPI_Integer & theValue, const std::shared_ptr & theAttribute); @@ -84,6 +88,9 @@ void fillAttribute(const std::list & theValue, MODELHIGHAPI_EXPORT void fillAttribute(const std::string & theValue, const std::shared_ptr & theAttribute); +MODELHIGHAPI_EXPORT +void fillAttribute(const char * theValue, + const std::shared_ptr & theAttribute); //-------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------- diff --git a/src/SketchAPI/SketchAPI_Circle.cpp b/src/SketchAPI/SketchAPI_Circle.cpp index e05e76708..d8a07f13b 100644 --- a/src/SketchAPI/SketchAPI_Circle.cpp +++ b/src/SketchAPI/SketchAPI_Circle.cpp @@ -97,7 +97,7 @@ void SketchAPI_Circle::setByCenterAndRadius(double theCenterX, double theCenterY { fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType); fillAttribute(center(), theCenterX, theCenterY); - fillAttribute(ModelHighAPI_Double(theRadius), myradius); + fillAttribute(theRadius, myradius); execute(); } @@ -108,7 +108,7 @@ void SketchAPI_Circle::setByCenterAndRadius(const std::shared_ptr { fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType); fillAttribute(theCenter, mycenter); - fillAttribute(ModelHighAPI_Double(theRadius), myradius); + fillAttribute(theRadius, myradius); execute(); } diff --git a/src/SketchAPI/SketchAPI_Circle.h b/src/SketchAPI/SketchAPI_Circle.h index 70af08f01..b4332c675 100644 --- a/src/SketchAPI/SketchAPI_Circle.h +++ b/src/SketchAPI/SketchAPI_Circle.h @@ -10,8 +10,6 @@ #include "SketchAPI.h" #include "SketchAPI_SketchEntity.h" -#include - #include class ModelHighAPI_Selection;