Skip to content
Permalink
Browse files

Merge branch 'master' into colour_functions

  • Loading branch information
ccrook committed Apr 15, 2013
2 parents c62c396 + 268c037 commit 4cb0ae56d1c86e53355a0054692b8effd96fd7f5
Showing with 2,458 additions and 2,878 deletions.
  1. +3 −1 doc/AUTHORS
  2. +83 −4 python/core/qgspallabeling.sip
  3. +25 −0 python/core/qgsvectorlayer.sip
  4. +1 −1 python/core/raster/qgsrasterblock.sip
  5. +5 −0 python/core/symbology-ng/qgssymbollayerv2utils.sip
  6. +1 −0 python/gui/qgscollapsiblegroupbox.sip
  7. +1 −1 python/plugins/sextante/algs/ftools/ConvexHull.py
  8. +1 −1 python/plugins/sextante/algs/ftools/ReprojectLayer.py
  9. +1 −1 python/plugins/sextante/gdal/OgrAlgorithm.py
  10. +17 −17 python/plugins/sextante/gdal/ogr2ogr.py
  11. +8 −8 python/plugins/sextante/grass/GrassAlgorithm.py
  12. +2 −2 python/plugins/sextante/grass/GrassAlgorithmProvider.py
  13. +2 −2 python/plugins/sextante/grass/GrassUtils.py
  14. +1 −1 python/plugins/sextante/gui/MissingDependencyDialog.py
  15. +6 −6 python/plugins/sextante/modeler/ModelerParametersDialog.py
  16. +4 −4 python/plugins/sextante/modeler/SaveAsPythonScriptAction.py
  17. +5 −5 python/plugins/sextante/parameters/ParameterTableField.py
  18. +3 −3 python/plugins/sextante/saga/SagaAlgorithm.py
  19. +1 −1 python/plugins/sextante/saga/SagaUtils.py
  20. +9 −9 python/plugins/sextante/tests/GdalTest.py
  21. +5 −5 python/plugins/sextante/tests/GeoAlgorithmTest.py
  22. +7 −7 python/plugins/sextante/tests/ModelerAlgorithmTest.py
  23. +3 −3 python/plugins/sextante/tests/QgisAlgsTest.py
  24. +1 −1 python/plugins/sextante/tests/SagaTest.py
  25. +2 −2 python/plugins/sextante/tests/ScriptTest.py
  26. +2 −2 python/plugins/sextante/tests/SextanteTests.py
  27. +16 −16 python/plugins/sextante/tests/SextanteToolsTest.py
  28. +4 −4 python/plugins/sextante/tools/vector.py
  29. +5 −8 src/app/qgisapp.cpp
  30. +2 −2 src/app/qgisappinterface.cpp
  31. +3 −3 src/app/qgsaddtaborgroup.cpp
  32. +1 −1 src/app/qgsaddtaborgroup.h
  33. +2 −2 src/app/qgsattributetabledialog.cpp
  34. +3 −3 src/app/qgsfieldsproperties.cpp
  35. +13 −13 src/app/qgsidentifyresultsdialog.cpp
  36. +4 −5 src/app/qgsidentifyresultsdialog.h
  37. +3 −2 src/app/qgslabelengineconfigdialog.cpp
  38. +34 −1 src/app/qgslabelinggui.cpp
  39. +7 −1 src/app/qgslabelpreview.cpp
  40. +19 −111 src/app/qgsrasterlayerproperties.cpp
  41. +0 −9 src/app/qgsrasterlayerproperties.h
  42. +1 −1 src/core/composer/qgscomposerlabel.cpp
  43. +2 −2 src/core/composer/qgscomposerlegend.cpp
  44. +1 −2 src/core/qgscachedfeatureiterator.cpp
  45. +432 −64 src/core/qgspallabeling.cpp
  46. +123 −4 src/core/qgspallabeling.h
  47. +1 −1 src/core/qgsproject.cpp
  48. +1 −1 src/core/qgsproject.h
  49. +7 −3 src/core/qgsvectorlayer.cpp
  50. +30 −0 src/core/qgsvectorlayer.h
  51. +7 −2 src/core/qgsvectorlayercache.cpp
  52. +3 −3 src/core/qgsvectorlayercache.h
  53. +1 −1 src/core/qgsvectorlayerfeatureiterator.cpp
  54. +1 −1 src/core/raster/qgspalettedrasterrenderer.cpp
  55. +25 −24 src/core/raster/qgsrasterblock.cpp
  56. +51 −73 src/core/raster/qgsrasterblock.h
  57. +2 −2 src/core/raster/qgsrasterdataprovider.cpp
  58. +9 −9 src/core/raster/qgsrasteridentifyresult.cpp
  59. +5 −5 src/core/raster/qgsrasterrange.cpp
  60. +2 −2 src/core/raster/qgsrasterrange.h
  61. +52 −584 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
  62. +0 −46 src/core/symbology-ng/qgsfillsymbollayerv2.h
  63. +34 −341 src/core/symbology-ng/qgslinesymbollayerv2.cpp
  64. +0 −36 src/core/symbology-ng/qgslinesymbollayerv2.h
  65. +56 −491 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
  66. +0 −38 src/core/symbology-ng/qgsmarkersymbollayerv2.h
  67. +125 −0 src/core/symbology-ng/qgssymbollayerv2.cpp
  68. +15 −7 src/core/symbology-ng/qgssymbollayerv2.h
  69. +76 −0 src/core/symbology-ng/qgssymbollayerv2utils.cpp
  70. +5 −0 src/core/symbology-ng/qgssymbollayerv2utils.h
  71. +1 −1 src/core/symbology-ng/qgssymbologyv2conversion.cpp
  72. +1 −1 src/gui/attributetable/qgsattributetabledelegate.h
  73. +29 −3 src/gui/attributetable/qgsattributetablefiltermodel.cpp
  74. +1 −1 src/gui/attributetable/qgsattributetablefiltermodel.h
  75. +20 −34 src/gui/attributetable/qgsattributetablemodel.cpp
  76. +2 −8 src/gui/attributetable/qgsattributetablemodel.h
  77. +39 −46 src/gui/attributetable/qgsattributetableview.cpp
  78. +34 −16 src/gui/attributetable/qgsdualview.cpp
  79. +76 −18 src/gui/attributetable/qgsdualview.h
  80. +2 −2 src/gui/attributetable/qgsfeaturelistmodel.cpp
  81. +15 −15 src/gui/attributetable/qgsfeaturelistview.cpp
  82. +1 −1 src/gui/attributetable/qgsfeaturelistview.h
  83. +2 −2 src/gui/attributetable/qgsfeaturelistviewdelegate.cpp
  84. +2 −2 src/gui/attributetable/qgsfeaturemodel.h
  85. +14 −14 src/gui/attributetable/qgsfeatureselectionmodel.cpp
  86. +84 −84 src/gui/attributetable/qgsfeatureselectionmodel.h
  87. +10 −1 src/gui/qgscollapsiblegroupbox.cpp
  88. +1 −0 src/gui/qgscollapsiblegroupbox.h
  89. +13 −0 src/gui/qgsoptionsdialogbase.cpp
  90. +1 −0 src/gui/qgsoptionsdialogbase.h
  91. +303 −303 src/providers/delimitedtext/qgsdelimitedtextfile.h
  92. +1 −1 src/providers/gdal/qgsgdalprovider.cpp
  93. +1 −1 src/providers/ogr/qgsogrprovider.cpp
  94. +16 −4 src/providers/wms/qgswmsprovider.cpp
  95. +38 −31 src/ui/qgsengineconfigdialog.ui
  96. +244 −148 src/ui/qgslabelingguibase.ui
  97. +58 −19 src/ui/qgsprojectpropertiesbase.ui
  98. +51 −96 src/ui/qgsrasterlayerpropertiesbase.ui
  99. +1 −1 tests/bench/qgsbench.cpp
  100. +1 −0 tests/src/core/testqgsdiagram.cpp
  101. +1 −1 tests/src/gui/testqgsdualview.cpp
  102. +13 −13 tests/src/python/test_qgsdelimitedtextprovider.py
  103. BIN tests/testdata/control_images/expected_diagram/expected_piediagram.png
