瀏覽代碼

change tool/map_lanetoxodr. add laneoffset dialog.

yuchuli 3 年之前
父節點
當前提交
8aec92d5e6

+ 97 - 0
src/tool/map_lanetoxodr/dialoglaneoffset.cpp

@@ -0,0 +1,97 @@
+#include "dialoglaneoffset.h"
+#include "ui_dialoglaneoffset.h"
+
+DialogLaneOffset::DialogLaneOffset(Road * pRoad,QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::DialogLaneOffset)
+{
+    ui->setupUi(this);
+
+    mpRoad = pRoad;
+
+    if(mpRoad == NULL)return;
+
+    unsigned int nlaneoffsetcount = mpRoad->GetLaneOffsetCount();
+    unsigned int i;
+    for(i=0;i<nlaneoffsetcount;i++)
+    {
+        LaneOffset * pLO = mpRoad->GetLaneOffset(i);
+        ui->comboBox_laneoffset->addItem(QString::number(pLO->GetS()));
+    }
+}
+
+DialogLaneOffset::~DialogLaneOffset()
+{
+    delete ui;
+}
+
+void DialogLaneOffset::on_pushButton_AddLaneOffset_clicked()
+{
+    double s,a,b,c,d;
+    s = ui->lineEdit_s->text().toDouble();
+    a = ui->lineEdit_a->text().toDouble();
+    b = ui->lineEdit_b->text().toDouble();
+    c = ui->lineEdit_c->text().toDouble();
+    d = ui->lineEdit_d->text().toDouble();
+    unsigned int nlaneoff = mpRoad->AddLaneOffset(s,a,b,c,d);
+    UpdateCombo();
+    ui->comboBox_laneoffset->setCurrentIndex(nlaneoff);
+}
+
+void DialogLaneOffset::UpdateCombo()
+{
+    ui->comboBox_laneoffset->clear();
+
+    unsigned int nlaneoffsetcount = mpRoad->GetLaneOffsetCount();
+    unsigned int i;
+    for(i=0;i<nlaneoffsetcount;i++)
+    {
+        LaneOffset * pLO = mpRoad->GetLaneOffset(i);
+        ui->comboBox_laneoffset->addItem(QString::number(pLO->GetS()));
+    }
+}
+
+void DialogLaneOffset::on_pushButton_DeleteLaneOffset_clicked()
+{
+    unsigned int nlaneoffsetcount = mpRoad->GetLaneOffsetCount();
+    if(nlaneoffsetcount < 1)return;
+    unsigned int index = ui->comboBox_laneoffset->currentIndex();
+    mpRoad->DeleteLaneOffset(index);
+    UpdateCombo();
+}
+
+void DialogLaneOffset::on_pushButton_ChangeLaneOffset_clicked()
+{
+    unsigned int nlaneoffsetcount = mpRoad->GetLaneOffsetCount();
+    if(nlaneoffsetcount < 1)return;
+    unsigned int index = ui->comboBox_laneoffset->currentIndex();
+    LaneOffset * pLO = mpRoad->GetLaneOffset(index);
+    if(pLO == NULL)return;
+    double s,a,b,c,d;
+    s = ui->lineEdit_s->text().toDouble();
+    a = ui->lineEdit_a->text().toDouble();
+    b = ui->lineEdit_b->text().toDouble();
+    c = ui->lineEdit_c->text().toDouble();
+    d = ui->lineEdit_d->text().toDouble();
+    pLO->SetS(s);
+    pLO->Seta(a);
+    pLO->Setb(b);
+    pLO->Setc(c);
+    pLO->Setd(d);
+    UpdateCombo();
+    ui->comboBox_laneoffset->setCurrentIndex(index);
+}
+
+void DialogLaneOffset::on_comboBox_laneoffset_currentIndexChanged(int index)
+{
+    unsigned int nlaneoffsetcount = mpRoad->GetLaneOffsetCount();
+    if(nlaneoffsetcount < 1)return;
+    if(index<0)return;
+    LaneOffset * pLO = mpRoad->GetLaneOffset(index);
+    if(pLO == NULL)return;
+    ui->lineEdit_s->setText(QString::number(pLO->GetS()));
+    ui->lineEdit_a->setText(QString::number(pLO->Geta()));
+    ui->lineEdit_b->setText(QString::number(pLO->Getb()));
+    ui->lineEdit_c->setText(QString::number(pLO->Getc()));
+    ui->lineEdit_d->setText(QString::number(pLO->Getd()));
+}

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

