
#ifndef SRC_HDLIBMATH_H
#define SRC_HDLIBMATH_H


#include "MapTypes.hpp"

namespace jf{
class HdLibMath {
public:
    static bool IsInRecArea(const Point &cptPoint, const std::vector<std::vector<double>> &cvctvdLeftEdgeGeo, const std::vector<std::vector<double>> &cvctvdRightEdgeGeo, bool isReverseFlag);
    static bool GetPerpendicularFoot(const Point &ptPoint, const std::vector<std::vector<double>> &vctvdGeoLink, Point &ptOutPoint, double &dOutDistance, int &nOutNxtIndex);
    static bool GetPerpendicularFoot(const Point &ptPoint, const std::vector<std::vector<double>> &vctvdGeoLink,Point &ptOutPoint, double &dOutDistance);
    static bool GetNearestPointFromArray(const Point &ptPoint, const std::vector<std::vector<double>> &vctvdGeoLink, Point &ptOutPoint, double &dOutDistance, int &nOutIndex);

private:
    static bool IsInTriangle(const Point &cptPoint, const Point &cptA, const Point &cptB, const Point &cptC);
    static bool IsInTriangle(const XYZ &cxyz1, const XYZ &cxyz2, const XYZ &cxyz3, const XYZ &cxyz0);

};
}


#endif //SRC_HDLIBMATH_H
