Salome HOME
Issue #1859 Default value of deflection coefficients
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultConstruction.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_ResultConstruction.h
4 // Created:     07 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_ResultConstruction_H_
8 #define ModelAPI_ResultConstruction_H_
9
10 #include "ModelAPI_Result.h"
11 #include <GeomAPI_Shape.h>
12 #include <GeomAPI_Face.h>
13
14 #include <string>
15
16 /**\class ModelAPI_ResultConstruction
17  * \ingroup DataModel
18  * \brief The construction element result of a feature.
19  *
20  * Provides a shape that may be displayed in the viewer.
21  * Intermediate, light result that in many cases produces a result on the fly.
22  */
23 class ModelAPI_ResultConstruction : public ModelAPI_Result
24 {
25  public:
26   /// Returns the group identifier of this result
27   MODELAPI_EXPORT virtual std::string groupName();
28
29   /// Returns the group identifier of this result
30   inline static std::string group()
31   {
32     static std::string MY_GROUP = "Construction";
33     return MY_GROUP;
34   }
35
36   /// default color for a result construction
37   inline static const std::string& DEFAULT_COLOR()
38   {
39     static const std::string RESULT_CONSTRUCTION_COLOR("120,120,120");
40     return RESULT_CONSTRUCTION_COLOR;
41   }
42
43   /// default deflection for a result construction
44   inline static const std::string DEFAULT_DEFLECTION()
45   {
46     return "0.00001";
47   }
48
49   /// Sets the result
50   virtual void setShape(std::shared_ptr<GeomAPI_Shape> theShape) = 0;
51
52   /// Sets the flag that it must be displayed in history (default is true)
53   virtual void setIsInHistory(const bool isInHistory) = 0;
54
55   /// if the construction result may be used as faces, this method returns not zero number of faces
56   virtual int facesNum() = 0;
57   /// if the construction result may be used as faces, this method returns face by zero based index
58   virtual std::shared_ptr<GeomAPI_Face> face(const int theIndex) = 0;
59
60   /// By default object is not infinite.
61   virtual bool isInfinite() = 0;
62   /// Sets the flag that it is infinite
63   virtual void setInfinite(const bool theInfinite) = 0;
64 };
65
66 //! Pointer on feature object
67 typedef std::shared_ptr<ModelAPI_ResultConstruction> ResultConstructionPtr;
68
69 #endif