Salome HOME
Merge branch 'master' into Dev_1.1.0
[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   /// Sets the result
37   virtual void setShape(std::shared_ptr<GeomAPI_Shape> theShape) = 0;
38
39   /// Sets the flag that it must be displayed in history (default is true)
40   virtual void setIsInHistory(const bool isInHistory) = 0;
41
42   /// if the construction result may be used as faces, this method returns not zero number of faces
43   virtual int facesNum() = 0;
44   /// if the construction result may be used as faces, this method returns face by zero based index
45   virtual std::shared_ptr<GeomAPI_Face> face(const int theIndex) = 0;
46 };
47
48 //! Pointer on feature object
49 typedef std::shared_ptr<ModelAPI_ResultConstruction> ResultConstructionPtr;
50
51 #endif