Do not visualize any presentation if the start and end points are equal
#include<gp_Pnt2d.hxx>
+#include <Precision.hxx>
+
#define MY_PNT2D static_cast<gp_Pnt2d*>(myImpl)
GeomAPI_Pnt2d::GeomAPI_Pnt2d(const double theX, const double theY)
{
return MY_PNT2D->Distance(theOther->impl<gp_Pnt2d>());
}
+
+bool GeomAPI_Pnt2d::isEqual(const boost::shared_ptr<GeomAPI_Pnt2d>& theOther) const
+{
+ return distance(theOther) < Precision::Confusion();
+}
/// Distance between two points
double distance(const boost::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
+
+ /// Returns whether the distance between two points is less then precision confusion
+ bool isEqual(const boost::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
};
#endif
aPnt_B = getProjectionPoint(aLine, aPnt_A);
}
}
- if (!aPnt_A || !aPnt_B)
+ if (!aPnt_A || !aPnt_B || aPnt_A->isEqual(aPnt_B))
return thePrevious;
boost::shared_ptr<GeomDataAPI_Point2D> aFlyOutAttr = boost::dynamic_pointer_cast<