소스 검색

add project map_collectformveh, for easy collect data for create opendrive, not complete.

yuchuli 3 년 전
부모
커밋
4e791d7cf7

+ 73 - 0
src/tool/map_collectfromveh/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 11 - 0
src/tool/map_collectfromveh/main.cpp

@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+    return a.exec();
+}

+ 116 - 0
src/tool/map_collectfromveh/mainwindow.cpp

@@ -0,0 +1,116 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+
+#define VIEW_WIDTH 6000
+#define VIEW_HEIGHT 6000
+
+std::string strtypevalue[]={"None","Solid","Dash","Solid Solid","Dash Dash","Solid Dash","Dash Solid"};
+std::string strcolorvalue[]={"White","Yellow"};
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+
+    ui->horizontalSlider_width->setRange(0,1000);
+    ui->horizontalSlider_width->setValue(360);
+    ui->lineEdit->setText("3.6");
+
+    int i;
+    for(i=0;i<7;i++)
+    {
+        ui->comboBox_TypeLeft->addItem(strtypevalue[i].data());
+        ui->comboBox_TypeRIght->addItem(strtypevalue[i].data());
+    }
+    ui->comboBox_TypeLeft->setCurrentIndex(1);
+    ui->comboBox_TypeRIght->setCurrentIndex(1);
+
+    for(i=0;i<2;i++)
+    {
+        ui->comboBox_ColorLeft->addItem(strcolorvalue[i].data());
+        ui->comboBox_ColorRight->addItem(strcolorvalue[i].data());
+    }
+    ui->comboBox_ColorLeft->setCurrentIndex(1);
+    ui->comboBox_ColorRight->setCurrentIndex(0);
+
+    ui->lineEdit_DisLeft->setText("1.8");
+    ui->lineEdit_DisRight->setText("1.8");
+
+    ui->radioButton_Auto->setChecked(true);
+    ui->pushButton_ManualCollect->setEnabled(false);
+
+    myview = new MyView(this);
+    myview->setObjectName(QStringLiteral("graphicsView"));
+    myview->setGeometry(QRect(820, 10,500, 585));
+
+//    image = new QImage(2000, 2000, QImage::Format_RGB32);//画布的初始化大小设为300*300,使用32位颜色
+//    myview->setCacheMode(myview->CacheBackground);
+//    painter=new QPainter(this);
+//    painter->end();
+//    scene = new QGraphicsScene;
+
+    mpscene = new  QGraphicsScene(0,0,VIEW_WIDTH,VIEW_HEIGHT);
+    mpscene->setBackgroundBrush(Qt::white);
+    myview->setScene(mpscene);
+
+    myview->centerOn(VIEW_WIDTH/2,VIEW_HEIGHT/2);
+
+    QGraphicsLineItem * plinex = new QGraphicsLineItem(0,VIEW_HEIGHT/2,VIEW_WIDTH,VIEW_HEIGHT/2);
+    mpscene->addItem(plinex);
+    QGraphicsLineItem * pliney = new QGraphicsLineItem(VIEW_WIDTH/2,0,VIEW_WIDTH/2,VIEW_HEIGHT);
+    mpscene->addItem(pliney);
+
+    QGraphicsSimpleTextItem * ptext = new QGraphicsSimpleTextItem("HELLO");
+    mpscene->addItem(ptext);
+    ptext->setPos(1000,1000);
+
+    setWindowTitle("Collect Data From Vehicle");
+
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+
+void MainWindow::on_lineEdit_textChanged(const QString &arg1)
+{
+    if(arg1.length() == 0)return;
+    double value = arg1.toDouble();
+    if(value<0)return;
+    if(value>10)return;
+    int nvalue = value *100.0;
+    ui->horizontalSlider_width->setValue(nvalue);
+}
+
+void MainWindow::on_horizontalSlider_width_sliderMoved(int position)
+{
+    int nvalue = position;
+    double fvalue = nvalue;
+    fvalue = fvalue * 0.01;
+    ui->lineEdit->setText(QString::number(fvalue));
+}
+
+void MainWindow::resizeEvent(QResizeEvent *event)
+{
+    (void)event;
+    QSize sizemain = ui->centralwidget->size();
+
+    ui->plainTextEdit->setGeometry(690,30,sizemain.width()-730,300);
+    myview->setGeometry(690,360,sizemain.width()-730,sizemain.height()-400);
+}
+
+void MainWindow::on_pushButton_NewRoad_clicked()
+{
+
+}
+
+void MainWindow::paintEvent(QPaintEvent * event)
+{
+    (void)event;
+    myview->setScene(mpscene);
+
+}

+ 48 - 0
src/tool/map_collectfromveh/mainwindow.h

