X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_ResultField.h;h=4e2be6a4090e102188bdd8b1e88978c490ba3b37;hb=d5c7ad3c50f89a2ddc2de1866ffb7f09397f3be2;hp=bdb75e83f78e10114f9d966a3d80137ecbd26b79;hpb=7074394f8f08413d885f63be01df6bd5007b868c;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_ResultField.h b/src/ModelAPI/ModelAPI_ResultField.h index bdb75e83f..4e2be6a40 100644 --- a/src/ModelAPI/ModelAPI_ResultField.h +++ b/src/ModelAPI/ModelAPI_ResultField.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef ModelAPI_ResultField_H_ @@ -36,12 +35,48 @@ class ModelAPI_ResultField : public ModelAPI_Result { public: - class ModelAPI_FieldStep : public ModelAPI_Entity + class ModelAPI_FieldStep : public ModelAPI_Object { public: virtual ModelAPI_ResultField* field() const = 0; virtual int id() const = 0; + + /// Returns the group identifier of this result + inline static std::string group() + { + static std::string MY_GROUP = "FieldRersultStep"; + return MY_GROUP; + } + + /// Returns the group identifier of this object + virtual std::string groupName() { return group(); } + + /// Request for initialization of data model of the object: adding all attributes + virtual void initAttributes() {} + + /// Returns the feature is disabled or not. + virtual bool isDisabled() { return false; } + + /// Returns true if object must be displayed in the viewer: flag is stored in the + /// data model, so on undo/redo, open/save or recreation of object by history-playing it keeps + /// the original state in the current transaction. + virtual bool isDisplayed() { return myIsDisplayed; } + + /// Sets the displayed/hidden state of the object. If it is changed, sends the "redisplay" + /// signal. + MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay); + + /// Returns a GUI name of this step + MODELAPI_EXPORT virtual std::string name() = 0; + + protected: + /// This method is called just after creation of the object: it must initialize + /// all fields, normally initialized in the constructor + MODELAPI_EXPORT virtual void init() {} + + private: + bool myIsDisplayed; }; MODELAPI_EXPORT virtual ~ModelAPI_ResultField(); @@ -71,7 +106,14 @@ public: /// Returns step object /// \param theId an id of the object - virtual ModelAPI_FieldStep* step(int theId) const = 0; + virtual std::shared_ptr step(int theId) const = 0; + + /// Sets the displayed/hidden state of the object. If it is changed, sends the "redisplay" + /// signal. + MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay); + + /// To refresh the steps of a field + MODELAPI_EXPORT virtual void updateSteps() = 0; }; //! Pointer on feature object