@@ -0,0 +1,39 @@
+#ifndef DIALOGLANEOFFSET_H
+#define DIALOGLANEOFFSET_H
+
+#include <QDialog>
+
+#include "OpenDrive/OpenDrive.h"
+
+#include <QMessageBox>
+
+namespace Ui {
+class DialogLaneOffset;
+}
+
+class DialogLaneOffset : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit DialogLaneOffset(Road * pRoad,QWidget *parent = nullptr);
+    ~DialogLaneOffset();
+
+private slots:
+    void on_pushButton_AddLaneOffset_clicked();
+
+    void on_pushButton_DeleteLaneOffset_clicked();
+
+    void on_pushButton_ChangeLaneOffset_clicked();
+
+    void on_comboBox_laneoffset_currentIndexChanged(int index);
+
+private:
+    Ui::DialogLaneOffset *ui;
+
+    Road * mpRoad;
+
+    void UpdateCombo();
+};
+
+#endif // DIALOGLANEOFFSET_H

+ 183 - 0
src/tool/map_lanetoxodr/dialoglaneoffset.ui

@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogLaneOffset</class>
+ <widget class="QDialog" name="DialogLaneOffset">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>891</width>
+    <height>470</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QComboBox" name="comboBox_laneoffset">
+   <property name="geometry">
+    <rect>
+     <x>340</x>
+     <y>20</y>
+     <width>231</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>50</x>
+     <y>90</y>
+     <width>71</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>soffset</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_s">
+   <property name="geometry">
+    <rect>
+     <x>140</x>
+     <y>90</y>
+     <width>141</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_a">
+   <property name="geometry">
+    <rect>
+     <x>440</x>
+     <y>90</y>
+     <width>141</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>360</x>
+     <y>90</y>
+     <width>71</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>a</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_b">
+   <property name="geometry">
+    <rect>
+     <x>710</x>
+     <y>90</y>
+     <width>141</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_3">
+   <property name="geometry">
+    <rect>
+     <x>630</x>
+     <y>90</y>
+     <width>71</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>b</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_c">
+   <property name="geometry">
+    <rect>
+     <x>140</x>
+     <y>170</y>
+     <width>141</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_4">
+   <property name="geometry">
+    <rect>
+     <x>50</x>
+     <y>170</y>
+     <width>71</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>c</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit_d">
+   <property name="geometry">
+    <rect>
+     <x>440</x>
+     <y>170</y>
+     <width>141</width>
+     <height>41</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_5">
+   <property name="geometry">
+    <rect>
+     <x>360</x>
+     <y>170</y>
+     <width>71</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>d</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_AddLaneOffset">
+   <property name="geometry">
+    <rect>
+     <x>110</x>
+     <y>290</y>
+     <width>131</width>
+     <height>51</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Add</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_DeleteLaneOffset">
+   <property name="geometry">
+    <rect>
+     <x>370</x>
+     <y>290</y>
+     <width>131</width>
+     <height>51</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Delete</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_ChangeLaneOffset">
+   <property name="geometry">
+    <rect>
+     <x>640</x>
+     <y>290</y>
+     <width>131</width>
+     <height>51</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Change</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

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

@@ -3118,6 +3118,10 @@ void MainWindow::onClickCreateRoad()
         startx = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetX();
         startx = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetX();
         starty = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
         starty = p1->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
 
 
+        if(p1->GetLaneOffsetCount()>0)
+        {
+            off1 = off1 - p1->GetLaneOffset(0)->Geta();
+        }
         startx = startx + off1 * cos(starthdg -M_PI/2.0);
         startx = startx + off1 * cos(starthdg -M_PI/2.0);
         starty = starty + off1 * sin(starthdg -M_PI/2.0);
         starty = starty + off1 * sin(starthdg -M_PI/2.0);
 
 
@@ -3139,9 +3143,20 @@ void MainWindow::onClickCreateRoad()
             return;
             return;
         }
         }
         off1 = getoff(p1,mvectorrc[0].mvectorlc[0].ml1,false);
         off1 = getoff(p1,mvectorrc[0].mvectorlc[0].ml1,false);
