Salome HOME
Change color for construction/body/group.
[modules/shaper.git] / src / ModelAPI / ModelAPI_Result.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_Result.hxx
4 // Created:     07 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_Result_H_
8 #define ModelAPI_Result_H_
9
10 #include "ModelAPI_Object.h"
11 #include <GeomAPI_Shape.h>
12
13 class ModelAPI_Feature;
14
15 /**\class ModelAPI_Result
16  * \ingroup DataModel
17  * \brief The result of a feature.
18  *
19  * A generic class that .
20  */
21 class ModelAPI_Result : public ModelAPI_Object
22 {
23   bool myIsConcealed; ///< the result is concealed from the data tree (referenced by other objects)
24  public:
25
26   /// Reference to the color of the result
27   inline static const std::string& COLOR_ID()
28   {
29     static const std::string MY_COLOR_ID("Color");
30     return MY_COLOR_ID;
31   }
32
33   /// Returns true if the result is concealed from the data tree (referenced by other objects)
34   inline bool isConcealed()
35   {
36     return myIsConcealed;
37   }
38
39   /// Returns true if the result is concealed from the data tree (referenced by other objects)
40   inline void setIsConcealed(const bool theValue)
41   {
42     myIsConcealed = theValue;
43   }
44
45   // Retuns the parameters of color definition in the resources config manager
46   virtual void colorConfigInfo(std::string& theSection, std::string& theName, std::string& theDefault) {}
47
48   /// Request for initialization of data model of the result: adding all attributes
49   virtual void initAttributes() {};
50
51   /// To virtually destroy the fields of successors
52   MODELAPI_EXPORT virtual ~ModelAPI_Result();
53
54   /// Returns the shape-result produced by this feature (or null if no shapes)
55   MODELAPI_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
56 };
57
58 //! Pointer on feature object
59 typedef std::shared_ptr<ModelAPI_Result> ResultPtr;
60
61 #endif