@@ -0,0 +1,48 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+#include "myview.h"
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = nullptr);
+    ~MainWindow();
+
+private slots:
+    void on_lineEdit_textChanged(const QString &arg1);
+
+    void on_horizontalSlider_width_sliderMoved(int position);
+
+    void on_pushButton_NewRoad_clicked();
+
+    virtual void paintEvent(QPaintEvent *);
+
+public:
+     void resizeEvent(QResizeEvent *event);
+
+
+private:
+    Ui::MainWindow *ui;
+
+    MyView *myview;
+
+
+//    QGraphicsView *view;
+//    QImage *image;
+//    QPainter *painter;
+//    QTimer *timer;
+//    QGraphicsScene *scene;
+
+    QGraphicsScene * mpscene;
+
+};
+#endif // MAINWINDOW_H

+ 332 - 0
src/tool/map_collectfromveh/mainwindow.ui

@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1207</width>
+    <height>715</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QPushButton" name="pushButton_NewRoad">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>40</y>
+      <width>131</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>新道路</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_Complete">
+    <property name="geometry">
+     <rect>
+      <x>180</x>
+      <y>40</y>
+      <width>121</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>完成</string>
+    </property>
+   </widget>
+   <widget class="QGroupBox" name="groupBox">
+    <property name="geometry">
+     <rect>
+      <x>366</x>
+      <y>10</y>
+      <width>291</width>
+      <height>151</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>采集模式</string>
+    </property>
+    <widget class="QRadioButton" name="radioButton_Auto">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>40</y>
+       <width>121</width>
+       <height>41</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>自动</string>
+     </property>
+    </widget>
+    <widget class="QRadioButton" name="radioButton_Manual">
+     <property name="geometry">
+      <rect>
+       <x>150</x>
+       <y>55</y>
+       <width>112</width>
+       <height>23</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>手动</string>
+     </property>
+    </widget>
+    <widget class="QPushButton" name="pushButton_ManualCollect">
+     <property name="geometry">
+      <rect>
+       <x>90</x>
+       <y>90</y>
+       <width>191</width>
+       <height>51</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>手动采集</string>
+     </property>
+    </widget>
+   </widget>
+   <widget class="QGroupBox" name="groupBox_2">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>290</y>
+      <width>311</width>
+      <height>301</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>左边线</string>
+    </property>
+    <widget class="QLineEdit" name="lineEdit_DisLeft">
+     <property name="geometry">
+      <rect>
+       <x>100</x>
+       <y>40</y>
+       <width>191</width>
+       <height>51</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_2">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>50</y>
+       <width>71</width>
+       <height>31</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>距离</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_3">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>131</y>
+       <width>61</width>
+       <height>41</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>颜色</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_4">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>224</y>
+       <width>61</width>
+       <height>31</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>类型</string>
+     </property>
+    </widget>
+    <widget class="QComboBox" name="comboBox_ColorLeft">
+     <property name="geometry">
+      <rect>
+       <x>100</x>
+       <y>130</y>
+       <width>191</width>
+       <height>51</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QComboBox" name="comboBox_TypeLeft">
+     <property name="geometry">
+      <rect>
+       <x>100</x>
+       <y>220</y>
+       <width>191</width>
+       <height>51</height>
+      </rect>
+     </property>
+    </widget>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>30</x>
+      <y>197</y>
+      <width>81</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>宽度</string>
+    </property>
+   </widget>
+   <widget class="QSlider" name="horizontalSlider_width">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>209</y>
+      <width>391</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Horizontal</enum>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit">
+    <property name="geometry">
+     <rect>
+      <x>510</x>
+      <y>196</y>
+      <width>111</width>
+      <height>51</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QGroupBox" name="groupBox_3">
+    <property name="geometry">
+     <rect>
+      <x>349</x>
+      <y>290</y>
+      <width>311</width>
+      <height>301</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>右边线</string>
+    </property>
+    <widget class="QLineEdit" name="lineEdit_DisRight">
+     <property name="geometry">
+      <rect>
+       <x>100</x>
+       <y>40</y>
+       <width>191</width>
+       <height>51</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_5">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>50</y>
+       <width>71</width>
+       <height>31</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>距离</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_6">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>131</y>
+       <width>61</width>
+       <height>41</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>颜色</string>
+     </property>
+    </widget>
+    <widget class="QLabel" name="label_7">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>224</y>
+       <width>61</width>
+       <height>31</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>类型</string>
+     </property>
+    </widget>
+    <widget class="QComboBox" name="comboBox_ColorRight">
+     <property name="geometry">
+      <rect>
+       <x>100</x>
+       <y>130</y>
+       <width>191</width>
+       <height>51</height>
+      </rect>
+     </property>
+    </widget>
+    <widget class="QComboBox" name="comboBox_TypeRIght">
+     <property name="geometry">
+      <rect>
+       <x>100</x>
+       <y>220</y>
+       <width>191</width>
+       <height>51</height>
+      </rect>
+     </property>
+    </widget>
+   </widget>
+   <widget class="QPlainTextEdit" name="plainTextEdit">
+    <property name="geometry">
+     <rect>
+      <x>710</x>
+      <y>30</y>
+      <width>471</width>
+      <height>181</height>
+     </rect>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>1207</width>
+     <height>28</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>File</string>
+    </property>
+    <addaction name="actionSelect_Work_Space"/>
+   </widget>
+   <addaction name="menuFile"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="actionSelect_Work_Space">
+   <property name="text">
+    <string>Select Work Space</string>
+   </property>
+  </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 26 - 0
src/tool/map_collectfromveh/map_collectfromveh.pro

