X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_ResultBody.h;h=7b9b3177871ffff939626c90df9b938758e107bf;hb=d5c7ad3c50f89a2ddc2de1866ffb7f09397f3be2;hp=1ad95f5d1e7dfb3b11c02af52e6721fe578ac25f;hpb=d4b0a5cb916f4eccf4a0bce02e43a54c7a67cb93;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_ResultBody.h b/src/ModelAPI/ModelAPI_ResultBody.h index 1ad95f5d1..7b9b31778 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.h +++ b/src/ModelAPI/ModelAPI_ResultBody.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_ResultBody_H_ @@ -87,9 +86,9 @@ public: MODELAPI_EXPORT virtual std::shared_ptr subResult( const int theIndex, bool forTree = false) const = 0; - /// Returns true if feature or result belong to this composite feature as subs + /// Returns true if theResult belong to this composite result as sub. /// Returns theIndex - zero based index of sub if found - MODELAPI_EXPORT virtual bool isSub(ObjectPtr theObject, int& theIndex) const = 0; + MODELAPI_EXPORT virtual bool isSub(ObjectPtr theResult, int& theIndex) const = 0; /// \brief Stores the shape (called by the execution method). /// param[in] theShape shape to store. @@ -102,11 +101,21 @@ public: MODELAPI_EXPORT virtual void storeGenerated(const GeomShapePtr& theFromShape, const GeomShapePtr& theToShape); + /// Stores the root modified shapes (called by the execution method). + MODELAPI_EXPORT virtual void storeGenerated( + const std::list& theFromShapes, const GeomShapePtr& theToShape, + const std::shared_ptr theMakeShape); + /// Stores the modified shape (called by the execution method). MODELAPI_EXPORT virtual void storeModified(const GeomShapePtr& theOldShape, const GeomShapePtr& theNewShape, const bool theIsCleanStored = true); + /// Stores the root modified shapes (called by the execution method). + MODELAPI_EXPORT virtual void storeModified( + const std::list& theOldShapes, const GeomShapePtr& theNewShape, + const std::shared_ptr theMakeShape); + /// Returns the shape-result produced by this feature MODELAPI_EXPORT virtual GeomShapePtr shape(); @@ -114,7 +123,7 @@ public: /// As an example, consider the case of a face generated in construction of a box. /// Returns true if it is stored correctly (the final shape contains this new sub-shape) MODELAPI_EXPORT virtual bool generated(const GeomShapePtr& theNewShape, - const std::string& theName, const bool theCheckIsInResult = true); + const std::string& theName, const bool theCheckIsInResult = true) = 0; /// Records the shape newShape which was generated from the shape oldShape during a topological /// construction. As an example, consider the case of a face generated from an edge in @@ -141,18 +150,19 @@ public: virtual void loadModifiedShapes(const std::shared_ptr& theAlgo, const GeomShapePtr& theOldShape, const GeomAPI_Shape::ShapeType theShapeTypeToExplore, - const std::string& theName = ""); + const std::string& theName = "") = 0; /// load and orient generated shapes MODELAPI_EXPORT virtual void loadGeneratedShapes(const std::shared_ptr& theAlgo, const GeomShapePtr& theOldShape, const GeomAPI_Shape::ShapeType theShapeTypeToExplore, - const std::string& theName = ""); + const std::string& theName = "", + const bool theSaveOldIfNotInTree = false) = 0; /// load shapes of the first level (to be used during shape import) MODELAPI_EXPORT virtual void loadFirstLevel(GeomShapePtr theShape, - const std::string& theName); + const std::string& theName) = 0; /// Returns true is the topology is connected. MODELAPI_EXPORT virtual bool isConnectedTopology() = 0; @@ -165,6 +175,14 @@ public: MODELAPI_EXPORT virtual void updateSubs(const GeomShapePtr& theThisShape, const bool theShapeChanged = true) = 0; + /// Updates the sub-bodies in accordance to the algorithm history information + MODELAPI_EXPORT virtual void updateSubs( + const GeomShapePtr& theThisShape, const std::list& theOlds, + const std::shared_ptr theMakeShape, const bool isGenerated) = 0; + + /// Cleans cash related to the already stored elements + MODELAPI_EXPORT virtual void cleanCash() = 0; + protected: /// Default constructor accessible only from Model_Objects MODELAPI_EXPORT ModelAPI_ResultBody();