Salome HOME
Rigid constraint should process selection of vertex, lines and circles. So, a new...
authornds <natalia.donis@opencascade.com>
Wed, 29 Apr 2015 16:59:49 +0000 (19:59 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 29 Apr 2015 16:59:49 +0000 (19:59 +0300)
src/GeomValidators/CMakeLists.txt
src/GeomValidators/GeomValidators_Edge.cpp [deleted file]
src/GeomValidators/GeomValidators_Edge.h [deleted file]
src/GeomValidators/GeomValidators_EdgeOrVertex.cpp [deleted file]
src/GeomValidators/GeomValidators_EdgeOrVertex.h [deleted file]
src/GeomValidators/GeomValidators_ShapeType.cpp [new file with mode: 0644]
src/GeomValidators/GeomValidators_ShapeType.h [new file with mode: 0644]
src/PartSet/PartSet_Module.cpp
src/SketchPlugin/SketchPlugin_Validators.cpp
src/SketchPlugin/plugin-Sketch.xml

index 3a07a17cbbf265f6c6f072ceb97ada89bbcfea0c..fda2411f42b9727627719ea32702dd588a28a6bd 100644 (file)
@@ -5,19 +5,17 @@ INCLUDE(Common)
 SET(PROJECT_HEADERS
     GeomValidators.h
     GeomValidators_ConstructionComposite.h
-    GeomValidators_Edge.h
-    GeomValidators_EdgeOrVertex.h
     GeomValidators_Face.h
     GeomValidators_Positive.h
+    GeomValidators_ShapeType.h
     GeomValidators_Tools.h
 )
 
 SET(PROJECT_SOURCES
     GeomValidators_ConstructionComposite.cpp
-    GeomValidators_Edge.cpp
-    GeomValidators_EdgeOrVertex.cpp
     GeomValidators_Face.cpp
     GeomValidators_Positive.cpp
+    GeomValidators_ShapeType.cpp
     GeomValidators_Tools.cpp
 )
 
diff --git a/src/GeomValidators/GeomValidators_Edge.cpp b/src/GeomValidators/GeomValidators_Edge.cpp
deleted file mode 100644 (file)
index 0518f4a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-
-#include "GeomValidators_Edge.h"
-#include "GeomValidators_Tools.h"
-
-#include <GeomAPI_Curve.h>
-#include <Events_Error.h>
-#include <ModelAPI_Result.h>
-
-#include <StdSelect_TypeOfEdge.hxx>
-
-#include <string>
-#include <map>
-
-
-typedef std::map<std::string, GeomValidators_Edge::TypeOfEdge> EdgeTypes;
-static EdgeTypes MyEdgeTypes;
-
-GeomValidators_Edge::TypeOfEdge GeomValidators_Edge::edgeType(const std::string& theType)
-{
-  if (MyEdgeTypes.size() == 0) {
-    MyEdgeTypes["line"] = Line;
-    MyEdgeTypes["circle"] = Circle;
-  }
-  std::string aType = std::string(theType.c_str());
-  if (MyEdgeTypes.find(aType) != MyEdgeTypes.end())
-    return MyEdgeTypes[aType];
-  
-  Events_Error::send("Edge type defined in XML is not implemented!");
-  return AnyEdge;
-}
-
-bool GeomValidators_Edge::isValid(const AttributePtr& theAttribute,
-                                  const std::list<std::string>& theArguments) const
-{
-  bool aValid = false;
-
-  TypeOfEdge anEdgeType = AnyEdge;
-  if (theArguments.size() == 1) {
-    std::string anArgument = theArguments.front();
-    anEdgeType = edgeType(anArgument);
-  }
-
-  ObjectPtr anObject = GeomValidators_Tools::getObject(theAttribute);
-  if (anObject.get() != NULL) {
-    FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
-    ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
-    if (aResult.get() != NULL) {
-      GeomShapePtr aShape = aResult->shape();
-      if (aShape.get() != NULL && aShape->isEdge()) {
-        aValid = anEdgeType == AnyEdge;
-        if (!aValid) {
-          bool isCircle = GeomAPI_Curve(aShape).isCircle();
-          aValid = (isCircle && anEdgeType == Circle) ||
-                   (!isCircle && anEdgeType == Line);
-        }
-      }
-    }
-  }
-  else {
-    //AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
-  }
-  return aValid;
-}
diff --git a/src/GeomValidators/GeomValidators_Edge.h b/src/GeomValidators/GeomValidators_Edge.h
deleted file mode 100644 (file)
index 5b29a82..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        GeomValidators_Edge.h
-// Created:     19 Mar 2015
-// Author:      Natalia ERMOLAEVA
-
-#ifndef GeomValidators_Edge_H
-#define GeomValidators_Edge_H
-
-#include "GeomValidators.h"
-#include "ModelAPI_AttributeValidator.h"
-
-#include <string>
-
-/**
-* \ingroup Validators
-* A validator of selection
-*/
-class GeomValidators_Edge : public ModelAPI_AttributeValidator
-{
- public:
-  //  the edge type
-  enum TypeOfEdge
-  {
-    AnyEdge,
-    Line,
-    Circle
-  };
-
- public:
-   GEOMVALIDATORS_EXPORT GeomValidators_Edge() {}
-  //! returns true if attribute is valid
-  //! \param theAttribute the checked attribute
-  //! \param theArguments arguments of the attribute
-  GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
-                                             const std::list<std::string>& theArguments) const;
-protected:
-  /// Convert string to TypeOfEdge value
-  /// \param theType a string value
-  static TypeOfEdge edgeType(const std::string& theType);
-};
-
-#endif
diff --git a/src/GeomValidators/GeomValidators_EdgeOrVertex.cpp b/src/GeomValidators/GeomValidators_EdgeOrVertex.cpp
deleted file mode 100644 (file)
index cfd78c9..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-
-#include "GeomValidators_EdgeOrVertex.h"
-#include "GeomValidators_Tools.h"
-#include "GeomValidators_Edge.h"
-
-#include "ModelAPI_AttributeRefAttr.h"
-#include "ModelAPI_Result.h"
-
-#include <ModelAPI_Session.h>
-
-#include <GeomAPI_Curve.h>
-#include <GeomDataAPI_Point2D.h>
-
-#include <Events_Error.h>
-
-#include <StdSelect_TypeOfEdge.hxx>
-
-#include <QString>
-#include <QMap>
-
-
-bool GeomValidators_EdgeOrVertex::isValid(const AttributePtr& theAttribute,
-                                          const std::list<std::string>& theArguments) const
-{
-  bool aValid = false;
-
-  // 1. check whether the attribute is a linear edge
-    // there is a check whether the feature contains a point and a linear edge or two point values
-  SessionPtr aMgr = ModelAPI_Session::get();
-  ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
-
-  const GeomValidators_Edge* aLinearEdgeValidator =
-    dynamic_cast<const GeomValidators_Edge*>(aFactory->validator("GeomValidators_Edge"));
-
-  std::list<std::string> anArguments;
-  anArguments.push_back("line");
-  aValid = aLinearEdgeValidator->isValid(theAttribute, anArguments);
-  if (!aValid) {
-    //2. check whether the attribute is a vertex
-    ObjectPtr anObject = GeomValidators_Tools::getObject(theAttribute);
-    if (anObject.get() != NULL) {
-      FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
-      ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
-      if (aResult.get() != NULL) {
-        GeomShapePtr aShape = aResult->shape();
-        if (aShape.get() != NULL) {
-          aValid = aShape->isVertex();
-        }
-      }
-    }
-    else {
-      AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
-      if (anAttr.get() != NULL) {
-        AttributePtr aRefAttr = anAttr->attr();
-        aValid = aRefAttr.get() != NULL && aRefAttr->attributeType() == GeomDataAPI_Point2D::typeId();
-      }
-    }
-  }
-  return aValid;
-}
diff --git a/src/GeomValidators/GeomValidators_EdgeOrVertex.h b/src/GeomValidators/GeomValidators_EdgeOrVertex.h
deleted file mode 100644 (file)
index 52b7add..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        GeomValidators_EdgeOrVertex.h
-// Created:     19 Mar 2015
-// Author:      Natalia ERMOLAEVA
-
-#ifndef GeomValidators_EdgeOrVertex_H
-#define GeomValidators_EdgeOrVertex_H
-
-#include "GeomValidators.h"
-#include "ModelAPI_AttributeValidator.h"
-
-#include <StdSelect_TypeOfEdge.hxx>
-
-/**
-* \ingroup Validators
-* A validator of selection
-*/
-class GeomValidators_EdgeOrVertex : public ModelAPI_AttributeValidator
-{
- public:
-   GEOMVALIDATORS_EXPORT GeomValidators_EdgeOrVertex() {}
-  //! returns true if attribute is valid
-  //! \param theAttribute the checked attribute
-  //! \param theArguments arguments of the attribute
-  GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
-                                             const std::list<std::string>& theArguments) const;
-};
-
-#endif
diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp
new file mode 100644 (file)
index 0000000..f5ce2fd
--- /dev/null
@@ -0,0 +1,90 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+
+#include "GeomValidators_ShapeType.h"
+#include "GeomValidators_Tools.h"
+
+#include <GeomAPI_Curve.h>
+#include <GeomDataAPI_Point2D.h>
+
+#include <ModelAPI_Result.h>
+#include "ModelAPI_AttributeRefAttr.h"
+
+#include <Events_Error.h>
+
+#include <string>
+#include <map>
+
+
+typedef std::map<std::string, GeomValidators_ShapeType::TypeOfShape> EdgeTypes;
+static EdgeTypes MyEdgeTypes;
+
+GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const std::string& theType)
+{
+  if (MyEdgeTypes.size() == 0) {
+    MyEdgeTypes["vertex"] = Vertex;
+    MyEdgeTypes["line"]   = Line;
+    MyEdgeTypes["circle"] = Circle;
+  }
+  std::string aType = std::string(theType.c_str());
+  if (MyEdgeTypes.find(aType) != MyEdgeTypes.end())
+    return MyEdgeTypes[aType];
+  
+  Events_Error::send("Edge type defined in XML is not implemented!");
+  return AnyShape;
+}
+
+bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute,
+                                       const std::list<std::string>& theArguments) const
+{
+  bool aValid = false;
+
+  std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
+  for (; anIt != aLast && !aValid; anIt++) {
+    aValid = isValidArgument(theAttribute, *anIt);
+  }
+
+  return aValid;
+}
+
+bool GeomValidators_ShapeType::isValidArgument(const AttributePtr& theAttribute,
+                                               const std::string& theArgument) const
+{
+  bool aValid = false;
+  TypeOfShape aShapeType = shapeType(theArgument);
+  if (aShapeType == AnyShape)
+    return true;
+
+  ObjectPtr anObject = GeomValidators_Tools::getObject(theAttribute);
+  if (anObject.get() != NULL) {
+    FeaturePtr aFeature = ModelAPI_Feature::feature(anObject);
+    ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
+    if (aResult.get() != NULL) {
+      GeomShapePtr aShape = aResult->shape();
+      if (aShape.get() != NULL) {
+        switch (aShapeType) {
+          case Line:
+            aValid = aShape->isEdge() && !GeomAPI_Curve(aShape).isCircle();
+          break;
+          case Circle:
+            aValid = aShape->isEdge() && GeomAPI_Curve(aShape).isCircle();
+          break;
+          case Vertex:
+            aValid = aShape->isVertex();
+          break;
+          default: break;
+        }
+      }
+    }
+  }
+  else {
+    AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+    if (anAttr.get() != NULL) {
+      if (aShapeType == Vertex) {
+        AttributePtr aRefAttr = anAttr->attr();
+        aValid = aRefAttr.get() != NULL && aRefAttr->attributeType() == GeomDataAPI_Point2D::typeId();
+      }
+    }
+  }
+  return aValid;
+}
diff --git a/src/GeomValidators/GeomValidators_ShapeType.h b/src/GeomValidators/GeomValidators_ShapeType.h
new file mode 100644 (file)
index 0000000..ce3232d
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        GeomValidators_ShapeType.h
+// Created:     19 Mar 2015
+// Author:      Natalia ERMOLAEVA
+
+#ifndef GeomValidators_ShapeType_H
+#define GeomValidators_ShapeType_H
+
+#include "GeomValidators.h"
+#include "ModelAPI_AttributeValidator.h"
+
+#include <string>
+
+/**
+* \ingroup Validators
+* A validator for shape types, such as vertex, line, circe or arc.
+* If there are some argument parameters, this validator returns true if the attribute satisfied
+* at least one argument (OR combination of arguments).
+*/
+class GeomValidators_ShapeType : public ModelAPI_AttributeValidator
+{
+ public:
+  //  the edge type
+  enum TypeOfShape
+  {
+    AnyShape,
+    Vertex,
+    Line,
+    Circle
+  };
+
+ public:
+   GEOMVALIDATORS_EXPORT GeomValidators_ShapeType() {}
+  //! returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
+                                             const std::list<std::string>& theArguments) const;
+protected:
+  /// Convert string to TypeOfShape value
+  /// \param theType a string value
+  static TypeOfShape shapeType(const std::string& theType);
+
+  bool isValidArgument(const AttributePtr& theAttribute,
+                       const std::string& theArgument) const;
+
+};
+
+#endif
index 7ae10661d5419ea8383b7787ebe790db8746ea76..684d940715c9131a473a9219a4620dbca23ba301 100644 (file)
@@ -18,8 +18,7 @@
 #include <ModuleBase_IPropertyPanel.h>
 #include <ModuleBase_WidgetEditor.h>
 #include <ModuleBase_FilterFactory.h>
