Skip to content
Permalink
Browse files

Merge pull request #1624 from 3nids/cadtool_single

Advanced digitizing tools (aka CAD tools)
  • Loading branch information
3nids committed Dec 9, 2014
2 parents 2b1b79d + d39a854 commit d65a6f73d4f3db3dd947f103d3b679060ac1e644
Showing with 2,771 additions and 138 deletions.
  1. +6 −0 images/images.qrc
  2. BIN images/themes/default/cadtools/cad.png
  3. BIN images/themes/default/cadtools/construction.png
  4. BIN images/themes/default/cadtools/delta.png
  5. BIN images/themes/default/cadtools/lock.png
  6. BIN images/themes/default/cadtools/parallel.png
  7. BIN images/themes/default/cadtools/perpendicular.png
  8. +1 −0 python/core/qgsmaptopixel.sip
  9. +6 −0 src/app/CMakeLists.txt
  10. +18 −0 src/app/qgisapp.cpp
  11. +10 −0 src/app/qgisapp.h
  12. +1 −0 src/app/qgisappinterface.cpp
  13. +265 −0 src/app/qgsadvanceddigitizingcanvasitem.cpp
  14. +47 −0 src/app/qgsadvanceddigitizingcanvasitem.h
  15. +1,208 −0 src/app/qgsadvanceddigitizingdockwidget.cpp
  16. +264 −0 src/app/qgsadvanceddigitizingdockwidget.h
  17. +119 −0 src/app/qgsmapmouseevent.cpp
  18. +70 −0 src/app/qgsmapmouseevent.h
  19. +13 −18 src/app/qgsmaptooladdfeature.cpp
  20. +1 −1 src/app/qgsmaptooladdfeature.h
  21. +3 −3 src/app/qgsmaptooladdpart.cpp
  22. +2 −1 src/app/qgsmaptooladdpart.h
  23. +2 −2 src/app/qgsmaptooladdring.cpp
  24. +2 −1 src/app/qgsmaptooladdring.h
  25. +123 −0 src/app/qgsmaptooladvanceddigitizing.cpp
  26. +98 −0 src/app/qgsmaptooladvanceddigitizing.h
  27. +50 −52 src/app/qgsmaptoolcapture.cpp
  28. +8 −24 src/app/qgsmaptoolcapture.h
  29. +2 −4 src/app/qgsmaptooledit.cpp
  30. +5 −8 src/app/qgsmaptooledit.h
  31. +2 −4 src/app/qgsmaptoolfillring.cpp
  32. +3 −2 src/app/qgsmaptoolfillring.h
  33. +2 −4 src/app/qgsmaptoolreshape.cpp
  34. +2 −1 src/app/qgsmaptoolreshape.h
  35. +2 −2 src/app/qgsmaptoolsplitfeatures.cpp
  36. +2 −1 src/app/qgsmaptoolsplitfeatures.h
  37. +2 −2 src/app/qgsmaptoolsplitparts.cpp
  38. +2 −1 src/app/qgsmaptoolsplitparts.h
  39. +1 −0 src/core/qgsmaptopixel.h
  40. +7 −1 src/core/qgssnapper.cpp
  41. +9 −1 src/core/qgssnapper.h
  42. +7 −3 src/gui/qgsmapcanvas.cpp
  43. +7 −2 src/gui/qgsmapcanvassnapper.cpp
  44. +1 −0 src/gui/qgsmapcanvassnapper.h
  45. +398 −0 src/ui/qgsadvanceddigitizingdockwidgetbase.ui
@@ -470,6 +470,12 @@
<file>themes/default/mActionScaleHighlightFeature.svg</file>
<file>themes/default/mActionPanHighlightFeature.svg</file>
<file>flags/sr@latin.png</file>
<file>themes/default/cadtools/construction.png</file>
<file>themes/default/cadtools/delta.png</file>
<file>themes/default/cadtools/cad.png</file>
<file>themes/default/cadtools/lock.png</file>
<file>themes/default/cadtools/parallel.png</file>
<file>themes/default/cadtools/perpendicular.png</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -64,6 +64,7 @@ class QgsMapToPixel
QgsPoint toMapCoordinates( QPoint p ) const;

QgsPoint toMapPoint( double x, double y ) const;

