Skip to content

Commit

Permalink
Symbology-NG branch merged to trunk. This includes also work on label…
Browse files Browse the repository at this point in the history
…ing done during my GSoC'09.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12139 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 16, 2009
2 parents 4f73f65 + 4b644b7 commit a986a7d
Show file tree
Hide file tree
Showing 165 changed files with 18,563 additions and 3,624 deletions.
Binary file added images/themes/default/cap_flat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/cap_round.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/cap_square.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions images/themes/default/cap_style.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/join_bevel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/join_miter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/join_round.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions images/themes/default/join_style.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/rendererCategorizedSymbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/rendererGraduatedSymbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/rendererSingleSymbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/symbologyAdd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/symbologyDown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/symbologyEdit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/symbologyLock.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/symbologyRemove.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/symbologyUp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions python/configure.py.in
Expand Up @@ -154,6 +154,7 @@ for mk in [ makefile_core, makefile_gui, makefile_analysis ]:
src_path+"/src/core/renderer",
src_path+"/src/core/spatialindex",
src_path+"/src/core/symbology",
src_path+"/src/core/symbology-ng",
build_path, # qgsconfig.h, qgssvnversion.h
gdal_inc_dir,
geos_inc_dir]
Expand All @@ -163,6 +164,7 @@ for mk in [ makefile_core, makefile_gui, makefile_analysis ]:
makefile_gui.extra_libs.append("qgis_gui")
makefile_gui.extra_lib_dirs.append(build_path+"/src/gui"+intdir)
makefile_gui.extra_include_dirs.append(src_path+"/src/gui")
makefile_gui.extra_include_dirs.append(src_path+"/src/gui/symbology-ng")
makefile_gui.extra_include_dirs.append(build_path+"/src/gui")
makefile_gui.extra_include_dirs.append(build_path+"/src/ui")
makefile_gui.extra_include_dirs.append(src_path+"/src/plugins") # because of qgisplugin.h TODO: sort out
Expand Down
81 changes: 81 additions & 0 deletions python/core/conversions.sip
Expand Up @@ -3,6 +3,7 @@ This file contains code for conversion between various (often nested) mapped typ
which are not wrapped by PyQt:
- QVector< QVector<TYPE> >
- QVector< QVector< QVector<TYPE> > >
- QList< QList<TYPE> >
- QSet<int>
- QSet<TYPE>
- QMap<int, QMap<int, TYPE> >
Expand All @@ -19,6 +20,7 @@ which are not wrapped by PyQt:
#if (PY_VERSION_HEX < 0x02050000)
typedef int Py_ssize_t;
#endif

%End


Expand Down Expand Up @@ -183,6 +185,85 @@ template <TYPE>
};



template <TYPE>
%MappedType QList< QList<TYPE> >
{
%TypeHeaderCode
#include <QList>
%End

%ConvertFromTypeCode
// Create the list.
PyObject *l;

if ((l = PyList_New(sipCpp->size())) == NULL)
return NULL;

const sipMappedType* qlist_type = sipFindMappedType("QList<TYPE>");

// Set the list elements.
for (int i = 0; i < sipCpp->size(); ++i)
{
QList<TYPE>* t = new QList<TYPE>(sipCpp->at(i));
PyObject *tobj;

if ((tobj = sipConvertFromMappedType(t, qlist_type, sipTransferObj)) == NULL)
{
Py_DECREF(l);
delete t;
return NULL;
}
PyList_SET_ITEM(l, i, tobj);
}

return l;
%End

%ConvertToTypeCode
const sipMappedType* qlist_type = sipFindMappedType("QList<TYPE>");

// Check the type if that is all that is required.
if (sipIsErr == NULL)
{
if (!PyList_Check(sipPy))
return 0;

for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
if (!sipCanConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, SIP_NOT_NONE))
return 0;

return 1;
}


QList< QList<TYPE> > *ql = new QList< QList<TYPE> >;

for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
{
int state;
//TYPE *t = reinterpret_cast<TYPE *>(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
QList<TYPE> * t = reinterpret_cast< QList<TYPE> * >(sipConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

if (*sipIsErr)
{
sipReleaseInstance(t, sipClass_TYPE, state);
delete ql;
return 0;
}
ql->append(*t);
sipReleaseInstance(t, sipClass_TYPE, state);
}

*sipCppPtr = ql;
return sipGetState(sipTransferObj);
%End

};




%MappedType QSet<int>
{
%TypeHeaderCode
Expand Down
1 change: 1 addition & 0 deletions python/core/core.sip
Expand Up @@ -74,3 +74,4 @@
%Include qgsvectorlayer.sip
%Include qgsvectoroverlay.sip

%Include symbology-ng-core.sip
6 changes: 6 additions & 0 deletions python/core/qgsapplication.sip
Expand Up @@ -156,6 +156,12 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
//! @note deprecated
static const QString svgPath();

//! Returns the path to user's style. Added in QGIS 1.2
static const QString userStyleV2Path();

//! Returns the path to default style (works as a starting point). Added in QGIS 1.2
static const QString defaultStyleV2Path();

//! Returns the path to the application prefix directory.
static const QString prefixPath();

Expand Down
10 changes: 10 additions & 0 deletions python/core/qgsmaplayer.sip
Expand Up @@ -144,6 +144,16 @@ public:
*/
bool writeXML(QDomNode & layer_node, QDomDocument & document) const;

/** Set a custom property for layer. Properties are stored in a map and saved in project file.
* @note Added in v1.3 */
void setCustomProperty( const QString& key, const QVariant& value );
/** Read a custom property from layer. Properties are stored in a map and saved in project file.
* @note Added in v1.3 */
QVariant customProperty( const QString& value, const QVariant& defaultValue = QVariant() ) const;
/** Remove a custom property from layer. Properties are stored in a map and saved in project file.
* @note Added in v1.3 */
void removeCustomProperty( const QString& key );

/** Read the symbology for the current layer from the Dom node supplied.
* @param QDomNode node that will contain the symbology definition for this layer.
* @param errorMessage reference to string that will be updated with any error messages
Expand Down
2 changes: 2 additions & 0 deletions python/core/qgsrenderer.sip
Expand Up @@ -52,6 +52,8 @@ class QgsRenderer
virtual QgsRenderer* clone() const=0;
/** Change selection color */
static void setSelectionColor(QColor color);
/** Get selection color */
static QColor selectionColor();
/**Returns true if this renderer returns a pixmap in the render method (e.g. for point data or diagrams)*/
virtual bool containsPixmap() const;
/**Returns true if this renderer uses its own transparency settings, e.g. differentiated by classification.
Expand Down
12 changes: 12 additions & 0 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -101,6 +101,18 @@ public:
/** Sets the renderer. If a renderer is already present, it is deleted */
void setRenderer(QgsRenderer * r /Transfer/);

/** Return renderer V2. Added in QGIS 1.2 */
QgsFeatureRendererV2* rendererV2();
/** Set renderer V2. Added in QGIS 1.2 */
void setRendererV2(QgsFeatureRendererV2* r);
/** Return whether using renderer V2. Added in QGIS 1.2 */
bool isUsingRendererV2();
/** set whether to use renderer V2 for drawing. Added in QGIS 1.2 */
void setUsingRendererV2(bool usingRendererV2);

void drawRendererV2( QgsRenderContext& rendererContext, bool labeling );
void drawRendererV2Levels( QgsRenderContext& rendererContext, bool labeling );

/** Returns point, line or polygon */
QGis::GeometryType geometryType() const;

Expand Down

0 comments on commit a986a7d

Please sign in to comment.