]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_ResultField.h
Salome HOME
Issue #2024: Redesign of circle and arc of circle
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultField.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_ResultField.hxx
4 // Created:     16 Nov 2016
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_ResultField_H_
8 #define ModelAPI_ResultField_H_
9
10 #include "ModelAPI_Result.h"
11 #include <GeomAPI_Shape.h>
12 #include <memory>
13 #include <string>
14
15 /**\class ModelAPI_ResultField
16  * \ingroup DataModel
17  * \brief The fields result.
18  *
19  * Provides a compound of selected elements, without storage, one the fly.
20  */
21 class ModelAPI_ResultField : public ModelAPI_Result
22 {
23 public:
24
25   class ModelAPI_FieldStep : public ModelAPI_Entity
26   {
27   public:
28     virtual ModelAPI_ResultField* field() const = 0;
29
30     virtual int id() const = 0;
31   };
32
33   MODELAPI_EXPORT virtual ~ModelAPI_ResultField();
34   /// Returns the group identifier of this result
35   MODELAPI_EXPORT virtual std::string groupName();
36
37   /// Returns the group identifier of this result
38   inline static std::string group()
39   {
40     static std::string MY_GROUP = "Fields";
41     return MY_GROUP;
42   }
43
44   /// default color for a result body
45   inline static const std::string& DEFAULT_COLOR()
46   {
47     static const std::string RESULT_GROUP_COLOR("150,150,180");
48     return RESULT_GROUP_COLOR;
49   }
50
51   /// Returns number of steps
52   virtual int stepsSize() const = 0;
53
54   /// Returns a text line by its number
55   /// \param theLine a number of line
56   virtual std::string textLine(int theLine) const = 0;
57
58   /// Returns step object
59   /// \param theId an id of the object
60   virtual ModelAPI_FieldStep* step(int theId) const = 0;
61 };
62
63 //! Pointer on feature object
64 typedef std::shared_ptr<ModelAPI_ResultField> ResultFieldPtr;
65 typedef std::shared_ptr<ModelAPI_ResultField::ModelAPI_FieldStep> FieldStepPtr;
66
67 #endif