How to detect when a gpPnt is a point on TopoDS Wire

David Swall's picture

bool WidgetOccViewController::deterLine(TopoDS_Edge anEdge)
{

BRep_Builder b;
TopoDS_Wire w;
b.MakeWire(w);
b.Add(w, anEdge);
BRepAdaptor_CompCurve C;
C.Initialize(w, false);
GCPnts_UniformAbscissa UA(C, 6);
TColgp_Array1OfPnt anArrayofPnt(1, 6);
for (int i = 1; i <= 6; i++)
anArrayofPnt.SetValue(i, C.Value(UA.Parameter(i)));
GProp_PEquation PE(anArrayofPnt, 1);
if (PE.IsLinear())
{
return true;
}

return false;
}