1 // Name : ModelHighAPI_Tools.cpp
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
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)
29 theValue.fillAttribute(theAttribute);
32 //--------------------------------------------------------------------------------------
33 void fillAttribute(const ModelHighAPI_Selection & theValue,
34 const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute)
36 theValue.fillAttribute(theAttribute);
39 //--------------------------------------------------------------------------------------
40 void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
41 const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute)
43 theAttribute->clear();
44 for (auto it = theValue.begin(); it != theValue.end(); ++it)
45 it->appendToList(theAttribute);
48 //--------------------------------------------------------------------------------------
49 void fillAttribute(const std::string & theValue,
50 const std::shared_ptr<ModelAPI_AttributeString> & theAttribute)
52 theAttribute->setValue(theValue);
54 //--------------------------------------------------------------------------------------