Selaa lähdekoodia

change tool/map_lanetoxodr. solve a problem on endpoint calc,because may 80.0000000028 > 80.0 cause calc fail.

yuchuli 3 vuotta sitten
vanhempi
commit
a6b14bfe36

+ 2 - 1
src/common/common/xodr/OpenDrive/RoadGeometry.cpp

@@ -168,7 +168,8 @@ double RoadGeometry::GetLength()
  */
 bool RoadGeometry::CheckInterval (double s_check)
 {
-	if ((s_check >= mS) && (s_check<=mS2))
+//    if ((s_check >= mS) && (s_check<=mS2))
+    if ((s_check >= mS) && (s_check<=(mS2+0.00001)))   //Solve End Problem.
 		return true;
 	else
 		return false;

+ 16 - 0
src/tool/map_lanetoxodr/dialoghideroad.cpp

@@ -0,0 +1,16 @@
+#include "dialoghideroad.h"
+#include "ui_dialoghideroad.h"
+
+DialogHideRoad::DialogHideRoad(OpenDrive * pxodr,std::string strdefroad,QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::DialogHideRoad)
+{
+    ui->setupUi(this);
+
+    setWindowTitle("Hide Road");
+}
+
+DialogHideRoad::~DialogHideRoad()
+{
+    delete ui;
+}

+ 39 - 0
src/tool/map_lanetoxodr/dialoghideroad.h

@@ -0,0 +1,39 @@
+#ifndef DIALOGHIDEROAD_H
+#define DIALOGHIDEROAD_H
+
+#include <QDialog>
+#include <QMessageBox>
+
+#include "myview.h"
+#include "OpenDrive/OpenDrive.h"
+
+#include "ivxodrtool.h"
+
+#include "roadviewitem.h"
+namespace Ui {
+class DialogHideRoad;
+}
+
+class DialogHideRoad : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit DialogHideRoad(OpenDrive * pxodr,std::string strdefroad,QWidget *parent = nullptr);
+    ~DialogHideRoad();
+
+private:
+    Ui::DialogHideRoad *ui;
+
+    OpenDrive * mpxodr;
+
+    QImage *image;
+    QPainter *painter;
+    MyView *myview;
+    QTimer *timer;
+    QGraphicsScene *scene;
+
+    Road * mpCurRoad = 0;
+};
+
+#endif // DIALOGHIDEROAD_H

+ 104 - 0
src/tool/map_lanetoxodr/dialoghideroad.ui

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogHideRoad</class>
+ <widget class="QDialog" name="DialogHideRoad">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1031</width>
+    <height>662</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QComboBox" name="comboBox_Road">
+   <property name="geometry">
+    <rect>
+     <x>130</x>
+     <y>21</y>
+     <width>241</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>30</x>
+     <y>30</y>
+     <width>121</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Road</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_HideRoad">
+   <property name="geometry">
+    <rect>
+     <x>420</x>
+     <y>20</y>
+     <width>121</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Hide</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_UnHideAllRoad">
+   <property name="geometry">
+    <rect>
+     <x>826</x>
+     <y>80</y>
+     <width>131</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>UnHide All</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_UnHIdeRoad">
+   <property name="geometry">
+    <rect>
+     <x>649</x>
+     <y>82</y>
+     <width>131</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>UnHide</string>
+   </property>
+  </widget>
+  <widget class="QComboBox" name="comboBox_Road_2">
+   <property name="geometry">
+    <rect>
+     <x>420</x>
+     <y>82</y>
+     <width>181</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_10">
+   <property name="geometry">
+    <rect>
+     <x>291</x>
+     <y>90</y>
+     <width>81</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Hiden Road</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 7 - 0
src/tool/map_lanetoxodr/mainwindow.cpp

@@ -5705,3 +5705,10 @@ void MainWindow::on_actionMake_All_Road_Contact_triggered()
 
     mpfb->SetOpenDrive(mxodr);
 }
