1、为图层添加渲染器和读取器,分离图层基础信息、渲染和读写;

2、LayerTreeLayerNode持有MapLayer图层引用,为右键菜单做准备;
3、改名:imageviewer → mapcavas,mapcavas持有MapLayer图层引用,为刷新图像做准备;
This commit is contained in:
tangchao0503
2026-02-25 15:08:06 +08:00
parent e3b2d136d3
commit bdf956ed99
13 changed files with 659 additions and 286 deletions

View File

@ -1,15 +1,18 @@
#ifndef IMAGE_VIEWER
#define IMAGE_VIEWER
#ifndef MAPCAVAS_H
#define MAPCAVAS_H
#include "QGraphicsView"
#include "qlabel.h"
class ImageViewer :public QGraphicsView
class RasterLayer; // forward
class mapcavas : public QGraphicsView
{
Q_OBJECT
public:
ImageViewer(QWidget* pParent = NULL);
~ImageViewer();
mapcavas(QWidget* pParent = NULL);
~mapcavas();
void DisplayFrameNumber(int frameNumber);
@ -38,12 +41,18 @@ public:
// <20><><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>
void setZoomDelta(qreal delta);
qreal zoomDelta() const;
// new: set raster layer and refresh map
void setLayers(RasterLayer* layer);
void freshmap();
protected:
QGraphicsScene *m_qtGraphicsScene;
private:
QGraphicsPixmapItem *m_GraphicsPixmapItemHandle;
QLabel *m_framNumberLabel;//<2F><>ʾʵʱ<CAB5>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1>
RasterLayer* m_rasterLayer = nullptr; // associated raster layer
qreal m_translateSpeed; // ƽ<><C6BD><EFBFBD>ٶ<EFBFBD>
qreal m_zoomDelta; // <20><><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>