Skip to content
Permalink
Browse files

Move georeferencer sources from plugins to app

  • Loading branch information
nyalldawson committed May 25, 2020
1 parent 788180c commit 80a29fd090f4e123469252220f7e00f6c7a55a64
Showing with 154 additions and 198 deletions.
  1. +4 −0 CMakeLists.txt
  2. +32 −0 src/app/CMakeLists.txt
  3. 0 src/{plugins → app}/georeferencer/georeferencer.qrc
  4. BIN src/{plugins → app}/georeferencer/icons/default/mActionAddGCPPoint.png
  5. BIN src/{plugins → app}/georeferencer/icons/default/mActionDeleteGCPPoint.png
  6. BIN src/{plugins → app}/georeferencer/icons/default/mActionFullHistogramStretch.png
  7. BIN src/{plugins → app}/georeferencer/icons/default/mActionGDALScript.png
  8. BIN src/{plugins → app}/georeferencer/icons/default/mActionInfoTabWidget.png
  9. BIN src/{plugins → app}/georeferencer/icons/default/mActionLinkGeorefToQGis.png
  10. BIN src/{plugins → app}/georeferencer/icons/default/mActionLinkGeorefToQGis.xcf
  11. BIN src/{plugins → app}/georeferencer/icons/default/mActionLinkQGisToGeoref.png
  12. BIN src/{plugins → app}/georeferencer/icons/default/mActionLinkQGisToGeoref.xcf
  13. BIN src/{plugins → app}/georeferencer/icons/default/mActionLoadGCPpoints.png
  14. BIN src/{plugins → app}/georeferencer/icons/default/mActionLocalHistogramStretch.png
  15. BIN src/{plugins → app}/georeferencer/icons/default/mActionMoveGCPPoint.png
  16. BIN src/{plugins → app}/georeferencer/icons/default/mActionOpenRaster.png
  17. BIN src/{plugins → app}/georeferencer/icons/default/mActionProjectProperties.png
  18. BIN src/{plugins → app}/georeferencer/icons/default/mActionSaveGCPpointsAs.png
  19. BIN src/{plugins → app}/georeferencer/icons/default/mActionSaveRasterAs.png
  20. BIN src/{plugins → app}/georeferencer/icons/default/mActionStartGeoref.png
  21. BIN src/{plugins → app}/georeferencer/icons/default/mActionTransformSettings.png
  22. BIN src/{plugins → app}/georeferencer/icons/default/mGeorefDescription.png
  23. BIN src/{plugins → app}/georeferencer/icons/default/mGeorefRun.png
  24. BIN src/{plugins → app}/georeferencer/icons/default/mPushButtonClipboard.png
  25. BIN src/{plugins → app}/georeferencer/icons/default/mPushButtonEditPaste.png
  26. BIN src/{plugins → app}/georeferencer/icons/default/mPushButtonFileOpen.png
  27. BIN src/{plugins → app}/georeferencer/icons/default/mPushButtonPencil.png
  28. BIN src/{plugins → app}/georeferencer/icons/default/mPushButtonTargetSRSDisabled.png
  29. BIN src/{plugins → app}/georeferencer/icons/default/mPushButtonTargetSRSEnabled.png
  30. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionAddGCPPoint.png
  31. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionDeleteGCPPoint.png
  32. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionGDALScript.png
  33. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionLoadGCPpoints.png
  34. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionMoveGCPPoint.png
  35. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionOpenRaster.png
  36. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionSaveGCPpointsAs.png
  37. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionStartGeoref.png
  38. BIN src/{plugins → app}/georeferencer/icons_old/default/mActionTransformSettings.png
  39. BIN src/{plugins → app}/georeferencer/icons_old/default/mGeorefRun.png
  40. 0 src/{plugins → app}/georeferencer/qgsgcpcanvasitem.cpp
  41. 0 src/{plugins → app}/georeferencer/qgsgcpcanvasitem.h
  42. 0 src/{plugins → app}/georeferencer/qgsgcplist.cpp
  43. 0 src/{plugins → app}/georeferencer/qgsgcplist.h
  44. 0 src/{plugins → app}/georeferencer/qgsgcplistmodel.cpp
  45. 0 src/{plugins → app}/georeferencer/qgsgcplistmodel.h
  46. +2 −1 src/{plugins → app}/georeferencer/qgsgcplistwidget.cpp
  47. 0 src/{plugins → app}/georeferencer/qgsgcplistwidget.h
  48. 0 src/{plugins → app}/georeferencer/qgsgeorefconfigdialog.cpp
  49. 0 src/{plugins → app}/georeferencer/qgsgeorefconfigdialog.h
  50. 0 src/{plugins → app}/georeferencer/qgsgeorefdatapoint.cpp
  51. 0 src/{plugins → app}/georeferencer/qgsgeorefdatapoint.h
  52. 0 src/{plugins → app}/georeferencer/qgsgeorefdelegates.cpp
  53. 0 src/{plugins → app}/georeferencer/qgsgeorefdelegates.h
  54. 0 src/{plugins → app}/georeferencer/qgsgeorefdescriptiondialog.cpp
  55. 0 src/{plugins → app}/georeferencer/qgsgeorefdescriptiondialog.h
  56. 0 src/{plugins → app}/georeferencer/qgsgeorefplugin.cpp
  57. 0 src/{plugins → app}/georeferencer/qgsgeorefplugin.h
  58. +2 −2 src/{plugins → app}/georeferencer/qgsgeorefplugingui.cpp
  59. 0 src/{plugins → app}/georeferencer/qgsgeorefplugingui.h
  60. 0 src/{plugins → app}/georeferencer/qgsgeoreftooladdpoint.cpp
  61. 0 src/{plugins → app}/georeferencer/qgsgeoreftooladdpoint.h
  62. 0 src/{plugins → app}/georeferencer/qgsgeoreftooldeletepoint.cpp
  63. 0 src/{plugins → app}/georeferencer/qgsgeoreftooldeletepoint.h
  64. 0 src/{plugins → app}/georeferencer/qgsgeoreftoolmovepoint.cpp
  65. 0 src/{plugins → app}/georeferencer/qgsgeoreftoolmovepoint.h
  66. +1 −1 src/{plugins → app}/georeferencer/qgsgeoreftransform.cpp
  67. 0 src/{plugins → app}/georeferencer/qgsgeoreftransform.h
  68. 0 src/{plugins → app}/georeferencer/qgsgeorefvalidators.cpp
  69. 0 src/{plugins → app}/georeferencer/qgsgeorefvalidators.h
  70. 0 src/{plugins → app}/georeferencer/qgsimagewarper.cpp
  71. 0 src/{plugins → app}/georeferencer/qgsimagewarper.h
  72. 0 src/{plugins → app}/georeferencer/qgsleastsquares.cpp
  73. 0 src/{plugins → app}/georeferencer/qgsleastsquares.h
  74. 0 src/{plugins → app}/georeferencer/qgsmapcoordsdialog.cpp
  75. 0 src/{plugins → app}/georeferencer/qgsmapcoordsdialog.h
  76. 0 src/{plugins → app}/georeferencer/qgsrasterchangecoords.cpp
  77. 0 src/{plugins → app}/georeferencer/qgsrasterchangecoords.h
  78. 0 src/{plugins → app}/georeferencer/qgsresidualplotitem.cpp
  79. 0 src/{plugins → app}/georeferencer/qgsresidualplotitem.h
  80. +1 −1 src/{plugins → app}/georeferencer/qgstransformsettingsdialog.cpp
  81. 0 src/{plugins → app}/georeferencer/qgstransformsettingsdialog.h
  82. +76 −0 src/app/georeferencer/qgsvalidateddoublespinbox.cpp
  83. +33 −0 src/app/georeferencer/qgsvalidateddoublespinbox.h
  84. +0 −4 src/plugins/CMakeLists.txt
  85. +0 −102 src/plugins/georeferencer/CMakeLists.txt
  86. +0 −86 src/plugins/georeferencer/qgsvalidateddoublespinbox.h
  87. +2 −0 src/ui/CMakeLists.txt
  88. 0 src/{plugins → ui}/georeferencer/qgsgeorefconfigdialogbase.ui
  89. 0 src/{plugins → ui}/georeferencer/qgsgeorefdescriptiondialogbase.ui
  90. 0 src/{plugins → ui}/georeferencer/qgsgeorefpluginguibase.ui
  91. 0 src/{plugins → ui}/georeferencer/qgsmapcoordsdialogbase.ui
  92. +1 −1 src/{plugins → ui}/georeferencer/qgstransformsettingsdialogbase.ui
  93. 0 src/{plugins → ui}/georeferencer/qgstransformtypedialogbase.ui
