]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_ResultField.h
Salome HOME
eb9d4a7b61931ffe2fba531025efe8a701ad5325
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultField.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef ModelAPI_ResultField_H_
21 #define ModelAPI_ResultField_H_
22
23 #include "ModelAPI_Result.h"
24 #include <GeomAPI_Shape.h>
25 #include <memory>
26 #include <string>
27
28 /**\class ModelAPI_ResultField
29  * \ingroup DataModel
30  * \brief The fields result.
31  *
32  * Provides a compound of selected elements, without storage, one the fly.
33  */
34 class ModelAPI_ResultField : public ModelAPI_Result
35 {
36 public:
37
38   class ModelAPI_FieldStep : public ModelAPI_Entity
39   {
40   public:
41     virtual ModelAPI_ResultField* field() const = 0;
42
43     virtual int id() const = 0;
44   };
45
46   MODELAPI_EXPORT virtual ~ModelAPI_ResultField();
47   /// Returns the group identifier of this result
48   MODELAPI_EXPORT virtual std::string groupName();
49
50   /// Returns the group identifier of this result
51   inline static std::string group()
52   {
53     static std::string MY_GROUP = "Fields";
54     return MY_GROUP;
55   }
56
57   /// default color for a result body
58   inline static const std::string& DEFAULT_COLOR()
59   {
60     static const std::string RESULT_GROUP_COLOR("150,150,180");
61     return RESULT_GROUP_COLOR;
62   }
63
64   /// Returns number of steps
65   virtual int stepsSize() const = 0;
66
67   /// Returns a text line by its number
68   /// \param theLine a number of line
69   virtual std::string textLine(int theLine) const = 0;
70
71   /// Returns step object
72   /// \param theId an id of the object
73   virtual ModelAPI_FieldStep* step(int theId) const = 0;
74 };
75
76 //! Pointer on feature object
77 typedef std::shared_ptr<ModelAPI_ResultField> ResultFieldPtr;
78 typedef std::shared_ptr<ModelAPI_ResultField::ModelAPI_FieldStep> FieldStepPtr;
79
80 #endif