12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #ifndef XODRFUNC_H
- #define XODRFUNC_H
- #include <OpenDrive/OpenDrive.h>
- #include <QPointF>
- namespace iv {
- struct LanePoint
- {
- int mnlane;
- int mnLaneSection;
- double mS;
- double mflanewidth;
- double mflanetocenter;
- double mfX;
- double mfY;
- double mfhdg;
- int mnlanetype; //0 driving 1 border 2 none 3 bike
- int mnlanemarktype; // -1 no 0 solid 1 broken 2 solidsolid
- int mnlanecolor;
- double mfGeoX;
- double mfGeoY;
- };
- }
- class xodrfunc
- {
- public:
- xodrfunc();
- public:
- static inline double calcpointdis(QPointF p1,QPointF p2);
- static bool pointinarc(GeometryArc * parc,QPointF poingarc,QPointF point1);
- static double CalcHdg(QPointF p0, QPointF p1);
- static double GetParamPoly3Dis(GeometryParamPoly3 * parc,double xnow,double ynow,double & nearx,
- double & neary,double & nearhead,double & frels);
- static double GetArcDis(GeometryArc * parc,double x,double y,double & nearx,
- double & neary,double & nearhead,double & frels);
- static double GetSpiralDis(GeometrySpiral * pspiral,double xnow,double ynow,double & nearx,
- double & neary,double & nearhead,double & frels);
- static double GetLineDis(GeometryLine * pline,const double x,const double y,double & nearx,
- double & neary,double & nearhead,double & frels);
- static int GetNearPoint(const double x,const double y,OpenDrive * pxodr,Road ** pObjRoad,GeometryBlock ** pgeo, double & fdis,double & nearx,
- double & neary,double & nearhead,const double nearthresh,double * pfs=0,int * pnlane= 0,bool bnotuselane = false);
- static double GetAcurateDis(const double x,const double y,Road * pRoad,const double s,const double nearx,
- const double neary,const double nearhead,int * pnlane= 0);
- static std::vector<iv::LanePoint> GetAllLanePoint(Road * pRoad,const double s,const double x, const double y,const double fhdg);
- public:
- static Road * GetRoadByID(OpenDrive * pxodr,std::string strroadid);
- static int GetRoadXYByS(Road * pRoad,const double s,double &x, double & y, double & hdg);
- static int GetLineXY(GeometryLine * pline,double soff,double &x, double & y, double & hdg);
- static int GetSpiralXY(GeometrySpiral * pspira,double soff,double &x, double & y, double & hdg);
- static int GetArcXY(GeometryArc * parc,double soff,double &x, double & y, double & hdg);
- static int GetParamPoly3XY(GeometryParamPoly3 * pparam3d,double soff,double &x, double & y, double & hdg);
- static int GetRoadIndex(OpenDrive * pxodr, Road * pRoad);
- };
- #endif // XODRFUNC_H
|