1 // Created on: 1996-03-13
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <StdSelect_EdgeFilter.ixx>
18 #include <BRepAdaptor_Curve.hxx>
19 #include <TopoDS_Edge.hxx>
22 #include <StdSelect_BRepOwner.hxx>
30 //==================================================
33 //==================================================
35 ::StdSelect_EdgeFilter (const StdSelect_TypeOfEdge Edge):
38 //==================================================
41 //==================================================
42 void StdSelect_EdgeFilter
43 ::SetType(const StdSelect_TypeOfEdge aNewType)
50 //==================================================
53 //==================================================
54 StdSelect_TypeOfEdge StdSelect_EdgeFilter::Type() const
59 //==================================================
62 //==================================================
63 Standard_Boolean StdSelect_EdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
65 if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False;
67 const TopoDS_Shape& sh = ((Handle(StdSelect_BRepOwner)&)EO)->Shape();
68 if(sh.ShapeType()!= TopAbs_EDGE) return Standard_False;
71 case StdSelect_AnyEdge:
75 BRepAdaptor_Curve curv(TopoDS::Edge(sh));
76 return (curv.GetType() == GeomAbs_Line);
79 case StdSelect_Circle:
80 BRepAdaptor_Curve curv(TopoDS::Edge(sh));
81 return (curv.GetType() == GeomAbs_Circle);
84 return Standard_False ;
87 Standard_Boolean StdSelect_EdgeFilter::ActsOn(const TopAbs_ShapeEnum aStandardMode) const
88 {return aStandardMode==TopAbs_EDGE;}