Salome HOME
Fix for some problems in the arc inversion and added a unit test for it
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintFillet.h
index 909473bac93b853fff613d26ab42dc83a28a8878..d860688dd1d65b8c5a9b17f2a1b638c8c7fe2d07 100644 (file)
 
 /** \class SketchPlugin_ConstraintFillet
  *  \ingroup Plugins
- *  \brief Feature for creation of a new constraint filleting two objects which have coincident point
+ *  \brief Feature for creation of a new constraint filleting two objects which have 
+ *  coincident point
  *
  *  This constraint has three attributes:
- *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B() for the filleting objects;
+ *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B() 
+ *  for the filleting objects;
  *  SketchPlugin_Constraint::VALUE() contains radius of filleting circular arc
  *
  *  Also the constraint has attribute SketchPlugin_Constraint::ENTITY_C()
 class SketchPlugin_ConstraintFillet : public SketchPlugin_ConstraintBase
 {
  public:
+   /// \struct Struct to store base edges with states, result edges and constraints.
+   struct FilletFeatures {
+     /// list of objects the fillet is based and its states
+     std::list<std::pair<FeaturePtr, bool>> baseEdgesState;
+     std::list<FeaturePtr> resultEdges; ///< list of result edges
+     std::list<FeaturePtr> resultConstraints; ///< list of constraints provided by the fillet
+   };
+
   /// Fillet constraint kind
   inline static const std::string& ID()
   {
@@ -58,9 +68,24 @@ class SketchPlugin_ConstraintFillet : public SketchPlugin_ConstraintBase
   /// \brief Use plugin manager for features creation
   SketchPlugin_ConstraintFillet();
 
+  /// \return map of base points and features;
+  SKETCHPLUGIN_EXPORT const std::map<AttributePtr, FilletFeatures> pointsFeaturesMap() const {
+    return myPointFeaturesMap;
+  };
+
 private:
-  std::list<FeaturePtr> myProducedFeatures; ///< list of constraints provided by the fillet
-  std::list<FeaturePtr> myBaseObjects;      ///< list of objects the fillet is based
+  /// \ Removes all produced features and restore base edges.
+  void clearResults();
+
+private:
+  std::set<AttributePtr> myNewPoints; ///< set of new points
+
+  /// map of point and features for fillet
+  std::map<AttributePtr, FilletFeatures> myPointFeaturesMap;
+  bool myListOfPointsChangedInCode; ///< flag to track that list of points changed in code
+  bool myRadiusChangedByUser; ///< flag to track that radius changed by user
+  bool myRadiusChangedInCode; ///< flag to track that radius changed in code
+  bool myRadiusInitialized; /// < flag to track that radius initialized
 };
 
 #endif