+
+void MainWindow::on_actionHide_Road_triggered()
+{
+    std::string strroadid = mpCBRoad->currentText().toStdString();
+    DialogHideRoad hrd(&mxodr,strroadid,this);
+    int res = hrd.exec();
+}

+ 3 - 0
src/tool/map_lanetoxodr/mainwindow.h

@@ -47,6 +47,7 @@
 #include "dialogaddroadfromrtk.h"
 #include "dialogcalcs.h"
 #include "dialogroadborrow.h"
+#include "dialoghideroad.h"
 
 #include "filebackup.h"
 
@@ -209,6 +210,8 @@ private slots:
 
     void on_actionMake_All_Road_Contact_triggered();
 
+    void on_actionHide_Road_triggered();
+
 private:
 
 

+ 18 - 0
src/tool/map_lanetoxodr/mainwindow.ui

@@ -56,9 +56,22 @@
     <addaction name="actionAdd_Road_From_RTK"/>
     <addaction name="actionSummary_Road"/>
    </widget>
+   <widget class="QMenu" name="menuView">
+    <property name="title">
+     <string>View</string>
+    </property>
+    <addaction name="actionHide_Road"/>
+   </widget>
+   <widget class="QMenu" name="menuHelp">
+    <property name="title">
+     <string>Help</string>
+    </property>
+   </widget>
    <addaction name="menuFile"/>
    <addaction name="menuFunction"/>
    <addaction name="menuTool"/>
+   <addaction name="menuView"/>
+   <addaction name="menuHelp"/>
   </widget>
   <widget class="QToolBar" name="mainToolBar">
    <attribute name="toolBarArea">
@@ -141,6 +154,11 @@
     <string>Make All Road Contact</string>
    </property>
   </action>
+  <action name="actionHide_Road">
+   <property name="text">
+    <string>Hide Road</string>
+   </property>
+  </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <resources>

+ 3 - 0
src/tool/map_lanetoxodr/map_lanetoxodr.pro

@@ -34,6 +34,7 @@ SOURCES += \
     dialogcalcs.cpp \
     dialogeditlane.cpp \
     dialogeditroadmark.cpp \
+    dialoghideroad.cpp \
     dialoglanefromrtk.cpp \
     dialoglaneoffset.cpp \
     dialogparkingspaceedit.cpp \
@@ -81,6 +82,7 @@ HEADERS += \
     dialogcalcs.h \
     dialogeditlane.h \
     dialogeditroadmark.h \
+    dialoghideroad.h \
     dialoglanefromrtk.h \
     dialoglaneoffset.h \
     dialogparkingspaceedit.h \
@@ -122,6 +124,7 @@ FORMS += \
         dialogcalcs.ui \
         dialogeditlane.ui \
         dialogeditroadmark.ui \
+        dialoghideroad.ui \
         dialoglanefromrtk.ui \
         dialoglaneoffset.ui \
         dialogparkingspaceedit.ui \

+ 2 - 0
src/tool/map_lanetoxodr/roadeditdialog.cpp

@@ -50,6 +50,8 @@ RoadEditDialog::RoadEditDialog(OpenDrive * pxodr,std::string strdefroad,QWidget
 
     }
 
+
+
     MainWindow::ComboToString(strdefroad,ui->comboBox_Road);
 
     setWindowTitle("Edit Road");

+ 4 - 4
src/tool/map_lanetoxodr/roadeditdialog.ui

@@ -177,8 +177,8 @@
   <widget class="QLineEdit" name="lineEdit_roadlen">
    <property name="geometry">
     <rect>
-     <x>770</x>
-     <y>30</y>
+     <x>530</x>
+     <y>40</y>
      <width>113</width>
      <height>25</height>
     </rect>
@@ -187,8 +187,8 @@
   <widget class="QLabel" name="label_8">
    <property name="geometry">
     <rect>
-     <x>626</x>
-     <y>38</y>
+     <x>430</x>
+     <y>40</y>
      <width>121</width>
      <height>17</height>
     </rect>