X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintMulti.h;h=d077aab7e43fea658a389463a901c8df8e98c5e2;hb=97c06c5cd9fc736f9b5a1dacde369a9d7b5be703;hp=16db54dbde8881cb2178a782c4515850705d8621;hpb=fd7266e083c3fb837b8b195b1db746fdbd7b2be8;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.h b/src/SketchSolver/SketchSolver_ConstraintMulti.h index 16db54dbd..d077aab7e 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.h +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.h @@ -1,13 +1,25 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: SketchSolver_ConstraintMulti.h -// Created: 2 Sep 2015 -// Author: Artem ZHIDKOV +// 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef SketchSolver_ConstraintMulti_H_ #define SketchSolver_ConstraintMulti_H_ -#include "SketchSolver.h" #include #include @@ -24,26 +36,36 @@ public: SketchSolver_Constraint(theConstraint), myNumberOfObjects(0), myNumberOfCopies(0), - myAdjusted(false) + myIsFullValue(false), + myAdjusted(false), + myIsEventsBlocked(false), + myIsProcessingNotify(false) {} /// \brief Update constraint virtual void update(); - /// \brief Update constraint - void update(bool isForce); + + /// \brief Notify this object about the feature is changed somewhere + virtual void notify(const FeaturePtr& theFeature, PlaneGCSSolver_Update*); + + /// \brief Tries to remove constraint + /// \return \c false, if current constraint contains another SketchPlugin + /// constraints (like for multiple coincidence) + virtual bool remove(); + + /// \brief Block or unblock events from this constraint + virtual void blockEvents(bool isBlocked); protected: /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints virtual void process() { /* do nothing here */ } - /// \brief Collect entities which translated or rotated (not their copies) + /// \brief Collect entities which are translated or rotated (not their copies) void getEntities(std::list& theEntities); /// \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(EntityWrapperPtr&, std::vector&) { /* do nothing here */ } /// \brief This method is used in derived objects to check consistence of constraint. @@ -54,7 +76,7 @@ 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; @@ -66,8 +88,16 @@ protected: protected: int myNumberOfObjects; ///< number of previous initial objects int myNumberOfCopies; ///< number of previous copies of initial objects + bool myIsFullValue; ///< value whether the angle/distance is a full or single for objects bool myAdjusted; ///< the constraint is already adjusted (to not do it several times) + + /// lists of original features and their copies to find whether some of them are disappeared + std::set myOriginalFeatures; + std::set myCopiedFeatures; + + bool myIsEventsBlocked; + bool myIsProcessingNotify; ///< the notification is already processing }; #endif