-#include <GeomValidators_Edge.h>
-#include <GeomValidators_EdgeOrVertex.h>
+#include <GeomValidators_ShapeType.h>
 #include <GeomValidators_Face.h>
 #include <GeomValidators_ConstructionComposite.h>
 
@@ -138,9 +137,7 @@ void PartSet_Module::registerValidators()
   aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
   aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
 
-  aFactory->registerValidator("GeomValidators_Edge", new GeomValidators_Edge);
-  aFactory->registerValidator("GeomValidators_EdgeOrVertex",
-                              new GeomValidators_EdgeOrVertex);
+  aFactory->registerValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType);
   aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
 
   aFactory->registerValidator("GeomValidators_ConstructionComposite",
index 68857aa2623b8687ddeb06fb4aa5709950f87096..9dfdb517155a23638c3f2808b20bcf96365c0cda 100644 (file)
@@ -23,7 +23,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Session.h>
 
-#include <GeomValidators_Edge.h>
+#include <GeomValidators_ShapeType.h>
 
 #include <GeomDataAPI_Point2D.h>
 
@@ -48,20 +48,20 @@ bool SketchPlugin_DistanceAttrValidator::isValid(
     // 1. check whether the references object is a linear
     ObjectPtr anObject = aRefAttr->object();
 
-    const ModelAPI_AttributeValidator* anEdgeValidator = 
-      dynamic_cast<const GeomValidators_Edge*>(aFactory->validator("GeomValidators_Edge"));
+    const ModelAPI_AttributeValidator* aShapeValidator = 
+      dynamic_cast<const GeomValidators_ShapeType*>(aFactory->validator("GeomValidators_ShapeType"));
     std::list<std::string> anArguments;
     anArguments.push_back("circle");
-    bool anEdgeValid = anEdgeValidator->isValid(aRefAttr, anArguments);
+    bool aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments);
     // the circle line is not a valid case
-    if (anEdgeValid)
+    if (aShapeValid)
       return false;
       
     anArguments.clear();
     anArguments.push_back("line");
-    anEdgeValid = anEdgeValidator->isValid(aRefAttr, anArguments);
+    aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments);
     // if the attribute value is not a line, that means it is a vertex. A vertex is always valid
