main.cpp 1.6 KB

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