Salome HOME
Add fillAttribute(double...) and fillAttribute(const char*,) and use it in SketchAPI_...
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 14 Jun 2016 10:10:32 +0000 (13:10 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 11:41:07 +0000 (14:41 +0300)
src/ModelHighAPI/ModelHighAPI_Tools.cpp
src/ModelHighAPI/ModelHighAPI_Tools.h
src/SketchAPI/SketchAPI_Circle.cpp
src/SketchAPI/SketchAPI_Circle.h

index dc74b7ae1ce99274e6b241cca5375182e19de878..9a6c10e97238d8b2c375441282f1416ea06f996e 100644 (file)
@@ -73,6 +73,11 @@ void fillAttribute(const ModelHighAPI_Double & theValue,
 {
   theValue.fillAttribute(theAttribute);
 }
+void fillAttribute(double theValue,
+                   const std::shared_ptr<ModelAPI_AttributeDouble> & 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<ModelAPI_AttributeString> & theAttribute)
+{
+  theAttribute->setValue(theValue);
+}
+
 //--------------------------------------------------------------------------------------
index 17d7f0523221a7faf5e7d2a7a756bd436d7b9801..a0e44c6937fea1aa599d95897d3a0ce66bb50d96 100644 (file)
@@ -65,6 +65,10 @@ MODELHIGHAPI_EXPORT
 void fillAttribute(const ModelHighAPI_Double & theValue,
                    const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
 
+MODELHIGHAPI_EXPORT
+void fillAttribute(double theValue,
+                   const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
+
 MODELHIGHAPI_EXPORT
 void fillAttribute(const ModelHighAPI_Integer & theValue,
                    const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute);
@@ -84,6 +88,9 @@ void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
 MODELHIGHAPI_EXPORT
 void fillAttribute(const std::string & theValue,
                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
+MODELHIGHAPI_EXPORT
+void fillAttribute(const char * theValue,
+                   const std::shared_ptr<ModelAPI_AttributeString> & theAttribute);
 
 //--------------------------------------------------------------------------------------
 //--------------------------------------------------------------------------------------
index e05e767082e6a8dd360acb1438e296e651964f17..d8a07f13b787bcf4e9948b1b901221b2e00558ab 100644 (file)
@@ -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<GeomAPI_Pnt2d>
 {
   fillAttribute(SketchPlugin_Circle::CIRCLE_TYPE_CENTER_AND_RADIUS(), mycircleType);
   fillAttribute(theCenter, mycenter);
-  fillAttribute(ModelHighAPI_Double(theRadius), myradius);
+  fillAttribute(theRadius, myradius);
 
   execute();
 }
index 70af08f010e1aa714cbe295176ccd9804856ebe3..b4332c67553898e49db83fed180a4f378381739e 100644 (file)
@@ -10,8 +10,6 @@
 #include "SketchAPI.h"
 #include "SketchAPI_SketchEntity.h"
 
-#include <GeomDataAPI_Point2D.h>
-
 #include <SketchPlugin_Circle.h>
 
 class ModelHighAPI_Selection;