@@ -50,4 +50,6 @@ Etienne Tourigny <etourigny.dev at gmail.com>
Larry Shaffer <larrys at dakotacarto.com>
Victor Olaya <volayaf at gmail.com>
Dave DeHaan <dave.dehaan@sap.com>
Matthias Kuhn <matthias.kuhn at gmx.ch
Matthias Kuhn <matthias.kuhn at gmx.ch>
Salvatore Larosa <lrssvtml at gmail.com>
Nyall Dawson <nyall.dawson at gmail.com>
@@ -80,6 +80,14 @@ class QgsPalLayerSettings
Percent
};

enum ShadowType
{
ShadowLowest = 0,
ShadowText,
ShadowBuffer,
ShadowShape
};

// update mDataDefinedNames QList in constructor when adding/deleting enum value
enum DataDefinedProperties
{
@@ -172,6 +180,21 @@ class QgsPalLayerSettings
int shapeTransparency;
QPainter::CompositionMode shapeBlendMode;

// drop shadow
bool shadowDraw;
ShadowType shadowUnder;
int shadowOffsetAngle;
double shadowOffsetDist;
SizeUnit shadowOffsetUnits;
bool shadowOffsetGlobal;
double shadowRadius;
SizeUnit shadowRadiusUnits;
bool shadowRadiusAlphaOnly;
int shadowTransparency;
int shadowScale;
QColor shadowColor;
QPainter::CompositionMode shadowBlendMode;

bool formatNumbers;
int decimals;
bool plusSign;
@@ -228,7 +251,7 @@ class QgsPalLayerSettings
* @param rasterfactor whether to consider oversampling
* @return font pixel size
*/
int sizeToPixel( double size, const QgsRenderContext& c , SizeUnit unit, bool rasterfactor ) const;
int sizeToPixel( double size, const QgsRenderContext& c , SizeUnit unit, bool rasterfactor = false ) const;

/** List of data defined enum names
* @note adding in 1.9
@@ -249,6 +272,53 @@ class QgsLabelCandidate
double cost;
};

/** \ingroup core
* Maintains current state of more grainular and temporal values when creating/painting
* component parts of an individual label (e.g. buffer, background, shadow, etc.).
*/
class QgsLabelComponent
{
%TypeHeaderCode
#include <qgspallabeling.h>
%End

public:
QgsLabelComponent();

const QString& text();
void setText( const QString& text );

const QgsPoint& origin();
void setOrigin( QgsPoint point );

bool useOrigin() const;
void setUseOrigin( bool use );

double rotation() const;
void setRotation( double rotation );

bool useRotation() const;
void setUseRotation( bool use );

const QgsPoint& center();
void setCenter( QgsPoint point );

bool useCenter() const;
void setUseCenter( bool use );

const QgsPoint& size();
void setSize( QgsPoint point );

const QgsPoint& offset();
void setOffset( QgsPoint point );

const QPicture* picture();
void setPicture( QPicture* picture );

double pictureBuffer() const;
void setPictureBuffer( double buffer );
};

class QgsPalLabeling : QgsLabelingEngineInterface
{
%TypeHeaderCode
@@ -282,6 +352,9 @@ class QgsPalLabeling : QgsLabelingEngineInterface
void setShowingCandidates( bool showing );
const QList<QgsLabelCandidate>& candidates();

bool isShowingShadowRectangles() const;
void setShowingShadowRectangles( bool showing );

bool isShowingAllLabels() const;
void setShowingAllLabels( bool showing );

@@ -313,14 +386,20 @@ class QgsPalLabeling : QgsLabelingEngineInterface
/*
void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter, const QgsMapToPixel* xform );
//!drawLabel
void drawLabel( pal::LabelPosition* label, QgsRenderContext& context, QgsPalLayerSettings& tmplyr, DrawLabelType drawType );
void drawLabel( pal::LabelPosition* label, QgsRenderContext& context, QgsPalLayerSettings& tmpLyr, DrawLabelType drawType );
*/
static void drawLabelBuffer( QgsRenderContext& context, QString text, const QgsPalLayerSettings& tmpLyr );
static void drawLabelBuffer( QgsRenderContext& context,
QgsLabelComponent component,
const QgsPalLayerSettings& tmpLyr );

static void drawLabelBackground( QgsRenderContext& context,
const QgsPoint& centerPt, double labelRotation, double labelWidth, double labelHeight,
QgsLabelComponent component,
const QgsPalLayerSettings& tmpLyr );

static void drawLabelShadow( QgsRenderContext& context,
QgsLabelComponent component,
const QgsPalLayerSettings& tmpLyr );

//! load/save engine settings to project file
//! @note added in QGIS 1.9
void loadEngineSettings();
@@ -836,9 +836,34 @@ class QgsVectorLayer : QgsMapLayer

void editingStarted();
void editingStopped();

/**
* Will be emitted, when a new attribute has been added to this vector layer.
* Applies only to types {@link QgsFields::OriginEdit} and {@link QgsFields::OriginProvider}
*
* @param The index of the new attribute
*
* @see updatedFields()
*/
void attributeAdded( int idx );

/**
* Will be emitted, when an attribute has been deleted from this vector layer.
* Applies only to types {@link QgsFields::OriginEdit} and {@link QgsFields::OriginProvider}
*
* @param The index of the deleted attribute
*
* @see updatedFields()
*/
void attributeDeleted( int idx );
void featureAdded( QgsFeatureId fid ); // added in 1.7

/**
* Is emitted, whenever the fields available from this layer have been changed.
* This can be due to manually adding attributes or due to a join.
*/
void updatedFields();

void featureDeleted( QgsFeatureId fid );
void layerDeleted();

@@ -18,7 +18,7 @@ class QgsRasterBlock

int typeSize( int dataType ) const;

int dataTypeSize( int bandNo ) const;
int dataTypeSize() const;

/** Returns true if data type is numeric */
bool typeIsNumeric( QGis::DataType type ) const;
@@ -177,6 +177,11 @@ class QgsSymbolLayerV2Utils
/**Multiplies opacity of image pixel values with a (global) transparency value*/
static void multiplyImageOpacity( QImage* image, qreal alpha );

/** Blurs an image in place, e.g. creating Qt-independent drop shadows
* @note added in 1.9
*/
static void blurImageInPlace( QImage& image, const QRect& rect, int radius, bool alphaOnly );

/**Sorts the passed list in requested order*/
static void sortVariantList( QList<QVariant>& list, Qt::SortOrder order );
/**Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point*/
@@ -35,6 +35,7 @@ class QgsCollapsibleGroupBoxBasic : QGroupBox

public slots:
void checkToggled( bool ckd );
void checkClicked( bool ckd );
void toggleCollapsed();

protected:
@@ -71,7 +71,7 @@ def processAlgorithm(self, progress):
GEOS_EXCEPT = True
FEATURE_EXCEPT = True


f = QgsField("value")
f.setType(QVariant.String)
f.setLength(255)
@@ -79,5 +79,5 @@ def processAlgorithm(self, progress):
progress.setPercentage(int(current * total))

del writer

self.crs = targetCrs
@@ -47,7 +47,7 @@ def ogrConnectionString(self, uri):
layer = QGisLayers.getObjectFromUri(uri, False)
if layer == None:
return uri;
provider = layer.dataProvider().name()
provider = layer.dataProvider().name()
if provider == 'spatialite':
#dbname='/geodata/osm_ch.sqlite' table="places" (Geometry) sql=
regex = re.compile("dbname='(.+)'")
@@ -62,47 +62,47 @@ def defineCharacteristics(self):

#we add the input vector layer. It can have any kind of geometry
#It is a mandatory (not optional) one, hence the False argument
self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", ParameterVector.VECTOR_TYPE_ANY, False))
self.addParameter(ParameterSelection(self.DEST_FORMAT, "Destination Format", FORMATS))
self.addParameter(ParameterString(self.DEST_DSCO, "Creation Options", ""))
self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", ParameterVector.VECTOR_TYPE_ANY, False))
self.addParameter(ParameterSelection(self.DEST_FORMAT, "Destination Format", FORMATS))
self.addParameter(ParameterString(self.DEST_DSCO, "Creation Options", ""))

self.addOutput(OutputVector(self.OUTPUT_LAYER, "Output layer"))

def processAlgorithm(self, progress):
'''Here is where the processing itself takes place'''

if not gdalAvailable:
raise GeoAlgorithmExecutionException("GDAL bindings not installed.")
raise GeoAlgorithmExecutionException("GDAL bindings not installed.")

input = self.getParameterValue(self.INPUT_LAYER)
ogrLayer = self.ogrConnectionString(input)

output = self.getOutputFromName(self.OUTPUT_LAYER)
outfile = output.value

formatIdx = self.getParameterValue(self.DEST_FORMAT)

ext = EXTS[formatIdx]
if not outfile.endswith(ext):
outfile = outfile + ext;
output.value = outfile

dst_ds = self.ogrConnectionString(outfile)
dst_format = FORMATS[formatIdx]
ogr_dsco = [self.getParameterValue(self.DEST_DSCO)]
ogr_dsco = [self.getParameterValue(self.DEST_DSCO)]

poDS = ogr.Open( ogrLayer, False )
if poDS is None:
raise GeoAlgorithmExecutionException(self.failure(ogrLayer))
raise GeoAlgorithmExecutionException(self.failure(ogrLayer))

if dst_format == "SQLite" and os.path.isfile(dst_ds):
os.remove(dst_ds)
os.remove(dst_ds)
driver = ogr.GetDriverByName(str(dst_format))
poDstDS = driver.CreateDataSource(dst_ds, options = ogr_dsco)
if poDstDS is None:
raise GeoAlgorithmExecutionException("Error creating %s" % dst_ds)
return
self.ogrtransform(poDS, poDstDS, bOverwrite = True)
self.ogrtransform(poDS, poDstDS, bOverwrite = True)


def ogrtransform(self,
@@ -141,7 +141,7 @@ def ogrtransform(self,
poLayer = poSrcDS.GetLayer(iLayer)

if poLayer is None:
raise GeoAlgorithmExecutionException( "FAILURE: Couldn't fetch advertised layer %d!" % iLayer)
raise GeoAlgorithmExecutionException( "FAILURE: Couldn't fetch advertised layer %d!" % iLayer)

papoLayers[iLayer] = poLayer
iLayer = iLayer + 1
@@ -156,12 +156,12 @@ def ogrtransform(self,
poLayer = poSrcDS.GetLayerByName(layername)

if poLayer is None:
raise GeoAlgorithmExecutionException("FAILURE: Couldn't fetch advertised layer %s!" % layername)
raise GeoAlgorithmExecutionException("FAILURE: Couldn't fetch advertised layer %s!" % layername)

papoLayers[iLayer] = poLayer
iLayer = iLayer + 1

for poSrcLayer in papoLayers:
for poSrcLayer in papoLayers:
ok = TranslateLayer( poSrcDS, poSrcLayer, poDstDS, papszLCO, pszNewLayerName, \
bTransform, poOutputSRS, poSourceSRS, papszSelFields, \
bAppend, eGType, bOverwrite, eGeomOp, dfGeomOpParam, \
@@ -78,7 +78,7 @@ def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/../images/grass.png")

def helpFile(self):
return 'http://grass.osgeo.org/grass64/manuals/' + self.grassName + ".html"
return 'http://grass.osgeo.org/grass64/manuals/' + self.grassName + ".html"

def getParameterDescriptions(self):
descs = {}
@@ -293,8 +293,8 @@ def processAlgorithm(self, progress):
command+= (" > " + out.value)
else:
command+=(" " + out.name + "=\"" + out.value + "\"");
elif not isinstance(out, OutputHTML):
#html files are not generated by GRASS, only by SEXTANTE to decorate grass output, so we skip them
elif not isinstance(out, OutputHTML):
#html files are not generated by GRASS, only by SEXTANTE to decorate grass output, so we skip them
#An output name to make sure it is unique if the session uses this algorithm several times
uniqueOutputName = out.name + uniqueSufix
command += (" " + out.name + "=" + uniqueOutputName)
@@ -358,7 +358,7 @@ def postProcessResults(self):

def exportVectorLayer(self, orgFilename):
#TODO: improve this. We are now exporting if it is not a shapefile,
#but the functionality of v.in.ogr could be used for this.
#but the functionality of v.in.ogr could be used for this.
#We also export if there is a selection
if not os.path.exists(orgFilename) or not orgFilename.endswith("shp"):
layer = QGisLayers.getObjectFromUri(orgFilename, False)
@@ -427,12 +427,12 @@ def getTempFilename(self):

def commandLineName(self):
return "grass:" + self.name[:self.name.find(" ")]

def checkBeforeOpeningParametersDialog(self):
msg = GrassUtils.checkGrassIsInstalled()
if msg is not None:
html = ("<p>This algorithm requires GRASS to be run."
"Unfortunately, it seems that GRASS is not installed in your system, or it is not correctly configured to be used from QGIS</p>")
if msg is not None:
html = ("<p>This algorithm requires GRASS to be run."
"Unfortunately, it seems that GRASS is not installed in your system, or it is not correctly configured to be used from QGIS</p>")
html += '<p><a href= "http://docs.qgis.org/html/en/docs/user_manual/sextante/3rdParty.html">Click here</a> to know more about how to install and configure GRASS to be used with SEXTANTE</p>'
return html

@@ -46,13 +46,13 @@ def initializeSettings(self):
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_FOLDER, "GRASS folder", GrassUtils.grassPath()))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_WIN_SHELL, "Msys folder", GrassUtils.grassWinShell()))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_COMMANDS, "Log execution commands", False))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_CONSOLE, "Log console output", False))
SextanteConfig.addSetting(Setting(self.getDescription(), GrassUtils.GRASS_LOG_CONSOLE, "Log console output", False))

