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