-    if (!anEdgeValid)
+    if (!aShapeValid)
       return true;
 
     FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
index 8fe582a60b816534580f73e40f225606755c4a8d..e42c826c89a811a2c2319cca2a2fc908fb77b1ab 100644 (file)
@@ -54,7 +54,7 @@
               shape_types="edge vertex">
           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
           <validator id="PartSet_DifferentObjects"/>
-          <validator id="GeomValidators_EdgeOrVertex"/>
+          <validator id="GeomValidators_ShapeType" parameters="vertex,line"/>
         </sketch_shape_selector>/>
         <sketch_shape_selector 
           id="ConstraintEntityB" 
@@ -64,7 +64,7 @@
           <validator id="PartSet_DifferentObjects"/>
           <validator id="SketchPlugin_DistanceAttr" parameters="ConstraintEntityA"/>
           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
-          <validator id="GeomValidators_EdgeOrVertex"/>
+          <validator id="GeomValidators_ShapeType" parameters="vertex,line"/>
         </sketch_shape_selector>
         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt"  default="computed" internal="1" obligatory="0"/>
         
@@ -80,7 +80,7 @@
         <label title="Select a line on which to calculate length" tooltip="Select a line on which to calculate length"/>
         <shape_selector id="ConstraintEntityA" label="Line" tooltip="Select an line" 
             shape_types="edge" >