@@ -0,0 +1,26 @@
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++11
+
+# You can make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    main.cpp \
+    mainwindow.cpp \
+    myview.cpp
+
+HEADERS += \
+    mainwindow.h \
+    myview.h
+
+FORMS += \
+    mainwindow.ui
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target

+ 218 - 0
src/tool/map_collectfromveh/myview.cpp

@@ -0,0 +1,218 @@
+#include "myview.h"
+#include <QScrollBar>
+#include <iostream>
+#define VIEW_CENTER viewport()->rect().center()
+const double PI = 3.1415926535898;
+
+MyView::MyView(QWidget *parent) :
+     QGraphicsView(parent),
+    beishu(1.00000)
+{
+    setDragMode(QGraphicsView::ScrollHandDrag);
+
+//    grabGesture(Qt::PanGesture);
+    grabGesture(Qt::PinchGesture);
+ //   grabGesture(Qt::SwipeGesture);
+}
+
+
+
+
+void MyView::mousePressEvent(QMouseEvent *event)
+{
+//    qDebug("x is %d",event->pos().x());
+    bottonstatus = true;
+    QGraphicsView::mousePressEvent(event);
+}
+void MyView::mouseMoveEvent(QMouseEvent *event)
+{
+    if(mbInPinch == true)return;
+    QGraphicsView::mouseMoveEvent(event);
+
+//    QScrollBar * ps = verticalScrollBar();
+//    std::cout<<" size is "<<ps->size().height()<<" v = "<<ps->value()<<std::endl;
+//    QScrollBar * ps2= horizontalScrollBar();
+//     std::cout<<" size is "<<ps2->size().width()<<" h = "<<ps2->value()<<std::endl;
+}
+void MyView::mouseReleaseEvent(QMouseEvent *event)
+{
+    bottonstatus = false;
+    QGraphicsView::mouseReleaseEvent(event);
+}
+
+// 放大/缩小
+void MyView::wheelEvent(QWheelEvent *event)
+{
+    // 滚轮的滚动量
+    QPoint scrollAmount = event->angleDelta();
+    // 正值表示滚轮远离使用者(放大),负值表示朝向使用者(缩小)
+    scrollAmount.y() > 0 ? zoomIn() : zoomOut();
+}
+
+
+// 放大
+void MyView::zoomIn()
+{
+
+    int width,hgt;
+    width = sceneRect().width();
+    hgt = sceneRect().height();
+    QScrollBar * psV = verticalScrollBar();
+    QScrollBar * psH = horizontalScrollBar();
+
+
+//    qDebug("%d %d ",width,hgt);
+
+
+    int centery = (psV->value() + psV->size().height()/2)/beishu;
+    int centerx = (psH->value() + psH->size().width()/2)/beishu;
+
+#ifndef ANDROID
+    scale(1.1, 1.1);
+    beishu *= 1.1;
+#else
+    scale(1.6, 1.6);
+    beishu *= 1.6;
+#endif
+ //   centerOn(450, 700 - (200 / beishu));
+
+
+
+//    qDebug("beishu is %f",beishu);
+
+    centerOn(centerx,centery);
+
+    emit beishuchange(beishu);
+
+
+
+//    QPoint x = viewport()->rect().center();
+
+
+//    std::cout<<" x is"<<sceneRect().bottom()<<" y is "<<sceneRect().y()<<std::endl;
+//    QScrollBar * ps = verticalScrollBar();
+//    std::cout<<" size is "<<ps->size().height()<<" v = "<<ps->value()<<std::endl;
+
+}
+
+// 缩小
+void MyView::zoomOut()
+{
+
+    int width,hgt;
+    width = sceneRect().width();
+    hgt = sceneRect().height();
+    QScrollBar * psV = verticalScrollBar();
+    QScrollBar * psH = horizontalScrollBar();
+
+    int centery = (psV->value() + psV->size().height()/2)/beishu;
+    int centerx = (psH->value() + psH->size().width()/2)/beishu;
+
+#ifndef ANDROID
+    scale(1 / 1.1, 1 / 1.1);
+    beishu /= 1.1;
+#else
+    scale(1 / 1.6, 1 / 1.6);
+    beishu /= 1.6;
+#endif
+//    centerOn(450, 700 - (200 / beishu));
+
+
+    centerOn(centerx,centery);
+
+    emit beishuchange(beishu);
+}
+
+void MyView::zoomone()
+{
+
+    scale(1 /beishu, 1 / beishu);
+    beishu  = 1.0;
+
+    emit beishuchange(beishu);
+
+}
+
+void MyView::mouseDoubleClickEvent(QMouseEvent *event)
+{
+
+    QScrollBar * psV = verticalScrollBar();
+    QScrollBar * psH = horizontalScrollBar();
+
+    int centery = (psV->value() + psV->size().height()/2)/beishu;
+    int centerx = (psH->value() + psH->size().width()/2)/beishu;
+
+
+//    qDebug("x is %d y is %d view center x is %d  centerx is %d",event->pos().x(),
+//           event->pos().y(),
+//           viewport()->rect().center().x(),centerx);
+
+    int viewx,viewy;
+    if(beishu == 0)return;
+    viewx = centerx +(event->pos().x() - viewport()->rect().center().x())/beishu;
+    viewy = centery +(event->pos().y() - viewport()->rect().center().y())/beishu;
+
+    QPoint viewpoint;
+    viewpoint.setX(viewx);
+    viewpoint.setY(viewy);
+
+    emit dbclickxy(viewx,viewy);
+    qDebug("view x is %d view y is %d ",viewx,viewy);
+}
+
+bool MyView::event(QEvent *event)
+{
+    if (event->type() == QEvent::Gesture)
+    {
+ //       qDebug("gestrue event");
+ //       return true;
+        return gestureEvent(static_cast<QGestureEvent*>(event));
+    }
+
+    return QGraphicsView::event(event);
+}
+
+bool MyView::gestureEvent(QGestureEvent *event)
+{
+    if (QGesture *pinch = event->gesture(Qt::PinchGesture))
+        pinchTriggered(static_cast<QPinchGesture *>(pinch));
+    return true;
+}
+
+void MyView::pinchTriggered(QPinchGesture *gesture)
+{
+
+    static double currentStepScaleFactor = 1;
+    static double oldfactor = 1;
+    QPinchGesture::ChangeFlags changeFlags = gesture->changeFlags();
+    if (changeFlags & QPinchGesture::ScaleFactorChanged) {
+        currentStepScaleFactor = gesture->totalScaleFactor();
+        mbInPinch = true;
+    }
+    if (gesture->state() == Qt::GestureFinished) {
+//        scaleFactor *= currentStepScaleFactor;
+//        qDebug("scale is %f ",currentStepScaleFactor);
+
+        currentStepScaleFactor = 1;
+        oldfactor = 1;
+        mbInPinch = false;
+    }
+
+    int width,hgt;
+    width = sceneRect().width();
+    hgt = sceneRect().height();
+    QScrollBar * psV = verticalScrollBar();
+    QScrollBar * psH = horizontalScrollBar();
+
+    int centery = (psV->value() + psV->size().height()/2)/beishu;
+    int centerx = (psH->value() + psH->size().width()/2)/beishu;
+
+    double fscale = currentStepScaleFactor/oldfactor;
+    scale(fscale,fscale);
+    beishu *= fscale;
+    oldfactor = currentStepScaleFactor;
+
+    centerOn(centerx,centery);
+
+}
+