@@ -637,6 +637,10 @@ ADD_DEFINITIONS(-DQT_DEPRECATED_WARNINGS)
# Unfortunately Qwt uses deprecated QString::null in headers, preventing this being raised above 5.8
ADD_DEFINITIONS(-DQT_DISABLE_DEPRECATED_BEFORE=0x050800)

IF (WITH_GEOREFERENCER)
FIND_PACKAGE(GSL REQUIRED)
ENDIF (WITH_GEOREFERENCER)

IF(ENABLE_COVERAGE)
INCLUDE("cmake/modules/coverage/CodeCoverage.cmake")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage --coverage")
@@ -175,6 +175,29 @@ SET(QGIS_APP_SRCS
devtools/profiler/qgsprofilerpanelwidget.cpp
devtools/profiler/qgsprofilerwidgetfactory.cpp

georeferencer/qgsgcpcanvasitem.cpp
georeferencer/qgsgeorefconfigdialog.cpp
georeferencer/qgsgeorefdatapoint.cpp
georeferencer/qgsgeorefdelegates.cpp
georeferencer/qgsgeorefdescriptiondialog.cpp
georeferencer/qgsgeorefplugin.cpp
georeferencer/qgsgeorefplugingui.cpp
georeferencer/qgsgeoreftooladdpoint.cpp
georeferencer/qgsgeoreftooldeletepoint.cpp
georeferencer/qgsgeoreftoolmovepoint.cpp
georeferencer/qgsgeorefvalidators.cpp
georeferencer/qgsleastsquares.cpp
georeferencer/qgsmapcoordsdialog.cpp
georeferencer/qgsresidualplotitem.cpp
georeferencer/qgstransformsettingsdialog.cpp
georeferencer/qgsgcplist.cpp
georeferencer/qgsgcplistmodel.cpp
georeferencer/qgsimagewarper.cpp
georeferencer/qgsgeoreftransform.cpp
georeferencer/qgsgcplistwidget.cpp
georeferencer/qgsrasterchangecoords.cpp
georeferencer/qgsvalidateddoublespinbox.cpp

labeling/qgslabelpropertydialog.cpp
labeling/qgsmaptoolchangelabelproperties.cpp
labeling/qgsmaptoolpinlabels.cpp
@@ -581,6 +604,15 @@ IF (WITH_3D)
)
ENDIF (WITH_3D)

