初步实现maptool,有很多细节没有做好
This commit is contained in:
@ -1023,7 +1023,7 @@ void HPPA::initMapTools()
|
||||
connect(ui.mActionSpectral, SIGNAL(triggered()), this, SLOT(onMapToolSpectralTriggered()));
|
||||
|
||||
// Default tool: pan
|
||||
ui.mActionPan->trigger();
|
||||
//ui.mActionPan->trigger();
|
||||
}
|
||||
|
||||
void HPPA::onMapToolPanTriggered()
|
||||
|
||||
@ -818,7 +818,7 @@ QPushButton:pressed
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mapToolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
<string>图像查看</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
|
||||
@ -208,9 +208,9 @@
|
||||
<QtMoc Include="MapLayerStore.h" />
|
||||
<ClInclude Include="LayerTreeView.h" />
|
||||
<QtMoc Include="LayerTreeViewMenuProvider.h" />
|
||||
<ClInclude Include="MapTool.h" />
|
||||
<ClInclude Include="MapToolPan.h" />
|
||||
<ClInclude Include="MapToolSpectral.h" />
|
||||
<QtMoc Include="MapTool.h" />
|
||||
<QtMoc Include="MapToolPan.h" />
|
||||
<QtMoc Include="MapToolSpectral.h" />
|
||||
<ClInclude Include="RasterDataProvider.h" />
|
||||
<ClInclude Include="RasterRenderer.h" />
|
||||
<ClInclude Include="utility_tc.h" />
|
||||
|
||||
@ -291,6 +291,15 @@
|
||||
<QtMoc Include="imageControl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="MapToolSpectral.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="MapToolPan.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="MapTool.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="imageProcessor.h">
|
||||
@ -332,15 +341,6 @@
|
||||
<ClInclude Include="LayerTreeView.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MapTool.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MapToolPan.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MapToolSpectral.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="FocusDialog.ui">
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "MapTool.h"
|
||||
#include "ImageViewer.h"
|
||||
#include <QAction>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef MAPTOOL_H
|
||||
#ifndef MAPTOOL_H
|
||||
#define MAPTOOL_H
|
||||
|
||||
#include <QObject>
|
||||
@ -25,23 +25,18 @@ public:
|
||||
|
||||
virtual Flags flags() const { return NoFlags; }
|
||||
|
||||
// Associated action <20>C used to auto-check / uncheck when tool is activated / deactivated
|
||||
QAction* action() const;
|
||||
void setAction(QAction* action);
|
||||
|
||||
// Canvas this tool operates on
|
||||
Mapcavas* canvas() const;
|
||||
|
||||
// Cursor shown when tool is active
|
||||
virtual void setCursor(const QCursor& cursor);
|
||||
QCursor cursor() const;
|
||||
|
||||
// Lifecycle
|
||||
virtual void activate();
|
||||
virtual void deactivate();
|
||||
bool isActive() const;
|
||||
|
||||
// Mouse event handlers <20>C return true if event was handled
|
||||
virtual void canvasMousePressEvent(QMouseEvent* e);
|
||||
virtual void canvasMouseReleaseEvent(QMouseEvent* e);
|
||||
virtual void canvasMouseMoveEvent(QMouseEvent* e);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "MapToolPan.h"
|
||||
#include "ImageViewer.h"
|
||||
#include <QMouseEvent>
|
||||
@ -10,6 +10,10 @@ MapToolPan::MapToolPan(Mapcavas* canvas, QObject* parent)
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
}
|
||||
|
||||
MapToolPan::~MapToolPan()
|
||||
{
|
||||
}
|
||||
|
||||
void MapToolPan::activate()
|
||||
{
|
||||
MapTool::activate();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef MAPTOOLPAN_H
|
||||
#ifndef MAPTOOLPAN_H
|
||||
#define MAPTOOLPAN_H
|
||||
|
||||
#include "MapTool.h"
|
||||
@ -10,6 +10,7 @@ class MapToolPan : public MapTool
|
||||
|
||||
public:
|
||||
MapToolPan(Mapcavas* canvas, QObject* parent = nullptr);
|
||||
~MapToolPan();
|
||||
|
||||
void activate() override;
|
||||
void deactivate() override;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "MapToolSpectral.h"
|
||||
#include "ImageViewer.h"
|
||||
#include "RasterLayer.h"
|
||||
@ -11,6 +11,10 @@ MapToolSpectral::MapToolSpectral(Mapcavas* canvas, QObject* parent)
|
||||
setCursor(Qt::CrossCursor);
|
||||
}
|
||||
|
||||
MapToolSpectral::~MapToolSpectral()
|
||||
{
|
||||
}
|
||||
|
||||
void MapToolSpectral::canvasMousePressEvent(QMouseEvent* e)
|
||||
{
|
||||
if (e->button() != Qt::LeftButton)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef MAPTOOLSPECTRAL_H
|
||||
#ifndef MAPTOOLSPECTRAL_H
|
||||
#define MAPTOOLSPECTRAL_H
|
||||
|
||||
#include "MapTool.h"
|
||||
@ -10,6 +10,7 @@ class MapToolSpectral : public MapTool
|
||||
|
||||
public:
|
||||
MapToolSpectral(Mapcavas* canvas, QObject* parent = nullptr);
|
||||
~MapToolSpectral();
|
||||
|
||||
void canvasMousePressEvent(QMouseEvent* e) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user