EdgeFilter and MultiFilter use is replaced by validator.
ModuleBase_IViewer.h
ModuleBase_WidgetLineEdit.h
ModuleBase_WidgetMultiSelector.h
+ ModuleBase_ValidatorLinearEdge.h
+ ModuleBase_ValidatorLinearEdgeOrVertex.h
ModuleBase_ViewerFilters.h
ModuleBase_ResultPrs.h
ModuleBase_IViewWindow.h
ModuleBase_DoubleSpinBox.cpp
ModuleBase_WidgetLineEdit.cpp
ModuleBase_WidgetMultiSelector.cpp
+ ModuleBase_ValidatorLinearEdge.cpp
+ ModuleBase_ValidatorLinearEdgeOrVertex.cpp
ModuleBase_ViewerFilters.cpp
ModuleBase_ResultPrs.cpp
ModuleBase_WidgetLabel.cpp
#include <QList>
+class Handle_SelectMgr_EntityOwner;
+
/**
* \ingroup GUI
* A class which provides access to selection.
/// \return list of presentations
virtual QList<ModuleBase_ViewerPrs> getHighlighted() const = 0;
+ /// Fills the viewer presentation parameters by the parameters from the owner
+ /// \param thePrs a container for selection
+ /// \param theOwner a selection owner
+ virtual void fillPresentation(ModuleBase_ViewerPrs& thePrs,
+ const Handle_SelectMgr_EntityOwner& theOwner) const = 0;
+
/**
* Returns list of features currently selected in object browser
*/
#include <QGridLayout>
+#include <iostream>
+
ModuleBase_PageWidget::ModuleBase_PageWidget(QWidget* theParent)
: QFrame(theParent)
{
--- /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"
+
+#include <StdSelect_TypeOfEdge.hxx>
+
+/**
+* \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 StdSelect_TypeOfFace 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
}
//********************************************************************
-void ModuleBase_WidgetMultiSelector::setSelection(const Handle_SelectMgr_EntityOwner& theOwner)
+bool ModuleBase_WidgetMultiSelector::setSelection(const Handle_SelectMgr_EntityOwner& theOwner)
{
-
+ return false;
}
//********************************************************************
/// The methiod called when widget is deactivated
virtual void deactivate();
+ /// Fills the attribute with the value of the selected owner
+ /// \param theOwner a selected owner
+ virtual bool setSelection(const Handle_SelectMgr_EntityOwner& theOwner);
+
public slots:
/// Slot is called on selection type changed
void onSelectionTypeChanged();
/// to backup, otherwise set the backed up values to the attribute
virtual void backupAttributeValue(const bool isBackup);
- /// Fills the attribute with the value of the selected owner
- /// \param theOwner a selected owner
- virtual void setSelection(const Handle_SelectMgr_EntityOwner& theOwner);
-
/// Set current shape type for selection
void setCurrentShapeType(const TopAbs_ShapeEnum theShapeType);
//QObjectPtrList aObjects = myWorkshop->selection()->selectedPresentations();
QList<ModuleBase_ViewerPrs> aSelected = myWorkshop->selection()->getSelected();
if (aSelected.size() > 0) {
- if (setSelection(aSelected.first()))
+ Handle(SelectMgr_EntityOwner) anOwner = aSelected.first().owner();
+ if (isValid(anOwner)) {
+ setSelection(anOwner);
emit focusOutWidget(this);
+ }
}
}
//********************************************************************
-bool ModuleBase_WidgetShapeSelector::setSelection(ModuleBase_ViewerPrs theValue)
+bool ModuleBase_WidgetShapeSelector::setSelectionPrs(ModuleBase_ViewerPrs theValue)
{
ObjectPtr aObject = theValue.object();
ObjectPtr aCurrentObject = getObject(myFeature->attribute(attributeID()));
aShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
aShape->setImpl(new TopoDS_Shape(theValue.shape()));
}
-
// Check that the selection corresponds to selection type
if (!acceptSubShape(aShape))
return false;
-// if (!acceptObjectShape(aObject))
-// return false;
-
- // Check whether the value is valid for the viewer selection filters
- Handle(SelectMgr_EntityOwner) anOwner = theValue.owner();
- if (!anOwner.IsNull()) {
- SelectMgr_ListOfFilter aFilters;
- selectionFilters(myWorkshop, aFilters);
- SelectMgr_ListIteratorOfListOfFilter aIt(aFilters);
- for (; aIt.More(); aIt.Next()) {
- const Handle(SelectMgr_Filter)& aFilter = aIt.Value();
- if (!aFilter->IsOk(anOwner))
- return false;
- }
- }
- if (isValid(aObject, aShape)) {
- setObject(aObject, aShape);
- return true;
- }
- return false;
+
+ setObject(aObject, aShape);
+ return true;
}
//********************************************************************
void ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape)
{
- if (storeAttributeValues(theObj, theShape))
- updateObject(myFeature);
-
- if (theObj) {
- raisePanel();
- }
- updateSelectionName();
- emit valuesChanged();
+ //if (
+ storeAttributeValues(theObj, theShape);//)
+ // updateObject(myFeature);
+
+ //if (theObj) {
+ // raisePanel();
+ //}
+ //updateSelectionName();
+ //emit valuesChanged();
}
//********************************************************************
std::string aName = anObject->data()->name();
myTextLine->setText(QString::fromStdString(aName));
} else {
- if (myIsActive) {
+ AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
+ if (aRefAttr && aRefAttr->attr().get() != NULL) {
+ //myIsObject = aRefAttr->isObject();
+ AttributePtr anAttr = aRefAttr->attr();
+ if (anAttr.get() != NULL) {
+ std::stringstream aName;
+ aName <<anAttr->owner()->data()->name()<<"/"<<anAttr->id();
+ myTextLine->setText(QString::fromStdString(aName.str()));
+ }
+ }
+ else if (myIsActive) {
myTextLine->setText("");
}
}
storeAttributeValues(myObject, myShape);
AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
if (aRefAttr) {
- if (myIsObject)
- aRefAttr->setObject(myObject);
- else
+ if (!myIsObject)
aRefAttr->setAttr(myRefAttribute);
}
}
}
//********************************************************************
-void ModuleBase_WidgetShapeSelector::setSelection(const Handle_SelectMgr_EntityOwner& theOwner)
+bool ModuleBase_WidgetShapeSelector::setSelection(const Handle_SelectMgr_EntityOwner& theOwner)
{
-
+ bool isDone = false;
+ //QList<ModuleBase_ViewerPrs> aSelected = myWorkshop->selection()->getSelected();
+ //if (aSelected.size() > 0) {
+ ModuleBase_ViewerPrs aPrs;
+ myWorkshop->selection()->fillPresentation(aPrs, theOwner);
+ isDone = setSelectionPrs(aPrs);
+ //}
+ return isDone;
}
//********************************************************************
}
//********************************************************************
-bool ModuleBase_WidgetShapeSelector::isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape)
+/*bool ModuleBase_WidgetShapeSelector::isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape)
{
bool isValid = ModuleBase_WidgetValidated::isValid(theObj, theShape);
if (!isValid)
// 5. enable the model's update
aData->blockSendAttributeUpdated(false);
return aValid;
-}
+}*/
#include "ModuleBase.h"
#include "ModuleBase_WidgetValidated.h"
#include "ModuleBase_ViewerFilters.h"
+#include <ModuleBase_ViewerPrs.h>
#include <ModelAPI_Object.h>
#include <ModelAPI_Attribute.h>
/// Set the given wrapped value to the current widget
/// This value should be processed in the widget according to the needs
/// \param theValue the wrapped widget value
- virtual bool setSelection(ModuleBase_ViewerPrs theValue);
+ virtual bool setSelectionPrs(ModuleBase_ViewerPrs theValue);
+
+ /// Fills the attribute with the value of the selected owner
+ /// \param theOwner a selected owner
+ virtual bool setSelection(const Handle_SelectMgr_EntityOwner& theOwner);
/// The methiod called when widget is deactivated
virtual void deactivate();
/// to backup, otherwise set the backed up values to the attribute
virtual void backupAttributeValue(const bool isBackup);
- /// Fills the attribute with the value of the selected owner
- /// \param theOwner a selected owner
- virtual void setSelection(const Handle_SelectMgr_EntityOwner& theOwner);
-
/// Computes and updates name of selected object in the widget
void updateSelectionName();
/// Check the selected with validators if installed
/// \param theObj the object for checking
/// \param theShape the shape for checking
- virtual bool isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape);
+ //virtual bool isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape);
/// Clear attribute
void clearAttribute();
{
}
+bool ModuleBase_WidgetValidated::setSelection(ModuleBase_ViewerPrs theValue)
+{
+ bool isDone = false;
+
+ Handle(SelectMgr_EntityOwner) anOwner = theValue.owner();
+ if (isValid(anOwner)) {
+ //storeAttributeValue(anOwner);
+ setSelection(anOwner);
+ updateObject(myFeature);
+ //isDone = setSelection(anOwner);
+ emit valuesChanged();
+ }
+ return isDone;
+}
+
bool ModuleBase_WidgetValidated::isValid(const Handle_SelectMgr_EntityOwner& theOwner)
{
backupAttributeValue(true);
const bool toActivate) const
{
ModuleBase_IViewer* aViewer = theWorkshop->viewer();
-/*
+
Handle(SelectMgr_Filter) aSelFilter = theWorkshop->validatorFilter();
if (toActivate)
aViewer->addSelectionFilter(aSelFilter);
else
aViewer->removeSelectionFilter(aSelFilter);
-*/
+/*
// apply filters loaded from the XML definition of the widget
ModuleBase_FilterFactory* aFactory = theWorkshop->selectionFilters();
SelectMgr_ListOfFilter aFactoryFilters;
aViewer->addSelectionFilter(aSelFilter);
else
aViewer->removeSelectionFilter(aSelFilter);
- }
+ }*/
}
void ModuleBase_WidgetValidated::selectionFilters(ModuleBase_IWorkshop* theWorkshop,
/// \return a boolean value
bool isValid(const Handle_SelectMgr_EntityOwner& theOwner);
+ /// Set the given wrapped value to the current widget
+ /// This value should be processed in the widget according to the needs
+ /// \param theValue the wrapped widget value
+ virtual bool setSelection(ModuleBase_ViewerPrs theValue);
+
protected:
/// Creates a backup of the current values of the attribute
/// It should be realized in the specific widget because of different
/// Fills the attribute with the value of the selected owner
/// \param theOwner a selected owner
- virtual void setSelection(const Handle_SelectMgr_EntityOwner& theOwner) = 0;
+ virtual bool setSelection(const Handle_SelectMgr_EntityOwner& theOwner) = 0;
/// Checks the current attibute in all attribute validators
// \return true if all validators return that the attribute is valid
#include <ModuleBase_FilterMulti.h>
#include <ModuleBase_FilterCustom.h>
#include <ModuleBase_FilterNoConsructionSubShapes.h>
+#include <ModuleBase_ValidatorLinearEdge.h>
+#include <ModuleBase_ValidatorLinearEdgeOrVertex.h>
+
#include <PartSet_FilterSketchEntity.h>
#include <ModelAPI_Object.h>
aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
aFactory->registerValidator("PartSet_SketchValidator", new PartSet_SketchValidator);
+
+ aFactory->registerValidator("ModuleBase_ValidatorLinearEdge", new ModuleBase_ValidatorLinearEdge);
+ aFactory->registerValidator("ModuleBase_ValidatorLinearEdgeOrVertex",
+ new ModuleBase_ValidatorLinearEdgeOrVertex);
}
void PartSet_Module::registerFilters()
return false;
std::shared_ptr<SketchPlugin_Feature> aSPFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aSelectedFeature);
- if (aSPFeature.get() != NULL && aShape.get() != NULL && !aShape->isNull()) {
+ if (aSPFeature.get() == NULL && aShape.get() != NULL && !aShape->isNull()) {
// Processing of external (non-sketch) object
ObjectPtr aObj = PartSet_Tools::createFixedObjectByExternal(aShape->impl<TopoDS_Shape>(),
aSelectedObject, mySketch);
AttributeRefAttrPtr aRefAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aAttr);
if (aRefAttr) {
- TopoDS_Shape aTDSShape = aShape->impl<TopoDS_Shape>();
- AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(aSelectedObject, aTDSShape, mySketch);
+ // it is possible that the point feature is selected. It should be used itself
+ // instead of searching an attribute for the shape
+ bool aShapeIsResult = false;
+ /*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
+ aShapeIsResult = aShapePtr.get() != NULL && aShapePtr->isEqual(theShape);
+ }*/
+ AttributePtr aPntAttr;
+ if (!aShapeIsResult) {
+ TopoDS_Shape aTDSShape = aShape->impl<TopoDS_Shape>();
+ aPntAttr = PartSet_Tools::findAttributeBy2dPoint(aSelectedObject, aTDSShape, mySketch);
+ }
// this is an alternative, whether the attribute should be set or object in the attribute
// the first check is the attribute because the object already exist
// the object is set only if there is no selected attribute
tooltip="Select point, line end point, line, center of circle or arc."
shape_types="edge vertex">
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
- <selection_filter id="MultiFilter" parameters="line,vertex"/>
+ <validator id="ModuleBase_ValidatorLinearEdgeOrVertex"/>
</sketch_shape_selector>/>
<sketch_shape_selector
id="ConstraintEntityB"
<validator id="PartSet_DifferentObjects"/>
<validator id="SketchPlugin_DistanceAttr" parameters="ConstraintEntityA"/>
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
- <selection_filter id="MultiFilter" parameters="line,vertex"/>
- </sketch_shape_selector>
+ <validator id="ModuleBase_ValidatorLinearEdgeOrVertex"/>
+ </sketch_shape_selector>
<sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" default="computed" internal="1" obligatory="0"/>
<shape_selector id="ConstraintEntityA" label="Line" tooltip="Select an line"
shape_types="edge" >
<validator id="SketchPlugin_ResultLine"/>
- <selection_filter id="EdgeFilter" parameters="line"/>
+ <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
<validator id="SketchPlugin_ResultLine"/>
</shape_selector>
<sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" default="computed" internal="1" obligatory="0"/>
<shape_selector id="ConstraintEntityA" label="Circle or Arc" tooltip="Select a circle or an arc"
shape_types="edge">
<validator id="SketchPlugin_ResultArc"/>
- <selection_filter id="EdgeFilter" parameters="circle"/>
+ <validator id="ModuleBase_ValidatorLinearEdge" 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">
- <selection_filter id="EdgeFilter" parameters="line"/>
- <validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
+ <validator id="ModuleBase_ValidatorLinearEdge" 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">
- <selection_filter id="EdgeFilter" parameters="line"/>
+ <validator id="ModuleBase_ValidatorLinearEdge" 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"/>
- <selection_filter id="EdgeFilter" parameters="line"/>
- </sketch_constraint_shape_selector>
+ <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ </sketch_constraint_shape_selector>
<sketch_constraint_shape_selector id="ConstraintEntityB"
label="Last line" tooltip="Select an line"
shape_types="edge">
<validator id="PartSet_DifferentObjects"/>
<validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityA"/>
- <selection_filter id="EdgeFilter" parameters="line"/>
- </sketch_constraint_shape_selector>
+ <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
+ </sketch_constraint_shape_selector>
<validator id="PartSet_PerpendicularValidator"/>
</feature>
<!-- SketchConstraintRigid -->
<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">
- <selection_filter id="EdgeFilter" parameters="line"/>
+ <validator id="ModuleBase_ValidatorLinearEdge" 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">
- <selection_filter id="EdgeFilter" parameters="line"/>
+ <validator id="ModuleBase_ValidatorLinearEdge" parameters="line"/>
</sketch_constraint_shape_selector>
</feature>
<!-- SketchConstraintEqual -->
/// Fills the viewer presentation parameters by the parameters from the owner
/// \param thePrs a container for selection
/// \param theOwner a selection owner
- void fillPresentation(ModuleBase_ViewerPrs& thePrs, const Handle_SelectMgr_EntityOwner& theOwner) const;
+ virtual void fillPresentation(ModuleBase_ViewerPrs& thePrs,
+ const Handle_SelectMgr_EntityOwner& theOwner) const;
/// Returns a list of viewer highlited presentations
/// \return list of presentations