-        <validator id="GeomValidators_Edge" parameters="line"/>
+        <validator id="GeomValidators_ShapeType" parameters="line"/>
     </shape_selector>
         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" default="computed" internal="1" obligatory="0"/>
         <doublevalue_editor label="Value" tooltip="Length" id="ConstraintValue" default="computed">
@@ -94,7 +94,7 @@
         <label title="Select a circle or an arc on which to calculate radius" tooltip="Select a circle or an arc on which to calculate radius"/>
         <shape_selector id="ConstraintEntityA" label="Circle or Arc" tooltip="Select a circle or an arc" 
             shape_types="edge">
-            <validator id="GeomValidators_Edge" parameters="circle"/>
+            <validator id="GeomValidators_ShapeType" parameters="circle"/>
         </shape_selector>
         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt"  default="computed" internal="1" obligatory="0"/>
         <doublevalue_editor label="Value" tooltip="Radius" id="ConstraintValue" default="computed"/>
       <feature id="SketchConstraintParallel" title="Parallel" tooltip="Create constraint defining two parallel lines" icon=":icons/parallel.png">
         <sketch_shape_selector id="ConstraintEntityA" 
             label="First line" tooltip="Select a line" shape_types="edge">
-          <validator id="GeomValidators_Edge" parameters="line"/>
+          <validator id="GeomValidators_ShapeType" parameters="line"/>
           <validator id="PartSet_DifferentObjects"/>
           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
         </sketch_shape_selector>
         
         <sketch_shape_selector id="ConstraintEntityB" label="Second line" tooltip="Select a line" 
             shape_types="edge">
