]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_Tools.cpp
Salome HOME
Use fillAttribute in *API interfaces
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Tools.cpp
1 // Name   : ModelHighAPI_Tools.cpp
2 // Purpose: 
3 //
4 // History:
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
6
7 //--------------------------------------------------------------------------------------
8 #include "ModelHighAPI_Tools.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelAPI_AttributeBoolean.h>
11 #include <ModelAPI_AttributeDocRef.h>
12 #include <ModelAPI_AttributeDouble.h>
13 #include <ModelAPI_AttributeIntArray.h>
14 #include <ModelAPI_AttributeInteger.h>
15 #include <ModelAPI_AttributeRefAttr.h>
16 #include <ModelAPI_AttributeRefAttrList.h>
17 #include <ModelAPI_AttributeReference.h>
18 #include <ModelAPI_AttributeRefList.h>
19 #include <ModelAPI_AttributeSelection.h>
20 #include <ModelAPI_AttributeSelectionList.h>
21 #include <ModelAPI_AttributeString.h>
22 //--------------------------------------------------------------------------------------
23 #include "ModelHighAPI_Double.h"
24 #include "ModelHighAPI_Selection.h"
25 //--------------------------------------------------------------------------------------
26 void fillAttribute(const ModelHighAPI_Double & theValue,
27                    const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute)
28 {
29   theValue.fillAttribute(theAttribute);
30 }
31
32 //--------------------------------------------------------------------------------------
33 void fillAttribute(const ModelHighAPI_Selection & theValue,
34                    const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute)
35 {
36   theValue.fillAttribute(theAttribute);
37 }
38
39 //--------------------------------------------------------------------------------------
40 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
41                    const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute)
42 {
43   theAttribute->clear();
44   for (auto it = theValue.begin(); it != theValue.end(); ++it)
45     it->appendToList(theAttribute);
46 }
47
48 //--------------------------------------------------------------------------------------
49 void fillAttribute(const std::string & theValue,
50                    const std::shared_ptr<ModelAPI_AttributeString> & theAttribute)
51 {
52   theAttribute->setValue(theValue);
53 }
54 //--------------------------------------------------------------------------------------