/*! Set map units per pixel
* @param mapUnitsPerPixel Map units per pixel
*/
@@ -14,6 +14,8 @@ SET(QGIS_APP_SRCS
qgsattributetabledialog.cpp
qgsbookmarks.cpp
qgsbrowserdockwidget.cpp
qgsadvanceddigitizingdockwidget.cpp
qgsadvanceddigitizingcanvasitem.cpp
qgsclipboard.cpp
qgsconfigureshortcutsdialog.cpp
qgscustomization.cpp
@@ -43,6 +45,7 @@ SET(QGIS_APP_SRCS
qgslabelinggui.cpp
qgslabelpreview.cpp
qgsloadstylefromdbdialog.cpp
qgsmapmouseevent.cpp
qgssavestyletodbdialog.cpp
qgsguivectorlayertools.cpp

@@ -63,6 +66,7 @@ SET(QGIS_APP_SRCS
qgsmaptoolshowhidelabels.cpp
qgsmaptoolidentifyaction.cpp
qgsmaptoollabel.cpp
qgsmaptooladvanceddigitizing.cpp
qgsmaptoolmeasureangle.cpp
qgsmaptoolmovefeature.cpp
qgsmaptoolmovelabel.cpp
@@ -167,6 +171,7 @@ SET (QGIS_APP_MOC_HDRS
qgsattributetabledialog.h
qgsbookmarks.h
qgsbrowserdockwidget.h
qgsadvanceddigitizingdockwidget.h
qgsclipboard.h
qgsconfigureshortcutsdialog.h
qgscustomization.h
@@ -211,6 +216,7 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptoolpinlabels.h
qgsmaptoolshowhidelabels.h
qgsmaptoolidentifyaction.h
qgsmaptooladvanceddigitizing.h
qgsmaptoolmeasureangle.h
qgsmaptoolmovefeature.h
qgsmaptoolmovelabel.h
@@ -105,6 +105,7 @@
#include "qgsattributetabledialog.h"
#include "qgsbookmarks.h"
#include "qgsbrowserdockwidget.h"
#include "qgsadvanceddigitizingdockwidget.h"
#include "qgsclipboard.h"
#include "qgscomposer.h"
#include "qgscomposermanager.h"
@@ -584,6 +585,10 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mUndoWidget = new QgsUndoWidget( NULL, mMapCanvas );
mUndoWidget->setObjectName( "Undo" );

// Advanced Digitizing dock
mAdvancedDigitizingDockWidget = new QgsAdvancedDigitizingDockWidget( mMapCanvas, this );
mAdvancedDigitizingDockWidget->setObjectName( "Cad" );

createActions();
createActionGroups();
createMenus();
@@ -620,6 +625,9 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget2 );
mBrowserWidget2->hide();

addDockWidget( Qt::LeftDockWidgetArea, mAdvancedDigitizingDockWidget );
mAdvancedDigitizingDockWidget->hide();

// create the GPS tool on starting QGIS - this is like the browser
mpGpsWidget = new QgsGPSInformationWidget( mMapCanvas );
//create the dock widget
@@ -1632,6 +1640,11 @@ void QgisApp::createToolBars()
actionWhatsThis->setIcon( QgsApplication::getThemeIcon( "/mActionWhatsThis.svg" ) );
mHelpToolBar->addAction( actionWhatsThis );

// Cad toolbar
QAction* cadAction = mAdvancedDigitizingDockWidget->toggleViewAction();
cadAction->setText( tr( "Show CAD tools" ) );
cadAction->setIcon( QgsApplication::getThemeIcon( "/cadtools/cad.png" ) );
mAdvancedDigitizeToolBar->insertAction( mActionUndo, cadAction );
}

void QgisApp::createStatusBar()
@@ -4844,6 +4857,11 @@ void QgisApp::labeling()
activateDeactivateLayerRelatedActions( vlayer );
}

void QgisApp::setCadDockVisible( bool visible )
{
mAdvancedDigitizingDockWidget->setVisible( visible );
}

void QgisApp::fieldCalculator()
{
QgsVectorLayer *myLayer = qobject_cast<QgsVectorLayer *>( activeLayer() );
@@ -54,6 +54,7 @@ class QgsMapCanvas;
class QgsMapLayer;
class QgsMapTip;
class QgsMapTool;
class QgsMapToolAdvancedDigitizing;
class QgsPoint;
class QgsProviderRegistry;
class QgsPythonUtils;
@@ -68,6 +69,7 @@ class QNetworkProxy;
class QAuthenticator;

class QgsBrowserDockWidget;
class QgsAdvancedDigitizingDockWidget;
class QgsSnappingDialog;
class QgsGPSInformationWidget;

@@ -420,6 +422,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QToolBar *databaseToolBar() { return mDatabaseToolBar; }
QToolBar *webToolBar() { return mWebToolBar; }

//! return CAD dock widget
QgsAdvancedDigitizingDockWidget* cadDockWidget() { return mAdvancedDigitizingDockWidget; }

//! show layer properties
void showLayerProperties( QgsMapLayer *ml );

@@ -1090,6 +1095,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! shows label settings dialog (for labeling-ng)
void labeling();

//! set the CAD dock widget visible
void setCadDockVisible( bool visible );

/** Check if deprecated labels are used in project, and flag projects that use them */
void checkForDeprecatedLabelsInProject();

@@ -1543,6 +1551,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsBrowserDockWidget* mBrowserWidget;
QgsBrowserDockWidget* mBrowserWidget2;

QgsAdvancedDigitizingDockWidget* mAdvancedDigitizingDockWidget;

QgsSnappingDialog* mSnappingDialog;

QgsPluginManager* mPluginManager;
@@ -32,6 +32,7 @@
#include "qgscomposerview.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
#include "qgsmaptooladvanceddigitizing.h"
#include "qgsmapcanvas.h"
#include "qgsproject.h"
#include "qgslayertreeview.h"

0 comments on commit d65a6f7

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