1 // File: ModuleBase_FilterLinearEdge.cpp
2 // Created: 10 Dec 2014
3 // Author: Natalia ERMOLAEVA
6 #include "ModuleBase_FilterLinearEdge.h"
7 #include "ModuleBase_IWorkshop.h"
9 #include <ModelAPI_Session.h>
10 #include <ModelAPI_Document.h>
11 #include <ModelAPI_ResultConstruction.h>
13 #include <AIS_InteractiveObject.hxx>
14 #include <AIS_Shape.hxx>
16 #include <StdSelect_BRepOwner.hxx>
18 #include <BRep_Tool.hxx>
20 #include <TopoDS_Edge.hxx>
21 #include <Geom_Curve.hxx>
24 IMPLEMENT_STANDARD_HANDLE(ModuleBase_FilterLinearEdge, SelectMgr_Filter);
25 IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_FilterLinearEdge, SelectMgr_Filter);
28 Standard_Boolean ModuleBase_FilterLinearEdge::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const
30 Standard_Boolean isOk = ModuleBase_Filter::IsOk(theOwner);
31 if (isOk && theOwner->HasSelectable()) {
32 Handle(AIS_InteractiveObject) aAisObj =
33 Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable());
34 if (!aAisObj.IsNull()) {
35 std::shared_ptr<GeomAPI_AISObject> aAISObj = AISObjectPtr(new GeomAPI_AISObject());
36 aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj));
37 //ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj);
40 /*foreach (QString aType, myTypes) {
41 if (aType.toLower() == "construction") {
42 ResultConstructionPtr aConstr =
43 std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aObj);
44 return (aConstr != NULL);
45 } // ToDo: Process other types of objects
49 return Standard_False;