+        if(p1->GetLaneOffsetCount()>0)
+        {
+            LaneOffset * pLO = p1->GetLaneOffset(p1->GetLaneOffsetCount()-1);
+            double froadlen = p1->GetRoadLength();
+            double sdis = froadlen - pLO->GetS();
+            double foffset = pLO->Geta() + pLO->Getb()*(sdis) + pLO->Getc() * sdis * sdis
+                    +pLO->Getd() * sdis * sdis * sdis;
+            off1 = off1 - foffset;
+        }
         startx = startx + off1 * cos(starthdg -M_PI/2.0);
         startx = startx + off1 * cos(starthdg -M_PI/2.0);
         starty = starty + off1 * sin(starthdg -M_PI/2.0);
         starty = starty + off1 * sin(starthdg -M_PI/2.0);
 
 
+
+
         startheight = 0;
         startheight = 0;
         if(p1->GetElevationCount()>0)
         if(p1->GetElevationCount()>0)
         {
         {
@@ -3160,6 +3175,10 @@ void MainWindow::onClickCreateRoad()
         endy = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
         endy = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetY();
         endhdg = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetHdg();
         endhdg = p2->GetGeometryBlock(0)->GetGeometryAt(0)->GetHdg();
 
 
+        if(p2->GetLaneOffsetCount()>0)
+        {
+            off2 = off2 - p2->GetLaneOffset(0)->Geta();
+        }
         endx = endx + off2 * cos(endhdg -M_PI/2.0);
         endx = endx + off2 * cos(endhdg -M_PI/2.0);
         endy = endy + off2 * sin(endhdg -M_PI/2.0);
         endy = endy + off2 * sin(endhdg -M_PI/2.0);
 
 
@@ -3178,6 +3197,15 @@ void MainWindow::onClickCreateRoad()
             QMessageBox::warning(this,"warn","get end error.");
             QMessageBox::warning(this,"warn","get end error.");
             return;
             return;
         }
         }
+        if(p2->GetLaneOffsetCount()>0)
+        {
+            LaneOffset * pLO = p2->GetLaneOffset(p2->GetLaneOffsetCount()-1);
+            double froadlen = p2->GetRoadLength();
+            double sdis = froadlen - pLO->GetS();
+            double foffset = pLO->Geta() + pLO->Getb()*(sdis) + pLO->Getc() * sdis * sdis
+                    +pLO->Getd() * sdis * sdis * sdis;
+            off2 = off2 - foffset;
+        }
         endx = endx + off2 * cos(endhdg -M_PI/2.0);
         endx = endx + off2 * cos(endhdg -M_PI/2.0);
         endy = endy + off2 * sin(endhdg -M_PI/2.0);
         endy = endy + off2 * sin(endhdg -M_PI/2.0);
         endhdg = endhdg +M_PI;if(endhdg >=2.0*M_PI)endhdg = endhdg -2.0*M_PI;
         endhdg = endhdg +M_PI;if(endhdg >=2.0*M_PI)endhdg = endhdg -2.0*M_PI;

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

@@ -34,6 +34,7 @@ SOURCES += \
     dialogeditlane.cpp \
     dialogeditlane.cpp \
     dialogeditroadmark.cpp \
     dialogeditroadmark.cpp \
     dialoglanefromrtk.cpp \
     dialoglanefromrtk.cpp \
+    dialoglaneoffset.cpp \
     dialogroadmerge.cpp \
     dialogroadmerge.cpp \
     dialogroadmirror.cpp \
     dialogroadmirror.cpp \
     dialogroadmove.cpp \
     dialogroadmove.cpp \
@@ -85,6 +86,7 @@ HEADERS += \
     dialogeditlane.h \
     dialogeditlane.h \
     dialogeditroadmark.h \
     dialogeditroadmark.h \
     dialoglanefromrtk.h \
     dialoglanefromrtk.h \
+    dialoglaneoffset.h \
     dialogroadmerge.h \
     dialogroadmerge.h \
     dialogroadmirror.h \
     dialogroadmirror.h \
     dialogroadmove.h \
     dialogroadmove.h \
@@ -131,6 +133,7 @@ FORMS += \
         dialogeditlane.ui \
         dialogeditlane.ui \
         dialogeditroadmark.ui \
         dialogeditroadmark.ui \
         dialoglanefromrtk.ui \
         dialoglanefromrtk.ui \
+        dialoglaneoffset.ui \
         dialogroadmerge.ui \
         dialogroadmerge.ui \
         dialogroadmirror.ui \
         dialogroadmirror.ui \
         dialogroadmove.ui \
         dialogroadmove.ui \

+ 1 - 1
src/tool/map_lanetoxodr/roaddigit.cpp

