Salome HOME
76712c0a7607996bdc75aef0991f166b21be11e1
[modules/shaper.git] / src / ModuleBase / ModuleBase_FilterLinearEdge.cpp
1 // File:        ModuleBase_FilterLinearEdge.cpp
2 // Created:     10 Dec 2014
3 // Author:      Natalia ERMOLAEVA
4
5
6 #include "ModuleBase_FilterLinearEdge.h"
7 #include "ModuleBase_IWorkshop.h"
8
9 #include <ModelAPI_Session.h>
10 #include <ModelAPI_Document.h>
11 #include <ModelAPI_ResultConstruction.h>
12
13 #include <AIS_InteractiveObject.hxx>
14 #include <AIS_Shape.hxx>
15
16 #include <StdSelect_BRepOwner.hxx>
17
18 #include <BRep_Tool.hxx>
19 #include <TopoDS.hxx>
20 #include <TopoDS_Edge.hxx>
21 #include <Geom_Curve.hxx>
22
23
24 IMPLEMENT_STANDARD_HANDLE(ModuleBase_FilterLinearEdge, SelectMgr_Filter);
25 IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_FilterLinearEdge, SelectMgr_Filter);
26
27
28 Standard_Boolean ModuleBase_FilterLinearEdge::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const
29 {
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);
38
39
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
46       }*/
47     }
48   }
49   return Standard_False;
50 }