1 // Name : ModelHighAPI_Double.cpp
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "ModelHighAPI_Double.h"
10 #include <ModelAPI_AttributeDouble.h>
11 //--------------------------------------------------------------------------------------
13 //--------------------------------------------------------------------------------------
14 ModelHighAPI_Double::ModelHighAPI_Double()
18 ModelHighAPI_Double::ModelHighAPI_Double(double theValue)
23 ModelHighAPI_Double::ModelHighAPI_Double(const std::string & theValue)
28 ModelHighAPI_Double::ModelHighAPI_Double(const char * theValue)
33 ModelHighAPI_Double::~ModelHighAPI_Double()
37 //--------------------------------------------------------------------------------------
38 struct fill_visitor : boost::static_visitor<void>
40 mutable std::shared_ptr<ModelAPI_AttributeDouble> myAttribute;
42 fill_visitor(std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute)
43 : myAttribute(theAttribute) {}
45 void operator()(double theValue) const { myAttribute->setValue(theValue); }
46 void operator()(const std::string & theValue) const { myAttribute->setText(theValue); }
49 void ModelHighAPI_Double::fillAttribute(
50 std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const
52 boost::apply_visitor(fill_visitor(theAttribute), myValue);