]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchPlugin/SketchPlugin_Trim.h
Salome HOME
Issue #2027 Sketcher Trim Feature: coincidence unit test case
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Trim.h
index 6928c3b9645441b5b3911e68a837f46c7ea1332b..532731b394bc95cbbb0d23c4f047560574d6a7b0 100644 (file)
@@ -92,6 +92,9 @@ class SketchPlugin_Trim : public SketchPlugin_Feature, public GeomAPI_IPresentab
   bool setCoincidenceToAttribute(const AttributePtr& theAttribute,
             const std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theFurtherCoincidences);
 
+  bool replaceCoincidenceAttribute(const AttributePtr& theCoincidenceAttribute,
+            const std::set<std::pair<AttributePtr, AttributePtr>>& theModifiedAttributes);
+
   typedef std::map<std::shared_ptr<GeomAPI_Pnt>,
                    std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
                              std::list<std::shared_ptr<ModelAPI_Object> > > > PointToRefsMap;
@@ -134,8 +137,8 @@ private:
   /// by the coincident attribute
   /// \param theObject an investigated object
   /// \param theCoincidencesToBaseFeature a container of list of referenced attributes
-  void getCoincidencesToObject(const std::shared_ptr<ModelAPI_Object>& theObject,
-                               std::map<AttributePtr, FeaturePtr>& theCoincidencesToBaseFeature);
+  //void getCoincidencesToObject(const std::shared_ptr<ModelAPI_Object>& theObject,
+  //                             std::map<AttributePtr, FeaturePtr>& theCoincidencesToBaseFeature);
 
   /// Move constraints from attribute of base feature to attribute after modification
   /// \param theBaseRefAttributes container of references to the attributes of base feature
@@ -146,32 +149,32 @@ private:
                const std::set<std::pair<AttributePtr, AttributePtr> >& theModifiedAttributes,
                std::set<std::shared_ptr<ModelAPI_Feature>>& theFeaturesToDelete);
 
+  /// Remove references constraints from attribute of base feature refer to the given attribute
+  /// \param theAttribute an attribute
+  /// \param theModifiedAttributes modifiable container of attributes
+  void removeReferencesToAttribute(const AttributePtr& theAttribute,
+                  std::map<AttributePtr, std::list<AttributePtr> >& theBaseRefAttributes);
+
   /// Make the base object is splitted by the point attributes
-  /// \param theSplitFeature a result split feature
-  /// \param theBeforeFeature a feature between start point and the 1st point of split feature
-  /// \param theAfterFeature a feature between last point of split feature and the end point
+  /// \param theBaseRefAttributes container of references to the attributes of base feature
   /// \param thePoints a list of points where coincidences will be build
   /// \param theModifiedAttributes a container of attribute on base
   /// feature to attribute on new feature
   void trimLine(const std::shared_ptr<GeomAPI_Pnt2d>& theStartShapePoint,
                 const std::shared_ptr<GeomAPI_Pnt2d>& theLastShapePoint,
+                std::map<AttributePtr, std::list<AttributePtr> >& theBaseRefAttributes,
                 std::set<std::shared_ptr<GeomDataAPI_Point2D> >& thePoints,
                 std::set<std::pair<AttributePtr, AttributePtr>>& theModifiedAttributes);
 
   /// Make the base object is splitted by the point attributes
-  /// \param theSplitFeature a result split feature
-  /// \param theBeforeFeature a feature between start point and the 1st point of split feature
-  /// \param theAfterFeature a feature between last point of split feature and the end point
   /// \param thePoints a list of points where coincidences will be build
   void trimArc(const std::shared_ptr<GeomAPI_Pnt2d>& theStartShapePoint,
                const std::shared_ptr<GeomAPI_Pnt2d>& theLastShapePoint,
+               std::map<AttributePtr, std::list<AttributePtr> >& theBaseRefAttributes,
                std::set<std::shared_ptr<GeomDataAPI_Point2D> >& thePoints,
                std::set<std::pair<AttributePtr, AttributePtr>>& theModifiedAttributes);
 
   /// Make the base object is splitted by the point attributes
-  /// \param theSplitFeature a result split feature
-  /// \param theBeforeFeature a feature between start point and the 1st point of split feature
-  /// \param theAfterFeature a feature between last point of split feature and the end point
   /// \param thePoints a list of points where coincidences will be build
   FeaturePtr trimCircle(const std::shared_ptr<GeomAPI_Pnt2d>& theStartShapePoint,
                   const std::shared_ptr<GeomAPI_Pnt2d>& theLastShapePoint,