1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_ResultField.h
4 // Created: 16 Nov 2016
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_ResultField_H_
8 #define Model_ResultField_H_
11 #include <ModelAPI_ResultField.h>
14 /**\class Model_ResultField
16 * \brief The fields result.
18 * Provides a compound of selected elements, without storage, one the fly.
20 class Model_ResultField : public ModelAPI_ResultField
22 std::shared_ptr<ModelAPI_Data> myOwnerData; ///< data of owner of this result
25 class Model_FieldStep : public ModelAPI_ResultField::ModelAPI_FieldStep
28 Model_FieldStep(ModelAPI_ResultField* theParent, int theId)
29 : myParent(theParent), myId(theId) {};
31 virtual ModelAPI_ResultField* field() const { return myParent; }
33 virtual int id() const { return myId; }
36 ModelAPI_ResultField* myParent;
40 /// Retuns the parameters of color definition in the resources config manager
41 MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
42 std::string& theDefault);
44 /// Returns the compound of selected entities
45 MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
47 /// Returns number of steps
48 MODEL_EXPORT virtual int stepsSize() const;
50 /// Returns a text line by its number
51 /// \param theLine a number of line
52 MODEL_EXPORT virtual std::string textLine(int theLine) const;
54 /// Returns step object
55 /// \param theId an id of the object
56 MODEL_EXPORT virtual ModelAPI_ResultField::ModelAPI_FieldStep* step(int theId) const;
58 /// Removes the stored builders
59 MODEL_EXPORT virtual ~Model_ResultField();
62 /// Makes a body on the given feature data
63 Model_ResultField(std::shared_ptr<ModelAPI_Data> theOwnerData);
65 friend class Model_Objects;
70 std::vector<ModelAPI_FieldStep*> mySteps;