Salome HOME
SketchSolver Refactoring: Eliminate SolveSpace as a sketch solver.
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMulti.h
index 7a9edc96e6a241ac413f109e4e8f401f7b5abb35..ea311e90de68550a340c4de757e46e0e53b6f234 100644 (file)
@@ -24,41 +24,39 @@ public:
       SketchSolver_Constraint(theConstraint),
       myNumberOfObjects(0),
       myNumberOfCopies(0),
+      myIsFullValue(false),
       myAdjusted(false),
-      myIsFullValue(false)
+      myIsEventsBlocked(false)
   {}
 
   /// \brief Update constraint
-  virtual void update();
-  /// \brief Update constraint
-  void update(bool isForce);
+  virtual void update() override;
+
+  /// \brief Notify this object about the feature is changed somewhere
+  virtual void notify(const FeaturePtr& theFeature, PlaneGCSSolver_Update*) override;
 
   /// \brief Tries to remove constraint
   /// \return \c false, if current constraint contains another SketchPlugin
   /// constraints (like for multiple coincidence)
-  virtual bool remove();
+  virtual bool remove() override;
 
-  /// \brief Check the feature is a source or a copy of Multi-constraint
-  virtual bool isUsed(FeaturePtr theFeature) const;
-  /// \brief Check the attribute is used in Multi-constraint
-  virtual bool isUsed(AttributePtr theAttribute) const;
+  /// \brief Block or unblock events from this constraint
+  virtual void blockEvents(bool isBlocked) override;
 
 protected:
   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
-  virtual void process()
+  virtual void process() override
   { /* 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<EntityWrapperPtr>& 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<EntityWrapperPtr>& theAttributes)
+  virtual void getAttributes(EntityWrapperPtr&, std::vector<EntityWrapperPtr>&) override
   { /* do nothing here */ }
 
   /// \brief This method is used in derived objects to check consistence of constraint.
-  virtual void adjustConstraint();
+  virtual void adjustConstraint() override;
 
   /// \brief Update parameters of derived classes
   virtual void updateLocal() = 0;
@@ -83,6 +81,8 @@ protected:
 
   /// list of features and their copies to find whether some of them are disappeared
   std::set<FeaturePtr> myFeatures;
+
+  bool myIsEventsBlocked;
 };
 
 #endif