icon=":icons/point.png"
tooltip="Select a first point"
shape_types="vertex">
- <validator id="ModuleBase_ValidatorNoConstructionSubShapes"/>
+ <validator id="GeomValidators_ConstructionComposite"/>
</shape_selector>
<shape_selector id="SecondPoint"
label="Second point"
icon=":icons/point.png"
tooltip="Select a second point"
shape_types="vertex">
- <validator id="ModuleBase_ValidatorNoConstructionSubShapes"/>
+ <validator id="GeomValidators_ConstructionComposite"/>
<validator id="PartSet_DifferentShapes"/>
</shape_selector>
</box>
label="Plane face"
tooltip="Select a planar face"
shape_types="face">
- <validator id="ModuleBase_ValidatorFace" parameters="plane"/>
+ <validator id="GeomValidators_Face" parameters="plane"/>
</shape_selector>
<doublevalue id="distance"
label="Distance"
SET(PROJECT_HEADERS
GeomValidators.h
+ GeomValidators_ConstructionComposite.h
+ GeomValidators_Edge.h
+ GeomValidators_EdgeOrVertex.h
+ GeomValidators_Face.h
GeomValidators_Positive.h
+ GeomValidators_Tools.h
)
SET(PROJECT_SOURCES
+ GeomValidators_ConstructionComposite.cpp
+ GeomValidators_Edge.cpp
+ GeomValidators_EdgeOrVertex.cpp
+ GeomValidators_Face.cpp
GeomValidators_Positive.cpp
+ GeomValidators_Tools.cpp
)
SET(PROJECT_LIBRARIES
ModelAPI
- Events
+ Events
+ GeomAPI
)
-ADD_DEFINITIONS(-DGEOMVALIDATORS_EXPORTS)
+ADD_DEFINITIONS(-DGEOMVALIDATORS_EXPORTS ${CAS_DEFINITIONS})
ADD_LIBRARY(GeomValidators SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
TARGET_LINK_LIBRARIES(GeomValidators ${PROJECT_LIBRARIES})
INCLUDE_DIRECTORIES(
- ../ModelAPI
- ../Events
+ ${CAS_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/src/ModelAPI
+ ${CMAKE_SOURCE_DIR}/src/Events
+ ${CMAKE_SOURCE_DIR}/src/GeomAPI
+ ${CMAKE_SOURCE_DIR}/src/GeomDataAPI
)
INSTALL(TARGETS GeomValidators DESTINATION plugins)
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#include "GeomValidators_ConstructionComposite.h"
+
+#include "ModelAPI_AttributeSelection.h"
+#include "ModelAPI_ResultConstruction.h"
+#include "ModelAPI_CompositeFeature.h"
+
+bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments) const
+{
+ bool aValid = false;
+ AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
+ (theAttribute);
+ if (aSelectionAttr.get() == NULL)
+ return aValid;
+
+ ResultPtr aResult = aSelectionAttr->context();
+ GeomShapePtr aShape = aSelectionAttr->value();
+ // global selection should be ignored, the filter processes only selected sub-shapes
+ // that means, that the shape of the context result is equal to the shape value
+ ///*ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
+ if (aResult.get() != NULL) {
+ GeomShapePtr aShapePtr = aResult->shape();
+ // it is important to call isEqual of the shape of result.
+ // It is a GeomAPI_Vertex shape for the point. The shape of the parameter is
+ // GeomAPI_Shape. It is important to use the realization of the isEqual method from
+ // GeomAPI_Vertex class
+ aValid = aShapePtr.get() != NULL && aShapePtr->isEqual(aShape);
+ }
+ if (!aValid) {
+ ResultConstructionPtr aConstr =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
+ if (aConstr != NULL) {
+ // it provides selection only on compositie features, construction without composite
+ // feature is not selectable
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aConstr);
+ CompositeFeaturePtr aComposite =
+ std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
+ aValid = aComposite && aComposite->numberOfSubs() > 0;
+ }
+ else {
+ // non-construction results should be accepted by this filter, e.g. body results
+ aValid = true;
+ }
+ }
+ return aValid;
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomValidators_ConstructionComposite.h
+// Created: 20 Mar 2015
+// Author: Natalia ERMOLAEVA
+
+#ifndef GeomValidators_ConstructionComposite_H
+#define GeomValidators_ConstructionComposite_H
+
+#include "GeomValidators.h"
+#include "ModelAPI_AttributeValidator.h"
+
+/**
+* \ingroup Validators
+* A validator of selection
+*/
+class GeomValidators_ConstructionComposite : public ModelAPI_AttributeValidator
+{
+ public:
+ GEOMVALIDATORS_EXPORT GeomValidators_ConstructionComposite() {}
+ //! 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
--- /dev/null
+// 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;
+}
--- /dev/null
+// 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
--- /dev/null
+// 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::type();
+ }
+ }
+ }
+ return aValid;
+}
--- /dev/null
+// 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
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+
+#include "GeomValidators_Face.h"
+#include "GeomValidators_Tools.h"
+
+#include "ModelAPI_AttributeSelection.h"
+
+#include <GeomAPI_Face.h>
+
+#include <Events_Error.h>
+
+#include <QString>
+#include <QMap>
+
+typedef std::map<std::string, GeomAbs_SurfaceType> FaceTypes;
+static FaceTypes MyFaceTypes;
+
+GeomAbs_SurfaceType GeomValidators_Face::faceType(const std::string& theType)
+{
+ if (MyFaceTypes.size() == 0) {
+ MyFaceTypes["plane"] = GeomAbs_Plane;
+ MyFaceTypes["cylinder"] = GeomAbs_Cylinder;
+ }
+ std::string aType = std::string(theType.c_str());
+ if (MyFaceTypes.find(aType) != MyFaceTypes.end())
+ return MyFaceTypes[aType];
+
+ Events_Error::send("Face type defined in XML is not implemented!");
+ return GeomAbs_Plane;
+}
+
+bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments) const
+{
+ bool aValid = false;
+
+ GeomAbs_SurfaceType aFaceType = GeomAbs_Plane;
+ if (theArguments.size() == 1) {
+ std::string anArgument = theArguments.front();
+ aFaceType = faceType(anArgument);
+ }
+
+ ObjectPtr anObject = GeomValidators_Tools::getObject(theAttribute);
+ if (anObject.get() != NULL) {
+ AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
+ (theAttribute);
+ std::shared_ptr<GeomAPI_Shape> aGeomShape = aSelectionAttr->value();
+ std::shared_ptr<GeomAPI_Face> aGeomFace(new GeomAPI_Face(aGeomShape));
+ if (aGeomFace.get() != NULL) {
+ switch(aFaceType) {
+ case GeomAbs_Plane:
+ aValid = aGeomFace->isPlanar();
+ break;
+ case GeomAbs_Cylinder:
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return aValid;
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomValidators_Face.h
+// Created: 20 Mar 2015
+// Author: Natalia ERMOLAEVA
+
+#ifndef GeomValidators_Face_H
+#define GeomValidators_Face_H
+
+#include "GeomValidators.h"
+#include "ModelAPI_AttributeValidator.h"
+
+#include <GeomAbs_SurfaceType.hxx>
+
+/**
+* \ingroup Validators
+* A validator of selection
+*/
+class GeomValidators_Face : public ModelAPI_AttributeValidator
+{
+ public:
+ GEOMVALIDATORS_EXPORT GeomValidators_Face() {}
+ //! 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 TypeOfFace value
+ /// \param theType a string value
+ GEOMVALIDATORS_EXPORT static GeomAbs_SurfaceType faceType(const std::string& theType);
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomValidators_Tools.cpp
+// Created: 06 Aug 2014
+// Author: Vitaly Smetannikov
+
+#include "GeomValidators_Tools.h"
+
+#include "ModelAPI_AttributeRefAttr.h"
+#include "ModelAPI_AttributeSelection.h"
+#include "ModelAPI_AttributeReference.h"
+
+namespace GeomValidators_Tools {
+
+ ObjectPtr getObject(const AttributePtr& theAttribute)
+ {
+ ObjectPtr anObject;
+ std::string anAttrType = theAttribute->attributeType();
+ if (anAttrType == ModelAPI_AttributeRefAttr::type()) {
+ AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+ if (anAttr != NULL && anAttr->isObject())
+ anObject = anAttr->object();
+ }
+ if (anAttrType == ModelAPI_AttributeSelection::type()) {
+ AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ if (anAttr != NULL && anAttr->isInitialized())
+ anObject = anAttr->context();
+ }
+ if (anAttrType == ModelAPI_AttributeReference::type()) {
+ AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
+ if (anAttr.get() != NULL && anAttr->isInitialized())
+ anObject = anAttr->value();
+ }
+ return anObject;
+ }
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomValidators_Tools.h
+// Created: 23 Mar 2015
+// Author: Natalia ERMOLAEVA
+
+#ifndef GeomValidators_Tools_HeaderFile
+#define GeomValidators_Tools_HeaderFile
+
+#include "GeomValidators.h"
+#include "ModelAPI_Object.h"
+#include "ModelAPI_Attribute.h"
+
+
+namespace GeomValidators_Tools
+{
+ // Returns the object from the attribute
+ /// \param theObj an object
+ GEOMVALIDATORS_EXPORT ObjectPtr getObject(const AttributePtr& theAttribute);
+
+};
+
+#endif
ModuleBase_IViewer.h
ModuleBase_WidgetLineEdit.h
ModuleBase_WidgetMultiSelector.h
- ModuleBase_ValidatorFace.h
- ModuleBase_ValidatorLinearEdge.h
- ModuleBase_ValidatorLinearEdgeOrVertex.h
- ModuleBase_ValidatorNoConstructionSubShapes.h
ModuleBase_ViewerFilters.h
ModuleBase_ResultPrs.h
ModuleBase_IViewWindow.h
ModuleBase_DoubleSpinBox.cpp
ModuleBase_WidgetLineEdit.cpp
ModuleBase_WidgetMultiSelector.cpp
- ModuleBase_ValidatorFace.cpp
- ModuleBase_ValidatorLinearEdge.cpp
- ModuleBase_ValidatorLinearEdgeOrVertex.cpp
- ModuleBase_ValidatorNoConstructionSubShapes.cpp
ModuleBase_ViewerFilters.cpp
ModuleBase_ResultPrs.cpp
ModuleBase_WidgetLabel.cpp
ModelAPI
GeomAPI
GeomAlgoAPI
+ GeomValidators
${QT_LIBRARIES}
${CAS_VIEWER}
${CAS_KERNEL}
${CMAKE_SOURCE_DIR}/src/GeomDataAPI
${CMAKE_SOURCE_DIR}/src/GeomAPI
${CMAKE_SOURCE_DIR}/src/GeomAlgoAPI
+ ${CMAKE_SOURCE_DIR}/src/GeomValidators
${SUIT_INCLUDE}
)
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-
-#include "ModuleBase_ValidatorFace.h"
-#include "ModuleBase_WidgetShapeSelector.h"
-
-#include "ModelAPI_AttributeSelection.h"
-
-#include <GeomAPI_Face.h>
-
-#include <Events_Error.h>
-
-#include <QString>
-#include <QMap>
-
-typedef QMap<QString, GeomAbs_SurfaceType> FaceTypes;
-static FaceTypes MyFaceTypes;
-
-GeomAbs_SurfaceType ModuleBase_ValidatorFace::faceType(const std::string& theType)
-{
- if (MyFaceTypes.count() == 0) {
- MyFaceTypes["plane"] = GeomAbs_Plane;
- MyFaceTypes["cylinder"] = GeomAbs_Cylinder;
- }
- QString aType = QString(theType.c_str()).toLower();
- if (MyFaceTypes.contains(aType))
- return MyFaceTypes[aType];
-
- Events_Error::send("Face type defined in XML is not implemented!");
- return GeomAbs_Plane;
-}
-
-bool ModuleBase_ValidatorFace::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
-{
- bool aValid = false;
-
- GeomAbs_SurfaceType aFaceType = GeomAbs_Plane;
- if (theArguments.size() == 1) {
- std::string anArgument = theArguments.front();
- aFaceType = faceType(anArgument);
- }
-
- ObjectPtr anObject = ModuleBase_WidgetShapeSelector::getObject(theAttribute);
- if (anObject.get() != NULL) {
- AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
- (theAttribute);
- std::shared_ptr<GeomAPI_Shape> aGeomShape = aSelectionAttr->value();
- std::shared_ptr<GeomAPI_Face> aGeomFace(new GeomAPI_Face(aGeomShape));
- if (aGeomFace.get() != NULL) {
- switch(aFaceType) {
- case GeomAbs_Plane:
- aValid = aGeomFace->isPlanar();
- break;
- case GeomAbs_Cylinder:
- break;
- default:
- break;
- }
- }
- }
- return aValid;
-}
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: ModuleBase_ValidatorFace.h
-// Created: 20 Mar 2015
-// Author: Natalia ERMOLAEVA
-
-#ifndef ModuleBase_ValidatorFace_H
-#define ModuleBase_ValidatorFace_H
-
-#include "ModuleBase.h"
-#include "ModelAPI_AttributeValidator.h"
-
-#include <GeomAbs_SurfaceType.hxx>
-
-/**
-* \ingroup Validators
-* A validator of selection
-*/
-class ModuleBase_ValidatorFace : public ModelAPI_AttributeValidator
-{
- public:
- MODULEBASE_EXPORT ModuleBase_ValidatorFace() {}
- //! returns true if attribute is valid
- //! \param theAttribute the checked attribute
- //! \param theArguments arguments of the attribute
- MODULEBASE_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
-protected:
- /// Convert string to TypeOfFace value
- /// \param theType a string value
- static GeomAbs_SurfaceType faceType(const std::string& theType);
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-
-#include "ModuleBase_ValidatorLinearEdge.h"
-#include "ModuleBase_WidgetShapeSelector.h"
-
-#include <GeomAPI_Curve.h>
-
-#include <Events_Error.h>
-
-#include <StdSelect_TypeOfEdge.hxx>
-
-#include <QString>
-#include <QMap>
-
-
-typedef QMap<QString, ModuleBase_ValidatorLinearEdge::TypeOfEdge> EdgeTypes;
-static EdgeTypes MyEdgeTypes;
-
-ModuleBase_ValidatorLinearEdge::TypeOfEdge ModuleBase_ValidatorLinearEdge::edgeType(const std::string& theType)
-{
- if (MyEdgeTypes.count() == 0) {
- MyEdgeTypes["line"] = Line;
- MyEdgeTypes["circle"] = Circle;
- }
- QString aType = QString(theType.c_str()).toLower();
- if (MyEdgeTypes.contains(aType))
- return MyEdgeTypes[aType];
-
- Events_Error::send("Edge type defined in XML is not implemented!");
- return AnyEdge;
-}
-
-bool ModuleBase_ValidatorLinearEdge::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 = ModuleBase_WidgetShapeSelector::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;
-}
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: ModuleBase_ValidatorLinearEdge.h
-// Created: 19 Mar 2015
-// Author: Natalia ERMOLAEVA
-
-#ifndef ModuleBase_ValidatorLinearEdge_H
-#define ModuleBase_ValidatorLinearEdge_H
-
-#include "ModuleBase.h"
-#include "ModelAPI_AttributeValidator.h"
-
-/**
-* \ingroup Validators
-* A validator of selection
-*/
-class ModuleBase_ValidatorLinearEdge : public ModelAPI_AttributeValidator
-{
- public:
- // the edge type
- enum TypeOfEdge
- {
- AnyEdge,
- Line,
- Circle
- };
-
- public:
- MODULEBASE_EXPORT ModuleBase_ValidatorLinearEdge() {}
- //! returns true if attribute is valid
- //! \param theAttribute the checked attribute
- //! \param theArguments arguments of the attribute
- MODULEBASE_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
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-
-#include "ModuleBase_ValidatorLinearEdgeOrVertex.h"
-#include "ModuleBase_WidgetShapeSelector.h"
-#include "ModuleBase_ValidatorLinearEdge.h"
-
-#include "ModelAPI_AttributeRefAttr.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 ModuleBase_ValidatorLinearEdgeOrVertex::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 ModuleBase_ValidatorLinearEdge* aLinearEdgeValidator =
- dynamic_cast<const ModuleBase_ValidatorLinearEdge*>(aFactory->validator("ModuleBase_ValidatorLinearEdge"));
-
- 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 = ModuleBase_WidgetShapeSelector::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::type();
- }
- }
- }
- return aValid;
-}
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: ModuleBase_ValidatorLinearEdgeOrVertex.h
-// Created: 19 Mar 2015
-// Author: Natalia ERMOLAEVA
-
-#ifndef ModuleBase_ValidatorLinearEdgeOrVertex_H
-#define ModuleBase_ValidatorLinearEdgeOrVertex_H
-
-#include "ModuleBase.h"
-#include "ModelAPI_AttributeValidator.h"
-
-#include <StdSelect_TypeOfEdge.hxx>
-
-/**
-* \ingroup Validators
-* A validator of selection
-*/
-class ModuleBase_ValidatorLinearEdgeOrVertex : public ModelAPI_AttributeValidator
-{
- public:
- MODULEBASE_EXPORT ModuleBase_ValidatorLinearEdgeOrVertex() {}
- //! returns true if attribute is valid
- //! \param theAttribute the checked attribute
- //! \param theArguments arguments of the attribute
- MODULEBASE_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-#include "ModuleBase_ValidatorNoConstructionSubShapes.h"
-
-#include "ModelAPI_AttributeSelection.h"
-#include "ModelAPI_ResultConstruction.h"
-#include "ModelAPI_CompositeFeature.h"
-
-bool ModuleBase_ValidatorNoConstructionSubShapes::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
-{
- bool aValid = false;
- AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
- (theAttribute);
- if (aSelectionAttr.get() == NULL)
- return aValid;
-
- ResultPtr aResult = aSelectionAttr->context();
- GeomShapePtr aShape = aSelectionAttr->value();
- // global selection should be ignored, the filter processes only selected sub-shapes
- // that means, that the shape of the context result is equal to the shape value
- ///*ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
- if (aResult.get() != NULL) {
- GeomShapePtr aShapePtr = aResult->shape();
- // it is important to call isEqual of the shape of result.
- // It is a GeomAPI_Vertex shape for the point. The shape of the parameter is
- // GeomAPI_Shape. It is important to use the realization of the isEqual method from
- // GeomAPI_Vertex class
- aValid = aShapePtr.get() != NULL && aShapePtr->isEqual(aShape);
- }
- if (!aValid) {
- ResultConstructionPtr aConstr =
- std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
- if (aConstr != NULL) {
- // it provides selection only on compositie features, construction without composite
- // feature is not selectable
- FeaturePtr aFeature = ModelAPI_Feature::feature(aConstr);
- CompositeFeaturePtr aComposite =
- std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
- aValid = aComposite && aComposite->numberOfSubs() > 0;
- }
- else {
- // non-construction results should be accepted by this filter, e.g. body results
- aValid = true;
- }
- }
- return aValid;
-}
+++ /dev/null
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: ModuleBase_ValidatorNoConstructionSubShapes.h
-// Created: 20 Mar 2015
-// Author: Natalia ERMOLAEVA
-
-#ifndef ModuleBase_ValidatorNoConstructionSubShapes_H
-#define ModuleBase_ValidatorNoConstructionSubShapes_H
-
-#include "ModuleBase.h"
-#include "ModelAPI_AttributeValidator.h"
-
-/**
-* \ingroup Validators
-* A validator of selection
-*/
-class ModuleBase_ValidatorNoConstructionSubShapes : public ModelAPI_AttributeValidator
-{
- public:
- MODULEBASE_EXPORT ModuleBase_ValidatorNoConstructionSubShapes() {}
- //! returns true if attribute is valid
- //! \param theAttribute the checked attribute
- //! \param theArguments arguments of the attribute
- MODULEBASE_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
-};
-
-#endif
#include <Events_Message.h>
#include <GeomAPI_Interface.h>
#include <GeomAPI_Shape.h>
+#include <GeomValidators_Tools.h>
#include <ModelAPI_AttributeReference.h>
#include <ModelAPI_Data.h>
return false;
}
-ObjectPtr ModuleBase_WidgetShapeSelector::getObject(const AttributePtr& theAttribute)
-{
- ObjectPtr anObject;
- std::string anAttrType = theAttribute->attributeType();
- if (anAttrType == ModelAPI_AttributeRefAttr::type()) {
- AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
- if (anAttr != NULL && anAttr->isObject())
- anObject = anAttr->object();
- }
- if (anAttrType == ModelAPI_AttributeSelection::type()) {
- AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
- if (anAttr != NULL && anAttr->isInitialized())
- anObject = anAttr->context();
- }
- if (anAttrType == ModelAPI_AttributeReference::type()) {
- AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
- if (anAttr.get() != NULL && anAttr->isInitialized())
- anObject = anAttr->value();
- }
- return anObject;
-}
-
-
//********************************************************************
GeomShapePtr ModuleBase_WidgetShapeSelector::getShape() const
{
isNameUpdated = true;
}
if (!isNameUpdated) {
- ObjectPtr anObject = getObject(myFeature->attribute(attributeID()));
+ ObjectPtr anObject = GeomValidators_Tools::getObject(myFeature->attribute(attributeID()));
if (anObject.get() != NULL) {
std::string aName = anObject->data()->name();
myTextLine->setText(QString::fromStdString(aName));
AttributePtr anAttribute = myFeature->attribute(attributeID());
if (isBackup) {
- myObject = getObject(anAttribute);
+ myObject = GeomValidators_Tools::getObject(anAttribute);
myShape = getShape();
myRefAttribute = NULL;
myIsObject = false;
ModuleBase_ViewerPrs aPrs;
myWorkshop->selection()->fillPresentation(aPrs, theOwner);
ObjectPtr aObject = aPrs.object();
- ObjectPtr aCurrentObject = getObject(myFeature->attribute(attributeID()));
+ ObjectPtr aCurrentObject = GeomValidators_Tools::getObject(myFeature->attribute(attributeID()));
if ((!aCurrentObject) && (!aObject))
return false;
/// The methiod called when widget is deactivated
virtual void deactivate();
- // Get the object from the attribute
- /// \param theObj an object
- static ObjectPtr getObject(const AttributePtr& theAttribute);
-
public slots:
/// Activate or deactivate selection
ModuleBase
Config
GeomAPI
+ GeomValidators
${QT_LIBRARIES}
${CAS_KERNEL}
${CAS_SHAPE}
${CMAKE_SOURCE_DIR}/src/SketchPlugin
${CMAKE_SOURCE_DIR}/src/FeaturesPlugin
${CMAKE_SOURCE_DIR}/src/GeomAPI
+ ${CMAKE_SOURCE_DIR}/src/GeomValidators
${CMAKE_SOURCE_DIR}/src/AppElements
${CAS_INCLUDE_DIRS}
${SUIT_INCLUDE}
#include <ModuleBase_FilterMulti.h>
#include <ModuleBase_FilterCustom.h>
#include <ModuleBase_FilterNoConsructionSubShapes.h>
-#include <ModuleBase_ValidatorLinearEdge.h>
-#include <ModuleBase_ValidatorLinearEdgeOrVertex.h>
-#include <ModuleBase_ValidatorFace.h>
-#include <ModuleBase_ValidatorNoConstructionSubShapes.h>
+#include <GeomValidators_Edge.h>
+#include <GeomValidators_EdgeOrVertex.h>
+#include <GeomValidators_Face.h>
+#include <GeomValidators_ConstructionComposite.h>
#include <PartSet_FilterSketchEntity.h>
aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
- aFactory->registerValidator("ModuleBase_ValidatorLinearEdge", new ModuleBase_ValidatorLinearEdge);
- aFactory->registerValidator("ModuleBase_ValidatorLinearEdgeOrVertex",
- new ModuleBase_ValidatorLinearEdgeOrVertex);
- aFactory->registerValidator("ModuleBase_ValidatorFace", new ModuleBase_ValidatorFace);
+ aFactory->registerValidator("GeomValidators_Edge", new GeomValidators_Edge);
+ aFactory->registerValidator("GeomValidators_EdgeOrVertex",
+ new GeomValidators_EdgeOrVertex);
+ aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
- aFactory->registerValidator("ModuleBase_ValidatorNoConstructionSubShapes",
- new ModuleBase_ValidatorNoConstructionSubShapes);
+ aFactory->registerValidator("GeomValidators_ConstructionComposite",
+ new GeomValidators_ConstructionComposite);
aFactory->registerValidator("PartSet_SketchEntityValidator",
new PartSet_SketchEntityValidator);
#include <BRep_Tool.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAbs_CurveType.hxx>
+#include <GeomValidators_Tools.h>
#include <ModuleBase_ISelection.h>
#include <ModuleBase_WidgetShapeSelector.h>
// 1. check whether the object of the attribute is not among the feature attributes
// find the attribute's object
- ObjectPtr anObject = ModuleBase_WidgetShapeSelector::getObject(theAttribute);
+ ObjectPtr anObject = GeomValidators_Tools::getObject(theAttribute);
// check whether the object is not among other feature attributes
if (anObject.get() != NULL) {
// the function parameter attribute should be skipped
if (anAttr.get() == NULL || anAttr->id() == theAttribute->id())
continue;
- ObjectPtr aCurObject = ModuleBase_WidgetShapeSelector::getObject(anAttr);
+ ObjectPtr aCurObject = GeomValidators_Tools::getObject(anAttr);
if (aCurObject && aCurObject == anObject)
return false;
}
Config
GeomAPI
GeomAlgoAPI
+ GeomValidators
ModelAPI
SketcherPrs
${CAS_KERNEL}
../GeomAPI
../GeomAlgoAPI
../GeomDataAPI
+ ../GeomValidators
../SketcherPrs
)
#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_Session.h>
-//#include <ModuleBase_ValidatorLinearEdge.h>
+#include <GeomValidators_Edge.h>
#include <GeomDataAPI_Point2D.h>
} else {
// 1. check whether the references object is a linear
ObjectPtr anObject = aRefAttr->object();
- /*
- const ModelAPI_AttributeValidator* aCircleValidator =
- dynamic_cast<ModuleBase_ValidatorLinearEdge*>(aFactory->validator("ModuleBase_ValidatorLinearEdge"));
+
+ const ModelAPI_AttributeValidator* anEdgeValidator =
+ dynamic_cast<const GeomValidators_Edge*>(aFactory->validator("GeomValidators_Edge"));
std::list<std::string> anArguments;
anArguments.push_back("circle");
- bool anEdgeValid = aCircleValidator->isValid(aRefAttr, anArguments);
+ bool anEdgeValid = anEdgeValidator->isValid(aRefAttr, anArguments);
+ // the circle line is not a valid case
if (anEdgeValid)
return false;
anArguments.clear();
anArguments.push_back("line");
- bool anEdgeValid = aCircleValidator->isValid(aRefAttr, anArguments);
+ anEdgeValid = anEdgeValidator->isValid(aRefAttr, anArguments);
+ // if the attribute value is not a line, that means it is a vertex. A vertex is always valid
if (!anEdgeValid)
- return true;*/
-
- /*const ModelAPI_ResultValidator* anArcValidator = aFactory->validator("ModuleBase_ValidatorLinearEdge");
- //dynamic_cast<const ModelAPI_ResultValidator*>(aFactory->validator("SketchPlugin_ResultArc"));
- bool anArcValid = anArcValidator->isValid(anObject);
- if (anArcValid)
- return false;
-
- // If the object is not a line then it is accepted. It can be a point feature selected
- const ModelAPI_ResultValidator* aLineValidator =
- dynamic_cast<const ModelAPI_ResultValidator*>(aFactory->validator("SketchPlugin_ResultLine"));
- bool aLineValid = aLineValidator->isValid(anObject);
- if (!aLineValid)
- return true;*/
+ return true;
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
// If it is a line then we have to check that first attribute id not a line
}
return false;
}
-
-//bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature,
-// const std::list<std::string>& theArguments,
-// const ObjectPtr& theObject) const
-//{
-// std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
-// theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type());
-// std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
-// for(; anAttr != anAttrs.end(); anAttr++) {
-// if (*anAttr) {
-// std::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-// std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttr);
-// // check the object is already presented
-// if (aRef->isObject() && aRef->object() == theObject)
-// return false;
-// }
-// }
-// return true;
-//}
-
-//bool SketchPlugin_DifferentObjectsValidator::isValid(
-// const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
-//{
-// std::shared_ptr<ModelAPI_AttributeRefAttr> anOrigAttr =
-// std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
-// if (anOrigAttr && anOrigAttr->isObject()) {
-// const ObjectPtr& anObj = theAttribute->owner();
-// const FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anObj);
-//
-// std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
-// aFeature->data()->attributes(ModelAPI_AttributeRefAttr::type());
-// std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
-// for(; anAttr != anAttrs.end(); anAttr++) {
-// if (*anAttr && *anAttr != theAttribute) {
-// std::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-// std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttr);
-// // check the object is already presented
-// if (aRef->isObject() && aRef->object() == anOrigAttr->object())
-// return false;
-// }
-// }
-// }
-// return true;
-//}
-
-//bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature,
-// const std::list<std::string>& theArguments, const AttributePtr& theAttribute) const
-//{
-// std::list<std::shared_ptr<ModelAPI_Attribute> > anAttrs =
-// theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type());
-// std::list<std::shared_ptr<ModelAPI_Attribute> >::iterator anAttr = anAttrs.begin();
-// for(; anAttr != anAttrs.end(); anAttr++) {
-// if (*anAttr) {
-// std::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-// std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anAttr);
-// // check the object is already presented
-// if (!aRef->isObject() && aRef->attr() == theAttribute)
-// return false;
-// }
-// }
-// return true;
-//}
//! 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;
+ virtual bool isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments) const;
};
-/**\class SketchPlugin_DifferentObjectsValidator
- * \ingroup Validators
- *
- * Check that there is no same object was already selected in the feature.
- * For an example: to avoid perpendicularity on line and the same line.
- */
-// Use PartSet_DifferentObjectsValidator
-//class SketchPlugin_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
-//{
-// 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;
-// //! Returns true if object is good for the feature attribute
-// virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-// const ObjectPtr& theObject) const;
-// //! Returns true if the attribute is good for the feature attribute
-// virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-// const AttributePtr& theAttribute) const;
-//};
-
#endif
tooltip="Select point, line end point, line, center of circle or arc."
shape_types="edge vertex">
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
- <validator id="ModuleBase_ValidatorLinearEdgeOrVertex"/>
+ <validator id="GeomValidators_EdgeOrVertex"/>
</sketch_shape_selector>/>
<sketch_shape_selector
id="ConstraintEntityB"
<validator id="PartSet_DifferentObjects"/>
<validator id="SketchPlugin_DistanceAttr" parameters="ConstraintEntityA"/>
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
- <validator id="ModuleBase_ValidatorLinearEdgeOrVertex"/>
+ <validator id="GeomValidators_EdgeOrVertex"/>
</sketch_shape_selector>
<sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" default="computed" internal="1" obligatory="0"/>
<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="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ <validator id="GeomValidators_Edge" 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">
<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="ModuleBase_ValidatorLinearEdge" parameters="circle"/>
+ <validator id="GeomValidators_Edge" 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_constraint_shape_selector id="ConstraintEntityA"
label="First line" tooltip="Select a line" shape_types="edge">
- <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ <validator id="GeomValidators_Edge" parameters="line"/>
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
</sketch_constraint_shape_selector>
<sketch_constraint_shape_selector id="ConstraintEntityB" label="Last line" tooltip="Select a line"
shape_types="edge">
- <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ <validator id="GeomValidators_Edge" parameters="line"/>
<validator id="PartSet_DifferentObjects"/>
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityA"/>
</sketch_constraint_shape_selector>
label="First line" tooltip="Select an line"
shape_types="edge">
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
- <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ <validator id="GeomValidators_Edge" parameters="line"/>
</sketch_constraint_shape_selector>
<sketch_constraint_shape_selector id="ConstraintEntityB"
shape_types="edge">
<validator id="PartSet_DifferentObjects"/>
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityA"/>
- <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ <validator id="GeomValidators_Edge" parameters="line"/>
</sketch_constraint_shape_selector>
<validator id="PartSet_PerpendicularValidator"/>
</feature>
<feature id="SketchConstraintHorizontal" title="Horizontal" tooltip="Create constraint defining horizontal line" icon=":icons/horisontal.png">
<sketch_constraint_shape_selector id="ConstraintEntityA"
label="Line" tooltip="Select a line" shape_types="edge">
- <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ <validator id="GeomValidators_Edge" parameters="line"/>
</sketch_constraint_shape_selector>
</feature>
<!-- SketchConstraintVertical -->
<feature id="SketchConstraintVertical" title="Vertical" tooltip="Create constraint defining vertical line" icon=":icons/vertical.png">
<sketch_constraint_shape_selector id="ConstraintEntityA"
label="Line" tooltip="Select a line" shape_types="edge">
- <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ <validator id="GeomValidators_Edge" parameters="line"/>
</sketch_constraint_shape_selector>
</feature>
<!-- SketchConstraintEqual -->