IF (WITH_GEOREFERENCER)
INCLUDE_DIRECTORIES(SYSTEM
${GSL_INCLUDE_DIR}
)
TARGET_LINK_LIBRARIES(qgis_app
${GSL_LIBRARIES}
)
ENDIF (WITH_GEOREFERENCER)

GENERATE_EXPORT_HEADER(
qgis_app
BASE_NAME APP
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -91,7 +91,8 @@ void QgsGCPListWidget::updateGCPList()

void QgsGCPListWidget::closeEditors()
{
Q_FOREACH ( const QModelIndex &index, selectedIndexes() )
const QModelIndexList selection = selectedIndexes();
for ( const QModelIndex &index : selection )
{
closePersistentEditor( index );
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1280,7 +1280,7 @@ void QgsGeorefPluginGui::saveGCPs()
{
QTextStream points( &pointFile );
points << "mapX,mapY,pixelX,pixelY,enable,dX,dY,residual" << endl;
Q_FOREACH ( QgsGeorefDataPoint *pt, mPoints )
for ( QgsGeorefDataPoint *pt : qgis::as_const( mPoints ) )
{
points << QStringLiteral( "%1,%2,%3,%4,%5,%6,%7,%8" )
.arg( qgsDoubleToString( pt->mapCoords().x() ),
@@ -1863,7 +1863,7 @@ QString QgsGeorefPluginGui::generateGDALtranslateCommand( bool generateTFW )
gdalCommand << QStringLiteral( "-co TFW=YES" );
}

Q_FOREACH ( QgsGeorefDataPoint *pt, mPoints )
for ( QgsGeorefDataPoint *pt : qgis::as_const( mPoints ) )
{
gdalCommand << QStringLiteral( "-gcp %1 %2 %3 %4" ).arg( pt->pixelCoords().x() ).arg( -pt->pixelCoords().y() )
.arg( pt->mapCoords().x() ).arg( pt->mapCoords().y() );
File renamed without changes.
@@ -577,7 +577,7 @@ bool QgsProjectiveGeorefTransform::updateParametersFromGCPs( const QVector<QgsPo
// HACK: flip y coordinates, because georeferencer and gdal use different conventions
QVector<QgsPointXY> flippedPixelCoords;
flippedPixelCoords.reserve( pixelCoords.size() );
Q_FOREACH ( const QgsPointXY &coord, pixelCoords )
for ( const QgsPointXY &coord : pixelCoords )
{
flippedPixelCoords << QgsPointXY( coord.x(), -coord.y() );
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -95,7 +95,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( const QString &raster, c
mListCompression.append( QStringLiteral( "PACKBITS" ) );
mListCompression.append( QStringLiteral( "DEFLATE" ) );
QStringList listCompressionTr;
Q_FOREACH ( const QString &item, mListCompression )
for ( const QString &item : qgis::as_const( mListCompression ) )
{
listCompressionTr.append( tr( item.toLatin1().data() ) );
}
@@ -0,0 +1,76 @@
/***************************************************************************
qgsvalidateddoublespinbox.cpp
--------------------------------------
Date : 23-Feb-2010
Copyright : (c) 2010 by Manuel Massing
Email : m.massing at warped-space.de
***************************************************************************
* *
* 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 "qgsvalidateddoublespinbox.h"

QgsValidatedDoubleSpinBox::QgsValidatedDoubleSpinBox( QWidget *widget )
: QDoubleSpinBox( widget )
{ }

QValidator::State QgsValidatedDoubleSpinBox::validate( QString &input, int &pos ) const
{
QValidator::State state = QDoubleSpinBox::validate( input, pos );
if ( state != QValidator::Acceptable )
{
return state;
}

// A value of zero is acceptable as intermediate result,
// but not as final entry
double val = valueFromText( input );
if ( val == 0.0 )
{
return QValidator::Intermediate;
}
return QValidator::Acceptable;
}

QAbstractSpinBox::StepEnabled QgsValidatedDoubleSpinBox::stepEnabled() const
{
StepEnabled mayStep = StepNone;

// Zero is off limits, so handle the logic differently
// (always exclude zero from the permitted interval)
if ( minimum() == 0.0 )
{
if ( value() - singleStep() > minimum() )
{
mayStep |= StepDownEnabled;
}
}
else // closed interval
{
if ( value() - singleStep() >= minimum() )
{
mayStep |= StepDownEnabled;
}
}

if ( maximum() == 0.0 )
{
if ( value() + singleStep() < maximum() )
{
mayStep |= StepUpEnabled;
}
}
else
{
if ( value() + singleStep() <= maximum() )
{
mayStep |= StepUpEnabled;
}
}
return mayStep;
}
@@ -0,0 +1,33 @@
/***************************************************************************
qgsvalidateddoublespinbox.h - Simple extension to QDoubleSpinBox which
implements a validate function to disallow zero as input.
--------------------------------------
Date : 23-Feb-2010
Copyright : (c) 2010 by Manuel Massing
Email : m.massing at warped-space.de
***************************************************************************
* *
* 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. *
* *
***************************************************************************/

#ifndef QGSVALIDATEDDOUBLESPINBOX_H
#define QGSVALIDATEDDOUBLESPINBOX_H

#include <QDoubleSpinBox>

class QgsValidatedDoubleSpinBox : public QDoubleSpinBox
{
Q_OBJECT

public:
QgsValidatedDoubleSpinBox( QWidget *widget );

QValidator::State validate( QString &input, int &pos ) const override;
StepEnabled stepEnabled() const override;
};

#endif
@@ -16,10 +16,6 @@ IF (GRASS_FOUND)
ADD_SUBDIRECTORY(grass)
ENDIF (GRASS_FOUND)

IF (WITH_GEOREFERENCER)
ADD_SUBDIRECTORY(georeferencer)
ENDIF (WITH_GEOREFERENCER)

IF (CUSTOM_PLUGINS)
ADD_SUBDIRECTORY(${CUSTOM_PLUGINS})
ENDIF (CUSTOM_PLUGINS)

This file was deleted.

0 comments on commit 80a29fd

Please sign in to comment.
You can’t perform that action at this time.