]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #741 fillet is wrong
authornds <natalia.donis@opencascade.com>
Thu, 9 Jul 2015 11:23:17 +0000 (14:23 +0300)
committernds <natalia.donis@opencascade.com>
Thu, 9 Jul 2015 11:23:43 +0000 (14:23 +0300)
src/PartSet/PartSet_MenuMgr.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Tools.cpp
src/PartSet/PartSet_Tools.h
src/PartSet/PartSet_Validators.cpp
src/PartSet/PartSet_Validators.h
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Validators.cpp
src/SketchPlugin/SketchPlugin_Validators.h
src/SketchPlugin/plugin-Sketch.xml

index d676ce1ee04afb59d97899344c74707296bdb4e8..e09654f96a5b21e1ba5a4fc312e9f2d567c50c4b 100644 (file)
@@ -99,65 +99,6 @@ void PartSet_MenuMgr::onAction(bool isChecked)
   }
 }
 
-/// Returns point of coincidence feature
-/// \param theFeature the coincidence feature
-/// \param theAttribute the attribute name
-std::shared_ptr<GeomAPI_Pnt2d> getPoint(std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                        const std::string& theAttribute)
-{
-  std::shared_ptr<GeomDataAPI_Point2D> aPointAttr;
-
-  if (!theFeature->data())
-    return std::shared_ptr<GeomAPI_Pnt2d>();
-
-  FeaturePtr aFeature;
-  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = std::dynamic_pointer_cast<
-      ModelAPI_AttributeRefAttr>(theFeature->data()->attribute(theAttribute));
-  if (anAttr)
-    aFeature = ModelAPI_Feature::feature(anAttr->object());
-
-  if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID())
-    aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-        aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
-
-  else if (anAttr->attr()) {
-    aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttr->attr());
-  }
-  if (aPointAttr.get() != NULL)
-    return aPointAttr->pnt();
-  return std::shared_ptr<GeomAPI_Pnt2d>();
-}
-
-/// Returns list of features connected in a councedence feature point
-/// \param theStartCoin the coincidence feature
-/// \param theList a list which collects lines features
-/// \param theAttr the attribute name
-void findCoincidences(FeaturePtr theStartCoin, QList<FeaturePtr>& theList, std::string theAttr)
-{
-  AttributeRefAttrPtr aPnt = theStartCoin->refattr(theAttr);
-  FeaturePtr aObj = ModelAPI_Feature::feature(aPnt->object());
-  if (!theList.contains(aObj)) {
-    std::shared_ptr<GeomAPI_Pnt2d> aOrig = getPoint(theStartCoin, theAttr);
-    if (aOrig.get() == NULL)
-      return;
-    theList.append(aObj);
-    const std::set<AttributePtr>& aRefsList = aObj->data()->refsToMe();
-    std::set<AttributePtr>::const_iterator aIt;
-    for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
-      std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
-      FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
-      if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { 
-        std::shared_ptr<GeomAPI_Pnt2d> aPnt = getPoint(aConstrFeature, theAttr);
-        if (aPnt.get() && aOrig->isEqual(aPnt)) {
-          findCoincidences(aConstrFeature, theList, SketchPlugin_ConstraintCoincidence::ENTITY_A());
-          findCoincidences(aConstrFeature, theList, SketchPlugin_ConstraintCoincidence::ENTITY_B());
-        }
-      }
-    }
-  }
-}
-
-
 bool PartSet_MenuMgr::addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const
 {
   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
@@ -211,12 +152,13 @@ bool PartSet_MenuMgr::addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*
           FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
           if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { 
             std::shared_ptr<GeomAPI_Pnt2d> a2dPnt = 
-              getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A());
+              PartSet_Tools::getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A());
             if (a2dPnt.get() && aSelPnt->isEqual(a2dPnt)) { 
               aCoincident = aConstrFeature;
               break;
             } else {
-              a2dPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
+              a2dPnt = PartSet_Tools::getPoint(aConstrFeature,
+                                               SketchPlugin_ConstraintCoincidence::ENTITY_B());
               if (a2dPnt.get() && aSelPnt->isEqual(a2dPnt)) { 
                 aCoincident = aConstrFeature;
                 break;
@@ -227,8 +169,10 @@ bool PartSet_MenuMgr::addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*
         // If we have coincidence then add Detach menu
         if (aCoincident.get() != NULL) {
           mySelectedFeature = aCoincident;
-          findCoincidences(mySelectedFeature, myCoinsideLines, SketchPlugin_ConstraintCoincidence::ENTITY_A());
-          findCoincidences(mySelectedFeature, myCoinsideLines, SketchPlugin_ConstraintCoincidence::ENTITY_B());
+          PartSet_Tools::findCoincidences(mySelectedFeature, myCoinsideLines,
+                                          SketchPlugin_ConstraintCoincidence::ENTITY_A());
+          PartSet_Tools::findCoincidences(mySelectedFeature, myCoinsideLines,
+                                          SketchPlugin_ConstraintCoincidence::ENTITY_B());
           if (myCoinsideLines.size() > 0) {
             aIsDetach = true;
             QMenu* aSubMenu = theMenu->addMenu(tr("Detach"));
@@ -294,9 +238,11 @@ void PartSet_MenuMgr::onLineDetach(QAction* theAction)
 {
   int aId = theAction->data().toInt();
   FeaturePtr aLine = myCoinsideLines.at(aId);
-  std::shared_ptr<GeomAPI_Pnt2d> aOrig = getPoint(mySelectedFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A());
+  std::shared_ptr<GeomAPI_Pnt2d> aOrig = PartSet_Tools::getPoint(mySelectedFeature,
+                                                        SketchPlugin_ConstraintCoincidence::ENTITY_A());
   if (aOrig.get() == NULL)
-    aOrig = getPoint(mySelectedFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
+    aOrig = PartSet_Tools::getPoint(mySelectedFeature,
+                                    SketchPlugin_ConstraintCoincidence::ENTITY_B());
   
   gp_Pnt aOr = aOrig->impl<gp_Pnt>();
   const std::set<AttributePtr>& aRefsList = aLine->data()->refsToMe();
@@ -308,16 +254,19 @@ void PartSet_MenuMgr::onLineDetach(QAction* theAction)
     std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
     FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
     if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { 
-      std::shared_ptr<GeomAPI_Pnt2d> aPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A());
+      std::shared_ptr<GeomAPI_Pnt2d> aPnt = PartSet_Tools::getPoint(aConstrFeature,
+                                            SketchPlugin_ConstraintCoincidence::ENTITY_A());
       if (aPnt.get() == NULL)
-        aPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
+        aPnt = PartSet_Tools::getPoint(aConstrFeature,
+                                       SketchPlugin_ConstraintCoincidence::ENTITY_B());
       if (aPnt.get() == NULL)
         return;
       gp_Pnt aP = aPnt->impl<gp_Pnt>();
       if (aOrig->isEqual(aPnt)) {
         aToDelFeatures.append(aConstrFeature);
       } else {
-        aPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
+        aPnt = PartSet_Tools::getPoint(aConstrFeature,
+                                       SketchPlugin_ConstraintCoincidence::ENTITY_B());
         aP = aPnt->impl<gp_Pnt>();
         if (aOrig->isEqual(aPnt)) {
           aToDelFeatures.append(aConstrFeature);
index 0ea84ee283cb821bf2bb941df7413fb57c6a4c6f..9559e6bb5d7d74c9016dcae054f9bc466391242b 100644 (file)
@@ -194,6 +194,8 @@ void PartSet_Module::registerValidators()
   aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
   aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
 
+  aFactory->registerValidator("PartSet_CoincidentAttr", new PartSet_CoincidentAttr);
+
   aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType);
   aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
 
index 843bda304937888fdec9104674ca0f3bd1e7a897..33e7601a82e748e4c809ed9646708d3fc296547b 100644 (file)
@@ -701,6 +701,58 @@ GeomShapePtr PartSet_Tools::findShapeBy2DPoint(const AttributePtr& theAttribute,
   return aShape;
 }
 
+std::shared_ptr<GeomAPI_Pnt2d> PartSet_Tools::getPoint(std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                       const std::string& theAttribute)
+{
+  std::shared_ptr<GeomDataAPI_Point2D> aPointAttr;
+
+  if (!theFeature->data())
+    return std::shared_ptr<GeomAPI_Pnt2d>();
+
+  FeaturePtr aFeature;
+  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = std::dynamic_pointer_cast<
+      ModelAPI_AttributeRefAttr>(theFeature->data()->attribute(theAttribute));
+  if (anAttr)
+    aFeature = ModelAPI_Feature::feature(anAttr->object());
+
+  if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID())
+    aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+        aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
+
+  else if (anAttr->attr()) {
+    aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttr->attr());
+  }
+  if (aPointAttr.get() != NULL)
+    return aPointAttr->pnt();
+  return std::shared_ptr<GeomAPI_Pnt2d>();
+}
+
+void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList<FeaturePtr>& theList,
+                                     std::string theAttr)
+{
+  AttributeRefAttrPtr aPnt = theStartCoin->refattr(theAttr);
+  FeaturePtr aObj = ModelAPI_Feature::feature(aPnt->object());
+  if (!theList.contains(aObj)) {
+    std::shared_ptr<GeomAPI_Pnt2d> aOrig = getPoint(theStartCoin, theAttr);
+    if (aOrig.get() == NULL)
+      return;
+    theList.append(aObj);
+    const std::set<AttributePtr>& aRefsList = aObj->data()->refsToMe();
+    std::set<AttributePtr>::const_iterator aIt;
+    for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
+      std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
+      FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
+      if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { 
+        std::shared_ptr<GeomAPI_Pnt2d> aPnt = getPoint(aConstrFeature, theAttr);
+        if (aPnt.get() && aOrig->isEqual(aPnt)) {
+          findCoincidences(aConstrFeature, theList, SketchPlugin_ConstraintCoincidence::ENTITY_A());
+          findCoincidences(aConstrFeature, theList, SketchPlugin_ConstraintCoincidence::ENTITY_B());
+        }
+      }
+    }
+  }
+}
+
 AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, 
                                                    const TopoDS_Shape theShape, 
                                                    FeaturePtr theSketch)
index 54c8b8978d7da3147079e4af7deb427de268f16d..c113b832aeb3f24bec19989f54f443b38d016b06 100644 (file)
@@ -217,6 +217,22 @@ class PARTSET_EXPORT PartSet_Tools
   static GeomShapePtr findShapeBy2DPoint(const AttributePtr& theAttribute,
                                          ModuleBase_IWorkshop* theWorkshop);
 
+  /* Returns point of coincidence feature
+  * \param theFeature the coincidence feature
+  * \param theAttribute the attribute name
+  */
+  static std::shared_ptr<GeomAPI_Pnt2d> getPoint(std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                                 const std::string& theAttribute);
+
+  /**
+  * Returns list of features connected in a councedence feature point
+  * \param theStartCoin the coincidence feature
+  * \param theList a list which collects lines features
+  * \param theAttr the attribute name
+  */
+  static void findCoincidences(FeaturePtr theStartCoin, QList<FeaturePtr>& theList,
+                               std::string theAttr);
+
 protected:
   /// Returns an object that is under the mouse point. Firstly it checks the highlighting,
   /// if it exists, the first object is returned. Secondly, there is an iteration on
index 1e0f79b2f75dfc882b3ab6b4470234d8e7a93345..36606361e985b666f2598f202dad6cab3816ddff 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "PartSet_Validators.h"
 
+#include "PartSet_Tools.h"
+
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 #include <BRep_Tool.hxx>
@@ -23,6 +25,8 @@
 #include <ModelAPI_Session.h>
 
 #include <SketchPlugin_Sketch.h>
+#include <SketchPlugin_ConstraintCoincidence.h>
+#include <SketchPlugin_Arc.h>
 #include <GeomAPI_Edge.h>
 
 #include <list>
@@ -395,3 +399,63 @@ bool PartSet_SameTypeAttrValidator::isValid(
   return false;
 }
 
+bool PartSet_CoincidentAttr::isValid(
+  const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+{
+  // there is a check whether the feature contains a point and a linear edge or two point values
+  std::string aParamA = theArguments.front();
+  SessionPtr aMgr = ModelAPI_Session::get();
+  ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
+
+  FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
+  AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+  if (!aRefAttr)
+    return false;
+
+  QList<FeaturePtr> aCoinsideLines;
+
+  bool isObject = aRefAttr->isObject();
+  ObjectPtr anObject = aRefAttr->object();
+  if (isObject && anObject) {
+    FeaturePtr aRefFea = ModelAPI_Feature::feature(anObject);
+    AttributeRefAttrPtr aOtherAttr = aFeature->data()->refattr(aParamA);
+    ObjectPtr aOtherObject = aOtherAttr->object();
+    // if the other attribute is not filled still, the result is true
+    if (!aOtherObject.get())
+      return true;
+    FeaturePtr aOtherFea = ModelAPI_Feature::feature(aOtherObject);
+
+    // check that both have coincidence
+    FeaturePtr aConstrFeature;
+    std::set<FeaturePtr> aCoinList;
+    const std::set<std::shared_ptr<ModelAPI_Attribute>>& aRefsList = aRefFea->data()->refsToMe();
+    std::set<std::shared_ptr<ModelAPI_Attribute>>::const_iterator aIt;
+    for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
+      std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
+      aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
+      if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
+        AttributeRefAttrPtr aRAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aAttr);
+        AttributePtr aAR = aRAttr->attr();
+        if (aAR->id() != SketchPlugin_Arc::CENTER_ID()) // ignore constraint to center of arc
+          aCoinList.insert(aConstrFeature);
+          PartSet_Tools::findCoincidences(aConstrFeature, aCoinsideLines,
+                                          SketchPlugin_ConstraintCoincidence::ENTITY_A());
+          PartSet_Tools::findCoincidences(aConstrFeature, aCoinsideLines,
+                                          SketchPlugin_ConstraintCoincidence::ENTITY_B());
+      }
+    }
+    // if there is no coincidence then it is not valid
+    if (aCoinList.size() == 0)
+      return false;
+
+    QList<FeaturePtr>::const_iterator anIt = aCoinsideLines.begin(), aLast = aCoinsideLines.end();
+    bool aValid = false;
+    for (; anIt != aLast && !aValid; anIt++) {
+      aValid = *anIt == aOtherFea;
+    }
+    if (aValid)
+      return true;
+  }
+  return false;
+}
+
index 92eb3a71df2bc9413b52c7d926f7f042c4d8c67a..38d693db99af830dd6766f93fdab0b76831654ac 100644 (file)
@@ -151,5 +151,20 @@ class PartSet_SameTypeAttrValidator : public ModelAPI_AttributeValidator
                        const std::list<std::string>& theArguments) const;
 };
 
