X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FModel_ResultCompSolid.h;h=ba92674e8c80a03228a3349655dc711447eef05a;hb=690012a1c13c51062fc01656ee18dd8edb947e02;hp=6e7c2c663c98732d279a1e58b130d9c2c749ffdc;hpb=470905ace04b0b7345038bb2277050a6c8fcc585;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultCompSolid.h b/src/Model/Model_ResultCompSolid.h index 6e7c2c663..ba92674e8 100755 --- a/src/Model/Model_ResultCompSolid.h +++ b/src/Model/Model_ResultCompSolid.h @@ -9,43 +9,78 @@ #include "Model.h" #include +#include /**\class Model_ResultCompSolid - * \ingroup DataModel - * \brief The compsolid (container of body results) result of a feature. - * - * Provides a container of shapes that may be displayed in the viewer. - */ +* \ingroup DataModel +* \brief The compsolid (container of body results) result of a feature. +* +* Provides a container of shapes that may be displayed in the viewer. +*/ class Model_ResultCompSolid : public ModelAPI_ResultCompSolid { + /// Sub-bodies if this is compsolid: zero base index to subs + std::vector > mySubs; + /// Flag that stores the previous state of "concealed": if it is changed, + /// The event must be generated to redisplay this and all subs. + bool myLastConcealed; + + public: + /// Removes the stored builders MODEL_EXPORT virtual ~Model_ResultCompSolid(); - /// Adds result to the sketch and to its document - virtual std::shared_ptr addResult(std::string theID); + /// Request for initialization of data model of the object: adding all attributes + MODEL_EXPORT virtual void initAttributes(); + + /// Stores the shape (called by the execution method). Creates sub-results for compsolid. + MODEL_EXPORT virtual void store(const std::shared_ptr& theShape); + + /// Stores the generated shape. Creates sub-results for compsolid. + MODEL_EXPORT virtual void storeGenerated(const std::shared_ptr& theFromShape, + const std::shared_ptr& theToShape); + + /// Stores the modified shape. Creates sub-results for compsolid. + MODEL_EXPORT virtual void storeModified(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape, const int theDecomposeSolidsTag = 0); /// Returns the number of sub-elements - virtual int numberOfSubs(bool forTree = false) const; + MODEL_EXPORT virtual int numberOfSubs(bool forTree = false) const; /// Returns the sub-result by zero-base index - virtual std::shared_ptr subResult(const int theIndex, - bool forTree = false) const; - - /// Returns the sub-feature unique identifier in this composite feature by zero-base index - virtual int subResultId(const int theIndex) const; + MODEL_EXPORT virtual std::shared_ptr subResult(const int theIndex, + bool forTree = false) const; /// Returns true if feature or reuslt belong to this composite feature as subs - virtual bool isSub(ObjectPtr theObject) const; + MODEL_EXPORT virtual bool isSub(ObjectPtr theObject) const; + + /// Returns the parameters of color definition in the resources config manager + MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName, + std::string& theDefault); + + /// Disables the result body: keeps the resulting shape as selection, but erases the underlaying + /// naming data structure if theFlag if false. Or restores everything on theFlag is true. + MODEL_EXPORT virtual bool setDisabled(std::shared_ptr theThis, + const bool theFlag); - /// This method to inform that sub-feature is removed and must be removed from the internal data - /// structures of the owner (the remove from the document will be done outside just after) - virtual void removeResult(std::shared_ptr theResult); + /// The compsolid is concealed if at least one of the sub is concealed + MODEL_EXPORT virtual bool isConcealed(); + + /// Sets all subs as concealed in the data tree (referenced by other objects) + MODEL_EXPORT virtual void setIsConcealed(const bool theValue); + + /// Returns true if the latest modification of this body in the naming history + // is equal to the given shape + MODEL_EXPORT virtual bool isLatestEqual(const std::shared_ptr& theShape); protected: /// Makes a body on the given feature Model_ResultCompSolid(); + /// Updates the sub-bodies if shape of this object is composite-solid + void updateSubs(const std::shared_ptr& theThisShape); + friend class Model_Objects; };