-            <validator id="GeomValidators_Edge" parameters="line"/>
+            <validator id="GeomValidators_ShapeType" parameters="line"/>
             <validator id="PartSet_DifferentObjects"/>
             <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
         </sketch_shape_selector>
             shape_types="edge">
           <validator id="PartSet_DifferentObjects"/>
           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
-            <validator id="GeomValidators_Edge" parameters="line"/>
+            <validator id="GeomValidators_ShapeType" parameters="line"/>
         </sketch_shape_selector>
         
         <sketch_shape_selector id="ConstraintEntityB" 
             shape_types="edge">
             <validator id="PartSet_DifferentObjects"/>
           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
-            <validator id="GeomValidators_Edge" parameters="line"/>
+            <validator id="GeomValidators_ShapeType" parameters="line"/>
         </sketch_shape_selector>
         <validator id="PartSet_PerpendicularSelection"/>
       </feature>
         <sketch_shape_selector id="ConstraintEntityA" label="Object"
                         tooltip="Select point, line end point, line, center of circle or arc."
                         shape_types="edge vertex">
-          <!--<validator id="PartSet_SketchEntityValidator" parameters="SketchPoint,SketchLine,SketchCircle,SketchArc"/>-->
-          <validator id="GeomValidators_EdgeOrVertex"/>
+          <validator id="GeomValidators_ShapeType" parameters="vertex,line,circle"/>
           <validator id="SketchPlugin_NotFixed"/>
         </sketch_shape_selector>
         <validator id="PartSet_RigidSelection"/>
       <feature id="SketchConstraintHorizontal" title="Horizontal" tooltip="Create constraint defining horizontal line" icon=":icons/horisontal.png">
         <sketch_shape_selector id="ConstraintEntityA" 
             label="Line" tooltip="Select a line" shape_types="edge" use_external="false">
-            <validator id="GeomValidators_Edge" parameters="line"/>
+            <validator id="GeomValidators_ShapeType" parameters="line"/>
         </sketch_shape_selector>
         <validator id="PartSet_HVDirSelection"/>
       </feature>
       <feature id="SketchConstraintVertical" title="Vertical" tooltip="Create constraint defining vertical line" icon=":icons/vertical.png">
         <sketch_shape_selector id="ConstraintEntityA" 
             label="Line" tooltip="Select a line" shape_types="edge" use_external="false">
-            <validator id="GeomValidators_Edge" parameters="line"/>
+            <validator id="GeomValidators_ShapeType" parameters="line"/>
         </sketch_shape_selector>
         <validator id="PartSet_HVDirSelection"/>
       </feature>
         tooltip="Create constraint, mirroring group of objects">
         <sketch_shape_selector id="ConstraintEntityA"
             label="Mirror line" tooltip="Select mirror line" shape_types="edge">
-            <validator id="GeomValidators_Edge" parameters="line"/>
+            <validator id="GeomValidators_ShapeType" parameters="line"/>
         </sketch_shape_selector>
         <sketch_multi_selector id="ConstraintMirrorList"
             label="List of objects"