]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_Double.cpp
Salome HOME
Make in bearing_puller big model correct system of constraints: no over-constraint...
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Double.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name   : ModelHighAPI_Double.cpp
3 // Purpose:
4 //
5 // History:
6 // 29/03/16 - Sergey POKHODENKO - Creation of the file
7
8 //--------------------------------------------------------------------------------------
9 #include "ModelHighAPI_Double.h"
10
11 #include <ModelAPI_AttributeDouble.h>
12 //--------------------------------------------------------------------------------------
13
14 //--------------------------------------------------------------------------------------
15 ModelHighAPI_Double::ModelHighAPI_Double(double theValue)
16 : myVariantType(VT_DOUBLE)
17 , myDouble(theValue)
18 {
19 }
20
21 ModelHighAPI_Double::ModelHighAPI_Double(const std::string & theValue)
22 : myVariantType(VT_STRING)
23 , myString(theValue)
24 {
25 }
26
27 ModelHighAPI_Double::ModelHighAPI_Double(const char * theValue)
28 : myVariantType(VT_STRING)
29 , myString(theValue)
30 {
31 }
32
33 ModelHighAPI_Double::~ModelHighAPI_Double()
34 {
35 }
36
37 //--------------------------------------------------------------------------------------
38 void ModelHighAPI_Double::fillAttribute(
39     const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const
40 {
41   switch(myVariantType) {
42     case VT_DOUBLE: theAttribute->setValue(myDouble); return;
43     case VT_STRING: theAttribute->setText(myString); return;
44   }
45 }