def unload(self):
AlgorithmProvider.unload(self)
if SextanteUtils.isWindows() or SextanteUtils.isMac():
SextanteConfig.removeSetting(GrassUtils.GRASS_FOLDER)
SextanteConfig.removeSetting(GrassUtils.GRASS_WIN_SHELL)
SextanteConfig.removeSetting(GrassUtils.GRASS_WIN_SHELL)
SextanteConfig.removeSetting(GrassUtils.GRASS_LOG_COMMANDS)
SextanteConfig.removeSetting(GrassUtils.GRASS_LOG_CONSOLE)

@@ -43,7 +43,7 @@ class GrassUtils:
GRASS_REGION_XMAX = "GRASS_REGION_XMAX"
GRASS_REGION_YMAX = "GRASS_REGION_YMAX"
GRASS_REGION_CELLSIZE = "GRASS_REGION_CELLSIZE"
GRASS_FOLDER = "GRASS_FOLDER"
GRASS_FOLDER = "GRASS_FOLDER"
GRASS_WIN_SHELL = "GRASS_WIN_SHELL"
GRASS_LOG_COMMANDS = "GRASS_LOG_COMMANDS"
GRASS_LOG_CONSOLE = "GRASS_LOG_CONSOLE"
@@ -327,7 +327,7 @@ def checkGrassIsInstalled(ignoreRegistrySettings=False):

settings = QSettings()
GRASS_INSTALLED = "/SextanteQGIS/GrassInstalled"
if not ignoreRegistrySettings:
if not ignoreRegistrySettings:
if settings.contains(GRASS_INSTALLED):
return

0 comments on commit 4cb0ae5

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