From: nds Date: Wed, 10 Dec 2014 11:24:17 +0000 (+0300) Subject: It is a filters implementation to be set in the XML file. X-Git-Tag: before_slalome_7.5.1~27^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d2331286e9a56368acb78febcd5a5c7f82f04b6b;p=modules%2Fshaper.git It is a filters implementation to be set in the XML file. Check for a linear edge selection --- diff --git a/src/ModuleBase/ModuleBase_FilterLinearEdge.cpp b/src/ModuleBase/ModuleBase_FilterLinearEdge.cpp index 76712c0a7..b101cdbf4 100644 --- a/src/ModuleBase/ModuleBase_FilterLinearEdge.cpp +++ b/src/ModuleBase/ModuleBase_FilterLinearEdge.cpp @@ -15,6 +15,8 @@ #include +#include + #include #include #include @@ -29,21 +31,19 @@ Standard_Boolean ModuleBase_FilterLinearEdge::IsOk(const Handle(SelectMgr_Entity { Standard_Boolean isOk = ModuleBase_Filter::IsOk(theOwner); if (isOk && theOwner->HasSelectable()) { - Handle(AIS_InteractiveObject) aAisObj = + Handle(AIS_InteractiveObject) anAIS = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); - if (!aAisObj.IsNull()) { - std::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); - aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj)); - //ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj); - - - /*foreach (QString aType, myTypes) { - if (aType.toLower() == "construction") { - ResultConstructionPtr aConstr = - std::dynamic_pointer_cast(aObj); - return (aConstr != NULL); - } // ToDo: Process other types of objects - }*/ + if (!anAIS.IsNull()) { + Handle(AIS_Shape) aShapeAIS = Handle(AIS_Shape)::DownCast(anAIS); + if (aShapeAIS) { + const TopoDS_Shape& aShape = aShapeAIS->Shape(); + if (aShape.ShapeType() == TopAbs_EDGE) { + std::shared_ptr anEdge = std::shared_ptr(new GeomAPI_Edge()); + anEdge->setImpl(new TopoDS_Shape(aShape)); + + isOk = anEdge->isLine(); + } + } } } return Standard_False;