1 // File: GeomAPI_Edge.cpp
2 // Created: 24 Jul 2014
3 // Author: Artem ZHIDKOV
5 #include<GeomAPI_Edge.h>
7 #include <TopoDS_Shape.hxx>
8 #include <TopoDS_Edge.hxx>
9 #include <BRep_Tool.hxx>
10 #include <Geom_Curve.hxx>
11 #include <Geom_Line.hxx>
12 #include <Geom_Circle.hxx>
14 GeomAPI_Edge::GeomAPI_Edge()
19 bool GeomAPI_Edge::isLine() const
21 const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
23 Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast);
24 if (aCurve->IsKind(STANDARD_TYPE(Geom_Line)))
29 bool GeomAPI_Edge::isCircle() const
31 const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
33 Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast);
34 if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle)) && aCurve->IsClosed())
39 bool GeomAPI_Edge::isArc() const
41 const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
43 Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast);
44 if (aCurve->IsKind(STANDARD_TYPE(Geom_Circle)) && !aCurve->IsClosed())