main.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #include "mainwindow.h"//#include <QCoreApplication>
  2. #include <QApplication>
  3. #include <adclicense.h>
  4. #include "xmlparam.h"
  5. extern double gfViewAngle;
  6. double gfcustom_cam_x = -50;
  7. double gfcustom_cam_y = 0;
  8. double gfcustom_cam_z = 30;
  9. double gfcustom_view_x = 0;
  10. double gfcustom_view_y = 0;
  11. double gfcustom_view_z = 0;
  12. double gfcustom_yawrotate = 0;
  13. bool gbShowPointCloud = true;
  14. bool gbShowXODRAsLine = false;
  15. double gfVehicleZOff = 0.0;
  16. bool gbShowCNN = true;
  17. void LoadCameraPos(QString strpath)
  18. {
  19. iv::xmlparam::Xmlparam xparam(strpath.toStdString());
  20. gfVehicleZOff = xparam.GetParam("VehicleZOff", 0.0);
  21. gbShowPointCloud = xparam.GetParam("ShowPointCloud",true);
  22. gbShowXODRAsLine = xparam.GetParam("ShowXODRAsLine",false);
  23. gfViewAngle = xparam.GetParam("TrackingAngle",15.0);
  24. if(gfViewAngle>90)gfViewAngle = 15.0;
  25. if(gfViewAngle<=0)gfViewAngle = 15.0;
  26. gfcustom_cam_x = xparam.GetParam("custom_cam_x",-50.0);
  27. gfcustom_cam_y = xparam.GetParam("custom_cam_y",0.0);
  28. gfcustom_cam_z = xparam.GetParam("custom_cam_z",30.0);
  29. gfcustom_view_x = xparam.GetParam("custom_view_x",0.0);
  30. gfcustom_view_y = xparam.GetParam("custom_view_y",0.0);
  31. gfcustom_view_z = xparam.GetParam("custom_view_z",0.0);
  32. gfcustom_yawrotate = xparam.GetParam("custom_yawrotate",0.0) *M_PI/180.0;
  33. gbShowCNN = xparam.GetParam("ShowCNN",true);
  34. }
  35. int main(int argc, char *argv[])
  36. {
  37. QApplication a(argc, argv);
  38. QString strpath = QCoreApplication::applicationDirPath();
  39. if(argc < 2)
  40. strpath = strpath + "/view_ndtmatching.xml";
  41. else
  42. strpath = argv[1];
  43. LoadCameraPos(strpath);
  44. MainWindow w;
  45. w.show();
  46. ADCLicenseServ adclicense;
  47. int checklicense=adclicense.CheckLincese();
  48. if (checklicense==1)
  49. {
  50. return a.exec();
  51. }
  52. }