@@ -327,7 +327,7 @@ void RoadDigit::CalcLine(double fspace)
             while(s <= ppp3->GetLength())
             while(s <= ppp3->GetLength())
             {
             {
                 double pr= 1.0;
                 double pr= 1.0;
-                if(arclength > 1)pr = s/arclength;
+                if(arclength > 0)pr = s/arclength;
                 xtem = ppp3->GetuA() +  ppp3->GetuB() * pr +  ppp3->GetuC() * pr*pr +  ppp3->GetuD() * pr*pr*pr;
                 xtem = ppp3->GetuA() +  ppp3->GetuB() * pr +  ppp3->GetuC() * pr*pr +  ppp3->GetuD() * pr*pr*pr;
                 ytem = ppp3->GetvA() + ppp3->GetvB() * pr + ppp3->GetvC() * pr*pr + ppp3->GetvD() * pr*pr*pr;
                 ytem = ppp3->GetvA() + ppp3->GetvB() * pr + ppp3->GetvC() * pr*pr + ppp3->GetvD() * pr*pr*pr;
                 x = xtem*cos(ppp3->GetHdg()) - ytem * sin(ppp3->GetHdg()) + ppp3->GetX();
                 x = xtem*cos(ppp3->GetHdg()) - ytem * sin(ppp3->GetHdg()) + ppp3->GetX();

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

@@ -597,3 +597,15 @@ void RoadEditDialog::on_pushButton_MirrorRoad_clicked()
     }
     }
     on_comboBox_Road_currentIndexChanged(ncurindex);
     on_comboBox_Road_currentIndexChanged(ncurindex);
 }
 }
+
+void RoadEditDialog::on_pushButton_EditLaneOffset_clicked()
+{
+    if(mpCurRoad == 0)
+    {
+        QMessageBox::warning(this,"Warning","Not Select Road");
+        return;
+    }
+
+    DialogLaneOffset dlglaneoffset(mpCurRoad,this);
+    dlglaneoffset.exec();
+}

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

@@ -19,6 +19,7 @@
 #include "dialogroadmove.h"
 #include "dialogroadmove.h"
 #include "dialogroadrotate.h"
 #include "dialogroadrotate.h"
 #include "dialogroadmirror.h"
 #include "dialogroadmirror.h"
+#include "dialoglaneoffset.h"
 
 
 #include "roaddigit.h"
 #include "roaddigit.h"
 #include "xodrscenfunc.h"
 #include "xodrscenfunc.h"
@@ -63,6 +64,8 @@ private slots:
 
 
     void on_pushButton_MirrorRoad_clicked();
     void on_pushButton_MirrorRoad_clicked();
 
 
+    void on_pushButton_EditLaneOffset_clicked();
+
 private:
 private:
     bool IsDrawMark(double s);
     bool IsDrawMark(double s);
 
 

+ 16 - 3
src/tool/map_lanetoxodr/roadeditdialog.ui

@@ -223,7 +223,7 @@
   <widget class="QPushButton" name="pushButton_EditLane">
   <widget class="QPushButton" name="pushButton_EditLane">
    <property name="geometry">
    <property name="geometry">
     <rect>
     <rect>
-     <x>100</x>
+     <x>54</x>
      <y>210</y>
      <y>210</y>
      <width>181</width>
      <width>181</width>
      <height>31</height>
      <height>31</height>
@@ -236,7 +236,7 @@
   <widget class="QPushButton" name="pushButton_EditRoadMark">
   <widget class="QPushButton" name="pushButton_EditRoadMark">
    <property name="geometry">
    <property name="geometry">
     <rect>
     <rect>
-     <x>350</x>
+     <x>285</x>
      <y>210</y>
      <y>210</y>
      <width>181</width>
      <width>181</width>
      <height>31</height>
      <height>31</height>
@@ -249,7 +249,7 @@
   <widget class="QPushButton" name="pushButton_LaneFromRTK">
   <widget class="QPushButton" name="pushButton_LaneFromRTK">
    <property name="geometry">
    <property name="geometry">
     <rect>
     <rect>
-     <x>600</x>
+     <x>726</x>
      <y>210</y>
      <y>210</y>
      <width>211</width>
      <width>211</width>
      <height>31</height>
      <height>31</height>
@@ -324,6 +324,19 @@
     <string>Mirror Road</string>
     <string>Mirror Road</string>
    </property>
    </property>
   </widget>
   </widget>
+  <widget class="QPushButton" name="pushButton_EditLaneOffset">
+   <property name="geometry">
+    <rect>
+     <x>500</x>
+     <y>210</y>
+     <width>181</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Edit LaneOffset</string>
+   </property>
+  </widget>
  </widget>
  </widget>
  <resources/>
  <resources/>
  <connections/>
  <connections/>

