-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgsinterpolationplugin.cpp
104 lines (85 loc) · 3.1 KB
/
qgsinterpolationplugin.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/***************************************************************************
qgsinterpolationplugin.cpp
--------------------------
begin : Marco 10, 2008
copyright : (C) 2008 by Marco Hugentobler
email : marco dot hugentobler at karto dot baug dot ethz dot ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgsapplication.h"
#include "qgsinterpolationplugin.h"
#include "qgisinterface.h"
#include "qgsinterpolationdialog.h"
#include <QFile>
static const QString name_ = QObject::tr( "Interpolation plugin" );
static const QString description_ = QObject::tr( "A plugin for interpolation based on vertices of a vector layer" );
static const QString category_ = QObject::tr( "Raster" );
static const QString version_ = QObject::tr( "Version 0.001" );
static const QString icon_ = ":/raster-interpolate.png";
QgsInterpolationPlugin::QgsInterpolationPlugin( QgisInterface* iface ): mIface( iface ), mInterpolationAction( 0 )
{
}
QgsInterpolationPlugin::~QgsInterpolationPlugin()
{
}
void QgsInterpolationPlugin::initGui()
{
if ( mIface )
{
mInterpolationAction = new QAction( QIcon( ":/raster-interpolate.png" ), tr( "&Interpolation" ), 0 );
mInterpolationAction->setObjectName( "mInterpolationAction" );
QObject::connect( mInterpolationAction, SIGNAL( triggered() ), this, SLOT( showInterpolationDialog() ) );
mIface->addRasterToolBarIcon( mInterpolationAction );
mIface->addPluginToRasterMenu( tr( "&Interpolation" ), mInterpolationAction );
}
}
void QgsInterpolationPlugin::unload()
{
mIface->removePluginRasterMenu( tr( "&Interpolation" ), mInterpolationAction );
mIface->removeRasterToolBarIcon( mInterpolationAction );
delete mInterpolationAction;
}
void QgsInterpolationPlugin::showInterpolationDialog()
{
QgsInterpolationDialog dialog( mIface->mainWindow(), mIface );
dialog.exec();
}
QGISEXTERN QgisPlugin * classFactory( QgisInterface * theQgisInterfacePointer )
{
return new QgsInterpolationPlugin( theQgisInterfacePointer );
}
QGISEXTERN QString name()
{
return name_;
}
QGISEXTERN QString description()
{
return description_;
}
QGISEXTERN QString category()
{
return category_;
}
QGISEXTERN QString version()
{
return version_;
}
QGISEXTERN QString icon()
{
return icon_;
}
QGISEXTERN int type()
{
return QgisPlugin::UI;
}
QGISEXTERN void unload( QgisPlugin* theInterpolationPluginPointer )
{
delete theInterpolationPluginPointer;
}