Salome HOME
9bea2d9cd4ea7f1f3174e4e1af061c69498401d4
[modules/shaper.git] / src / ModelAPI / ModelAPI_Tools.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_Tools.h
4 // Created:     06 Aug 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ModelAPI_Tools_HeaderFile
8 #define ModelAPI_Tools_HeaderFile
9
10 #include "ModelAPI.h"
11 #include <ModelAPI_Result.h>
12 #include <ModelAPI_ResultParameter.h>
13 #include <GeomAPI_Shape.h>
14
15 #include <vector>
16
17 namespace ModelAPI_Tools {
18 /// Returns shape from the given Result object
19 MODELAPI_EXPORT std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult);
20
21 /*!
22  * Searches for variable with name \param theName in the active document (Part), when
23  * in the root document (PartSet). If found, set it value in the \param outValue
24  * and returns true.
25  */
26 MODELAPI_EXPORT bool findVariable(const std::string& theName, double& outValue, 
27   ResultParameterPtr& theParam);
28
29 /*!
30  * Returns the values of the next random color. The values are in range [0, 255]
31  * \param theValues a container of component of RGB value: red, green, blue
32  */
33 MODELAPI_EXPORT void findRandomColor(std::vector<int>& theValues);
34
35 }
36
37 #endif