+/**\class PartSet_CoincidentAttr
+ * \ingroup Validators
+ * \brief Validator to check whether there is a coincident constraint between
+ * the attribute and attribute of argument.
+ */
+class PartSet_CoincidentAttr : public ModelAPI_AttributeValidator
+{
+ public:
+  //! returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments) const;
+};
+
 
 #endif
index 4e29b3bfc08b11ac6d5b47f7bd921f8ae9fcc7d2..7742fa5c10c94fd84a6fbbc853cbf94d2a7b1a22 100644 (file)
@@ -57,8 +57,6 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
                               new SketchPlugin_ExternalValidator);
   aFactory->registerValidator("SketchPlugin_TangentAttr",
                               new SketchPlugin_TangentAttrValidator);
-  aFactory->registerValidator("SketchPlugin_CoincidentAttr",
-                              new SketchPlugin_CoincidentAttr);
   aFactory->registerValidator("SketchPlugin_NotFixed",
                               new SketchPlugin_NotFixedValidator);
   aFactory->registerValidator("SketchPlugin_EqualAttr",
index 40cfd995dd5857aeedcd912945173d2baa79a5c0..2af4de2e15f64df05b512be9ef9456108e26c99f 100644 (file)
@@ -78,67 +78,6 @@ bool SketchPlugin_DistanceAttrValidator::isValid(
   return false;
 }
 
-bool SketchPlugin_CoincidentAttr::isValid(
-  const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
-{
-  // there is a check whether the feature contains a point and a linear edge or two point values
-  std::string aParamA = theArguments.front();
-  SessionPtr aMgr = ModelAPI_Session::get();
-  ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
-
-  FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
-  AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
-  if (!aRefAttr)
-    return false;
-
-  bool isObject = aRefAttr->isObject();
-  ObjectPtr anObject = aRefAttr->object();
-  if (isObject && anObject) {
-    FeaturePtr aRefFea = ModelAPI_Feature::feature(anObject);
-    AttributeRefAttrPtr aOtherAttr = aFeature->data()->refattr(aParamA);
-    ObjectPtr aOtherObject = aOtherAttr->object();
-    // if the other attribute is not filled still, the result is true
-    if (!aOtherObject.get())
-      return true;
-    FeaturePtr aOtherFea = ModelAPI_Feature::feature(aOtherObject);
-
-    // check that both have coincidence
-    FeaturePtr aConstrFeature;
-    std::set<FeaturePtr> aCoinList;
-    const std::set<std::shared_ptr<ModelAPI_Attribute>>& aRefsList = aRefFea->data()->refsToMe();
-    std::set<std::shared_ptr<ModelAPI_Attribute>>::const_iterator aIt;
-    for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
-      std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
-      aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
-      if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
-        AttributeRefAttrPtr aRAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aAttr);
-        AttributePtr aAR = aRAttr->attr();
-        if (aAR->id() != SketchPlugin_Arc::CENTER_ID()) // ignore constraint to center of arc
-          aCoinList.insert(aConstrFeature);
-      }
-    }
-    // if there is no coincidence then it is not valid
-    if (aCoinList.size() == 0)
-      return false;
-
-    // find that coincedence is the same
-    const std::set<std::shared_ptr<ModelAPI_Attribute>>& aOtherList = aOtherFea->data()->refsToMe();
-    std::set<FeaturePtr>::const_iterator aCoinsIt;
-    for (aIt = aOtherList.cbegin(); aIt != aOtherList.cend(); ++aIt) {
-      std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
-      aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
-      aCoinsIt = aCoinList.find(aConstrFeature);
-      if (aCoinsIt != aCoinList.end()) {
-        AttributeRefAttrPtr aRAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aAttr);
-        AttributePtr aAR = aRAttr->attr();
-        if (aAR->id() != SketchPlugin_Arc::CENTER_ID())
-          return true;
-      }
-    }
-  }
-  return false;
-}
-
 bool SketchPlugin_TangentAttrValidator::isValid(
   const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
 {
index 6b1f29c0a12d1dbeab534f88a74610b639927849..24d79c1b47b36faeb1daa4be22fcb631d1d99d86 100644 (file)
@@ -26,21 +26,6 @@ class SketchPlugin_DistanceAttrValidator : public ModelAPI_AttributeValidator
                        const std::list<std::string>& theArguments) const;
 };
 
