Salome HOME
Pipe validator fix
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMulti.h
index 9328b55f8c7c47abee6bc64ee10fe55cf7630cc2..6254c1f0054ac043ce564b948f80c8f291d86290 100644 (file)
@@ -24,40 +24,29 @@ public:
       SketchSolver_Constraint(theConstraint),
       myNumberOfObjects(0),
       myNumberOfCopies(0),
-      myAdjusted(false)
+      myAdjusted(false),
+      myIsFullValue(false)
   {}
 
-////  virtual int getType() const
-////  { return SLVS_C_UNKNOWN; }
-
   /// \brief Update constraint
-  virtual void update(bool isForce = false);
-
-////  /// \brief Tries to remove constraint
-////  /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
-////  virtual bool remove();
-////
-////  /// \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);
+
+  /// \brief Tries to remove constraint
+  /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
+  virtual bool remove();
+
+  /// \brief Check the feature is a source or a copy of Multi-constraint
+  virtual bool isUsed(FeaturePtr theFeature) const;
 
 protected:
   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
   virtual void process()
   { /* do nothing here */ }
 
-  /// \brief Collect entities and their copies, like circles and arcs
-  void getEntitiesAndCopies(std::list< std::list<EntityWrapperPtr> >& theEntAndCopies);
+  /// \brief Collect entities which 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)
@@ -73,26 +62,23 @@ 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:
+  /// \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:
   int myNumberOfObjects; ///< number of previous initial objects
   int myNumberOfCopies;  ///< number of previous copies of initial objects
-
-////  std::vector< std::vector<Slvs_hEntity> > myPointsAndCopies; ///< list of initial points and their copies
-////  std::vector< std::vector<Slvs_hEntity> > myCircsAndCopies;  ///< list of circles and their copies (to change their radii together)
-////
-////  std::set<Slvs_hEntity> myPointsJustUpdated; ///< list of points touched by user
-////  std::set<Slvs_hEntity> myInitialPoints;     ///< list of points containing 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)
+
+  std::set<FeaturePtr> myFeatures; ///< list of features and their copies to find whether some of them are disappeared
 };
 
 #endif