Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.cpp
index 18c9f81c248112f3850cf229782089f9d1ba88ae..4f5f9cba16c2d8b538a3a38a042d948f279da2c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -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++;