-/**\class SketchPlugin_CoincidentAttr
- * \ingroup Validators
- * \brief Validator to check whether there is a coincident constraint between
- * the attribute and attribute of argument.
- */
-class SketchPlugin_CoincidentAttr : public ModelAPI_AttributeValidator
-{
- public:
-  //! returns true if attribute is valid
-  //! \param theAttribute the checked attribute
-  //! \param theArguments arguments of the attribute
-  virtual bool isValid(const AttributePtr& theAttribute,
-                       const std::list<std::string>& theArguments) const;
-};
-
 /**\class SketchPlugin_TangentAttrValidator
  * \ingroup Validators
  * \brief Validator for the tangent constraint input.
index 626ec3089ea0219e799e66fa394f1cc564d47ce2..ed807cd230c84fda84ccb6a89a66d4e62088e9cc 100644 (file)
       <feature id="SketchConstraintTangent" title="Tangent" tooltip="Create constraint defining tangency of two objects" icon=":icons/tangent.png">
         <sketch_shape_selector id="ConstraintEntityA" 
             label="First object" tooltip="Select line or arc" shape_types="edge">
-          <validator id="SketchPlugin_CoincidentAttr" parameters="ConstraintEntityB"/>
+          <validator id="PartSet_CoincidentAttr" parameters="ConstraintEntityB"/>
           <validator id="PartSet_DifferentObjects"/>
         </sketch_shape_selector>
         
         <sketch_shape_selector id="ConstraintEntityB"
             label="Second object" tooltip="Select line or arc" shape_types="edge">
-          <validator id="SketchPlugin_CoincidentAttr" parameters="ConstraintEntityA"/>
+          <validator id="PartSet_CoincidentAttr" parameters="ConstraintEntityA"/>
           <validator id="SketchPlugin_TangentAttr" parameters="ConstraintEntityA"/>
           <validator id="PartSet_DifferentObjects"/>
         </sketch_shape_selector>
         <sketch_shape_selector id="ConstraintEntityA" 
             label="First object" tooltip="Select line or arc" shape_types="edge">
           <validator id="PartSet_DifferentObjects"/>
-          <validator id="SketchPlugin_CoincidentAttr" parameters="ConstraintEntityB"/>
+          <validator id="PartSet_CoincidentAttr" parameters="ConstraintEntityB"/>
         </sketch_shape_selector>
 
         <sketch_shape_selector id="ConstraintEntityB"
             label="Second object" tooltip="Select line or arc" shape_types="edge">
           <validator id="PartSet_DifferentObjects"/>
-          <validator id="SketchPlugin_CoincidentAttr" parameters="ConstraintEntityA"/>
+          <validator id="PartSet_CoincidentAttr" parameters="ConstraintEntityA"/>
         </sketch_shape_selector>
 
         <doublevalue label="Value" tooltip="Fillet radius" id="ConstraintValue" min="0" default="1" use_reset="false">