+ 24 - 6
src/tool/map_lanetoxodr/xodrfunc.cpp

@@ -113,7 +113,7 @@ double xodrfunc::CalcHdg(QPointF p0, QPointF p1)
  * @return
  * @return
  */
  */
 double xodrfunc::GetParamPoly3Dis(GeometryParamPoly3 * parc,double xnow,double ynow,double & nearx,
 double xodrfunc::GetParamPoly3Dis(GeometryParamPoly3 * parc,double xnow,double ynow,double & nearx,
-                        double & neary,double & nearhead,double & frels)
+                        double & neary,double & nearhead,double & frels,bool bParamNormal)
 {
 {
 
 
     double s = 0.1;
     double s = 0.1;
@@ -133,14 +133,32 @@ double xodrfunc::GetParamPoly3Dis(GeometryParamPoly3 * parc,double xnow,double y
         neary = parc->GetY();
         neary = parc->GetY();
     }
     }
 
 
+    double ua,ub,uc,ud;
+    double va,vb,vc,vd;
+    ua = parc->GetuA();
+    ub = parc->GetuB();
+    uc = parc->GetuC();
+    ud = parc->GetuD();
+    va = parc->GetvA();
+    vb = parc->GetvB();
+    vc = parc->GetvC();
+    vd = parc->GetvD();
+    double archdg = parc->GetHdg();
+    double arcx0 = parc->GetX();
+    double arcy0 = parc->GetY();
+    double arclen = parc->GetLength();
     while(s < parc->GetLength())
     while(s < parc->GetLength())
     {
     {
-
+        double fr = s;
+        if(bParamNormal&&(arclen>0))
+        {
+            fr = fr/arclen;
+        }
         double x, y,xtem,ytem;
         double x, y,xtem,ytem;
-        xtem = parc->GetuA() + parc->GetuB() * s + parc->GetuC() * s*s + parc->GetuD() * s*s*s;
-        ytem = parc->GetvA() + parc->GetvB() * s + parc->GetvC() * s*s + parc->GetvD() * s*s*s;
-        x = xtem*cos(parc->GetHdg()) - ytem * sin(parc->GetHdg()) + parc->GetX();
-        y = xtem*sin(parc->GetHdg()) + ytem * cos(parc->GetHdg()) + parc->GetY();
+        xtem = ua + ub * fr + uc * fr*fr + ud * fr*fr*fr;
+        ytem = va + vb * fr + vc * fr*fr + vd * fr*fr*fr;
+        x = xtem*cos(archdg) - ytem * sin(archdg) +arcx0;
+        y = xtem*sin(archdg) + ytem * cos(archdg) + arcy0;
 
 
         double hdg = CalcHdg(QPointF(xold,yold),QPointF(x,y));
         double hdg = CalcHdg(QPointF(xold,yold),QPointF(x,y));
         double fdis = calcpointdis(QPointF(x,y),QPointF(xnow,ynow));
         double fdis = calcpointdis(QPointF(x,y),QPointF(xnow,ynow));

+ 1 - 1
src/tool/map_lanetoxodr/xodrfunc.h

@@ -37,7 +37,7 @@ public:
     static bool pointinarc(GeometryArc * parc,QPointF poingarc,QPointF point1);
     static bool pointinarc(GeometryArc * parc,QPointF poingarc,QPointF point1);
     static double CalcHdg(QPointF p0, QPointF p1);
     static double CalcHdg(QPointF p0, QPointF p1);
     static double GetParamPoly3Dis(GeometryParamPoly3 * parc,double xnow,double ynow,double & nearx,
     static double GetParamPoly3Dis(GeometryParamPoly3 * parc,double xnow,double ynow,double & nearx,
-                            double & neary,double & nearhead,double & frels);
+                            double & neary,double & nearhead,double & frels,bool bParamNormal = true);
     static double GetArcDis(GeometryArc * parc,double x,double y,double & nearx,
     static double GetArcDis(GeometryArc * parc,double x,double y,double & nearx,
                             double & neary,double & nearhead,double & frels);
                             double & neary,double & nearhead,double & frels);
     static double GetPoly3Dis(GeometryPoly3 * ppoly,double xnow,double ynow,double & nearx,
     static double GetPoly3Dis(GeometryPoly3 * ppoly,double xnow,double ynow,double & nearx,