X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintMulti.h;h=70fe5e7817ab1ee6ffc82323be267486d5eb3ab8;hb=8cd56d486b6e96b8814002f9f0f4acadd6cea11b;hp=4786ee430436040987a5dfe405366e9d8eff4892;hpb=8f10db487ef409d859a62aa6e2235a17d9b56723;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.h b/src/SketchSolver/SketchSolver_ConstraintMulti.h index 4786ee430..70fe5e781 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.h +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.h @@ -27,29 +27,10 @@ public: myAdjusted(false) {} - virtual int getType() const - { return SLVS_C_UNKNOWN; } - /// \brief Update constraint - virtual void update(ConstraintPtr theConstraint = ConstraintPtr()); - - /// \brief Tries to remove constraint - /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence) - virtual bool remove(ConstraintPtr theConstraint = ConstraintPtr()); - - /// \brief Adds a feature to constraint and create its analogue in SolveSpace - virtual void addFeature(FeaturePtr theFeature); - - /// \brief Update SketchPlugin attributes using the data obtained from SolveSpace entities - virtual void refresh() - { - myAdjusted = false; - SketchSolver_Constraint::refresh(); - } - - /// \brief Verifies, the coincidence between points of copied entities appears or disappears, - /// and removes or adds fixing of corresponding points. - void checkCoincidence(); + virtual void update(); + /// \brief Update constraint + void update(bool isForce); protected: /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints @@ -57,12 +38,12 @@ protected: { /* do nothing here */ } /// \brief Collect entities and their copies, like circles and arcs - void processEntities(const std::vector< std::vector >& theEntAndCopies); + void getEntitiesAndCopies(std::list< std::list >& theEntAndCopies); /// \brief Generate list of attributes of constraint in order useful for SolveSpace constraints /// \param[out] theValue numerical characteristic of constraint (e.g. distance) /// \param[out] theAttributes list of attributes to be filled - virtual void getAttributes(double& theValue, std::vector& theAttributes) + virtual void getAttributes(double& theValue, std::vector& theAttributes) { /* do nothing here */ } /// \brief This method is used in derived objects to check consistence of constraint. @@ -73,24 +54,10 @@ protected: /// \brief Returns name of NUMBER_OF_COPIES parameter for corresponding feature virtual const std::string& nameNbObjects() = 0; - -protected: - /// \brief Convert absolute coordinates to relative coordinates - virtual void getRelative(double theAbsX, double theAbsY, double& theRelX, double& theRelY) = 0; - /// \brief Convert relative coordinates to absolute coordinates - virtual void getAbsolute(double theRelX, double theRelY, double& theAbsX, double& theAbsY) = 0; - /// \brief Apply transformation for relative coordinates - virtual void transformRelative(double& theX, double& theY) = 0; protected: - size_t myNumberOfObjects; ///< number of previous initial objects - size_t myNumberOfCopies; ///< number of previous copies of initial objects - - std::vector< std::vector > myPointsAndCopies; ///< list of initial points and their copies - std::vector< std::vector > myCircsAndCopies; ///< list of circles and their copies (to change their radii together) - - std::set myPointsJustUpdated; ///< list of points touched by user - std::set myInitialPoints; ///< list of points containing initial objects + int myNumberOfObjects; ///< number of previous initial objects + int myNumberOfCopies; ///< number of previous copies of initial objects bool myAdjusted; ///< the constraint is already adjusted (to not do it several times) };