X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSketchSolver%2FSketchSolver_Storage.h;h=6a1b1b2e817354138c24e4c018869c10a66ff6bf;hb=176403004ff97696f3c0b5f8bdf48692177fb34a;hp=454044c8826f42fea46eee82a5c57d6a89751558;hpb=9ddc291385b55eb7efd9a560a1a5c468a98dc324;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Storage.h b/src/SketchSolver/SketchSolver_Storage.h index 454044c88..6a1b1b2e8 100644 --- a/src/SketchSolver/SketchSolver_Storage.h +++ b/src/SketchSolver/SketchSolver_Storage.h @@ -37,6 +37,7 @@ private: public: SketchSolver_Storage(const GroupID& theGroup) : myGroupID(theGroup), + mySketchID(EID_UNKNOWN), myNeedToResolve(false), myEventsBlocked(false), myExistArc(false) @@ -59,12 +60,18 @@ public: /// \brief Convert feature to the form applicable for specific solver and map it /// \param theFeature [in] feature to convert /// \param theGroup [in] id of the group where the feature should be placed + /// \param theForce [in] forced feature creation /// \return \c true if the feature has been created or updated - SKETCHSOLVER_EXPORT bool update(FeaturePtr theFeature, const GroupID& theGroup = GID_UNKNOWN); + SKETCHSOLVER_EXPORT bool update(FeaturePtr theFeature, + const GroupID& theGroup = GID_UNKNOWN, bool theForce = false); + /// \brief Convert attribute to the form applicable for specific solver and map it - /// \param theFeature [in] feature to convert + /// \param theAttribute [in] attribute to convert + /// \param theGroup [in] id of the group where the feature should be placed + /// \param theForce [in] forced feature creation /// \return \c true if the attribute has been created or updated - SKETCHSOLVER_EXPORT bool update(AttributePtr theAttribute, const GroupID& theGroup = GID_UNKNOWN); + SKETCHSOLVER_EXPORT bool update(AttributePtr theAttribute, + const GroupID& theGroup = GID_UNKNOWN, bool theForce = false); /// \brief Returns constraint related to corresponding constraint SKETCHSOLVER_EXPORT @@ -162,7 +169,8 @@ protected: void addEntity(FeaturePtr theFeature, EntityWrapperPtr theSolverEntity); - /// \brief Change mapping attribute of a feature and the entity applicable for corresponding solver. + /// \brief Change mapping attribute of a feature and the entity + /// applicable for corresponding solver. /// \param theAttribute [in] original attribute /// \param theSolverEntity [in] solver's entity, created outside SKETCHSOLVER_EXPORT @@ -189,6 +197,9 @@ protected: /// \return \c true if the parameter has been removed virtual bool remove(ParameterWrapperPtr theParameter) = 0; + /// \brief Remove point-point coincidence + SKETCHSOLVER_EXPORT bool removeCoincidence(ConstraintWrapperPtr theConstraint); + /// \brief Update the group for the given entity, its sub-entities and parameters virtual void changeGroup(EntityWrapperPtr theEntity, const GroupID& theGroup) = 0; /// \brief Update the group for the given parameter @@ -202,11 +213,15 @@ protected: /// \brief Find arcs without corresponding entity applicable for the solver and build them SKETCHSOLVER_EXPORT void processArcs(); + /// \brief Replace entities by others + void replaceEntities(const std::map& theChange); + private: /// \brief Find the normal of the sketch EntityWrapperPtr getNormal() const; protected: + EntityID mySketchID; ///< identifier of the sketch GroupID myGroupID; ///< identifier of the group, this storage belongs to bool myNeedToResolve; ///< parameters are changed and group needs to be resolved bool myEventsBlocked; ///< indicates that features do not send events @@ -219,7 +234,8 @@ protected: /// map attribute to solver's entity std::map myAttributeMap; - CoincidentPointsMap myCoincidentPoints; ///< lists of coincident points (first is a master point, second is a set of slaves) + /// lists of coincident points (first is a master point, second is a set of slaves) + CoincidentPointsMap myCoincidentPoints; // to be able to update entities from constraints friend class SketchSolver_ConstraintDistance;