fix
1、基于新框架实现点击显示光谱; 2、影像拉伸显示优化; 3、右键菜单新增:移除所有栅格图层;
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
#include <QWheelEvent>
|
||||
#include <QPoint>
|
||||
@ -130,7 +131,19 @@ void Mapcavas::mousePressEvent(QMouseEvent *event)
|
||||
m_bMouseTranslate = true;
|
||||
m_lastMousePos = event->pos();
|
||||
|
||||
emit leftMouseButtonPressed(mapToScene(m_lastMousePos).x(), mapToScene(m_lastMousePos).y());
|
||||
const QPointF scenePt = mapToScene(m_lastMousePos);
|
||||
const int x = static_cast<int>(std::floor(scenePt.x()));
|
||||
const int y = static_cast<int>(std::floor(scenePt.y()));
|
||||
|
||||
if (m_rasterLayer && m_rasterLayer->isValidPixel(x, y))
|
||||
{
|
||||
QVector<double> wavelengths;
|
||||
QVector<double> spectrum;
|
||||
if (m_rasterLayer->readPixelSpectrum(x, y, wavelengths, spectrum))
|
||||
{
|
||||
emit leftMouseButtonPressed(x, y, wavelengths, spectrum);
|
||||
}
|
||||
}
|
||||
}
|
||||
QGraphicsView::mousePressEvent(event);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user