Salome HOME
[bos #29971] [CEA 29586] doing a fillet
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.cpp
index bd8408eea736922fd5c00a05b2b27e8e71cac874..73ec0900a11779d5a0e6778aebbbe5e8eeab6859 100644 (file)
@@ -669,6 +669,15 @@ static bool isPointPointCoincidence(const FeaturePtr& theCoincidence)
 bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribute,
                                                  const std::list<std::string>& theArguments,
                                                  Events_InfoMessage& theError) const
+{
+  FeaturePtr anEdge1, anEdge2;
+  return isValidVertex(theAttribute, theError, anEdge1, anEdge2);
+}
+
+bool SketchPlugin_FilletVertexValidator::isValidVertex(const AttributePtr& theAttribute,
+                                                       Events_InfoMessage& theError,
+                                                       FeaturePtr&         theEdge1,
+                                                       FeaturePtr&         theEdge2)
 {
   AttributeRefAttrPtr aPointRefAttr =
     std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
@@ -723,13 +732,13 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
   // Get coincides from constraint.
   std::set<FeaturePtr> aCoinsides;
   SketchPlugin_Tools::findCoincidences(aConstraintCoincidence,
-                                        SketchPlugin_ConstraintCoincidence::ENTITY_A(),
-                                        aCoinsides,
-                                        true);
+                                       SketchPlugin_ConstraintCoincidence::ENTITY_A(),
+                                       aCoinsides,
+                                       true);
   SketchPlugin_Tools::findCoincidences(aConstraintCoincidence,
-                                        SketchPlugin_ConstraintCoincidence::ENTITY_B(),
-                                        aCoinsides,
-                                        true);
+                                       SketchPlugin_ConstraintCoincidence::ENTITY_B(),
+                                       aCoinsides,
+                                       true);
 
   // Remove points and external lines from set of coincides.
   std::set<FeaturePtr> aNewSetOfCoincides;
@@ -774,6 +783,11 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
     return false;
   }
 
+  // output edges
+  std::set<FeaturePtr>::iterator aFIt = aCoinsides.begin();
+  theEdge1 = *aFIt;
+  theEdge2 = *(++aFIt);
+
   // Check that selected edges don't have tangent constraint.
   std::set<FeaturePtr>::iterator anIt = aCoinsides.begin();
   FeaturePtr aFirstFeature = *anIt++;