Salome HOME
Remove dependency on boost
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Double.cpp
1 // Name   : ModelHighAPI_Double.cpp
2 // Purpose: 
3 //
4 // History:
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
6
7 //--------------------------------------------------------------------------------------
8 #include "ModelHighAPI_Double.h"
9
10 #include <ModelAPI_AttributeDouble.h>
11 //--------------------------------------------------------------------------------------
12
13 //--------------------------------------------------------------------------------------
14 ModelHighAPI_Double::ModelHighAPI_Double(double theValue)
15 : myVariantType(VT_DOUBLE)
16 , myDouble(theValue)
17 {
18 }
19
20 ModelHighAPI_Double::ModelHighAPI_Double(const std::string & theValue)
21 : myVariantType(VT_STRING)
22 , myString(theValue)
23 {
24 }
25
26 ModelHighAPI_Double::ModelHighAPI_Double(const char * theValue)
27 : myVariantType(VT_STRING)
28 , myString(theValue)
29 {
30 }
31
32 ModelHighAPI_Double::~ModelHighAPI_Double()
33 {
34 }
35
36 //--------------------------------------------------------------------------------------
37 void ModelHighAPI_Double::fillAttribute(
38     const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const
39 {
40   switch(myVariantType) {
41     case VT_DOUBLE: theAttribute->setValue(myDouble); return;
42     case VT_STRING: theAttribute->setText(myString); return;
43   }
44 }