+ 58 - 0
src/tool/map_collectfromveh/myview.h

@@ -0,0 +1,58 @@
+#ifndef MYVIEW_H
+#define MYVIEW_H
+
+#include <qtimer.h>
+#include <qpainter.h>
+#include <QGraphicsView>
+#include <QWheelEvent>
+#include <QKeyEvent>
+#include <QPoint>
+#include <QPointF>
+#include <QGraphicsItem>
+#include <QKeyEvent>
+
+#include <QGestureEvent>
+#include <QPinchGesture>
+
+
+
+class MyView : public QGraphicsView
+{
+    Q_OBJECT
+
+public:
+    explicit MyView(QWidget *parent =0);
+    qreal x, y, beishu;
+
+    void zoomone();
+protected:
+    void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+    void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+    void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+    void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+    void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+
+    bool event(QEvent *event) Q_DECL_OVERRIDE;
+public Q_SLOTS:
+    void zoomIn();  // 放大
+    void zoomOut();  // 缩小
+
+signals:
+    void dbclickxy(double x,double y);
+    void beishuchange(double beishu);
+
+private:
+    bool bottonstatus = false;
+    QPoint myview_lastMousePos;
+
+private:
+    bool gestureEvent(QGestureEvent *event);
+    void pinchTriggered(QPinchGesture*);
+
+    bool mbInPinch = false;
+
+
+
+};
+
+#endif // MYVIEW_H