X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultConstruction.h;h=be4fb14c0e1665378703625c93d91b34f4622c4e;hb=ba71135a8b45672f032240b22086d4b17b7b0b97;hp=7b1cfcd1744a40b9029f0c3f36623c53b4354044;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultConstruction.h b/src/Model/Model_ResultConstruction.h index 7b1cfcd17..be4fb14c0 100644 --- a/src/Model/Model_ResultConstruction.h +++ b/src/Model/Model_ResultConstruction.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2020 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 Model_ResultConstruction_H_ @@ -39,22 +38,13 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction { std::shared_ptr myOwner; ///< owner of this result std::shared_ptr myShape; ///< shape of this result created "on the fly" - bool myFacesUpToDate; ///< is true if faces in myuFaces are computed and up to date - /// stores the up to date faces if they exist - std::vector > myFaces; - bool myIsInHistory; - bool myIsInfinite; public: /// Retuns the parameters of color definition in the resources config manager MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName, std::string& theDefault); /// By default object is displayed in the object browser. - MODEL_EXPORT virtual bool isInHistory() - { - return myIsInHistory; - } - + MODEL_EXPORT virtual bool isInHistory(); /// Sets the result MODEL_EXPORT virtual void setShape(std::shared_ptr theShape); /// Returns the shape-result produced by this feature @@ -64,50 +54,31 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction MODEL_EXPORT virtual void setIsInHistory(const bool myIsInHistory); /// if the construction result may be used as faces, this method returns not zero number of faces - MODEL_EXPORT virtual int facesNum(); + /// \param theUpdateNaming is false of keeping the naming structure untouched (on load) + MODEL_EXPORT virtual int facesNum(const bool theUpdateNaming = true); /// if the construction result may be used as faces, this method returns face by zero based index MODEL_EXPORT virtual std::shared_ptr face(const int theIndex); + /// Change the order of faces + MODEL_EXPORT + virtual void setFacesOrder(const std::list >& theFaces); /// By default object is not infinite. MODEL_EXPORT virtual bool isInfinite(); /// Sets the flag that it is infinite MODEL_EXPORT virtual void setInfinite(const bool theInfinite); - /// The construction element is never concealed - MODEL_EXPORT virtual void setIsConcealed(const bool theValue); - - // methods related to selection of sub-shapes in construction, used by SelectionAttribute - - /// Selects theSubShape in the construction. Returns an index of the selected sub-shape. - /// Puts the selected shape with a needed BRepNaming sub-structure to the data tree of result. - /// If theSubShape is null, it selects the whole construction and returns zero index. - /// If theIndex is not -1, it re-selects over the existing data (used for update selection). - /// If theExtDoc is document where this selection is needed, if it differs from this, - /// naming structures will be located there. - int select(const std::shared_ptr& theSubShape, - const std::shared_ptr theExtDoc, const int theIndex = -1); - - /// Returns already selected shape by the given index. Zero index means the whole construction, - /// so, the returned shape in this case is null. - /// If theExtDoc is document where this selection is needed, if it differs from this, - /// naming structures will be located there. - std::shared_ptr shape(const int theIndex, - const std::shared_ptr theExtDoc); + /// The construction element may be concealed only by "delete" feature + MODEL_EXPORT virtual void setIsConcealed(const bool theValue, const bool theForced = false); - /// Updates the existing selection by the index. - /// Returns false if update is failed. Returns theModified true if the selection was updated. - /// If theExtDoc is document where this selection is needed, if it differs from this, - /// naming structures will be updated there. - bool update(const int theIndex, const std::shared_ptr theExtDoc, - bool& theModified); + /// Updates the shape taking the current value from the data structure, returns true + /// if update has been correctly done + MODEL_EXPORT virtual bool updateShape(); protected: /// Makes a body on the given feature Model_ResultConstruction(); - /// Searchies for the working label selection/update will start from - /// Returns true if this is label of the external document. - /// theExtDoc is document where this selection is required - TDF_Label startLabel(const std::shared_ptr theExtDoc, bool& theExternal); + /// Stores shape in the data structure to allow identification it by the naming + void storeShape(std::shared_ptr theShape); friend class Model_Objects; };