Skip to content

Commit 961742e

Browse files
author
wonder
committed
Symbology-NG branch merged to trunk. This includes also work on labeling done during my GSoC'09.
git-svn-id: http://svn.osgeo.org/qgis/trunk@12139 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f3388ed commit 961742e

File tree

165 files changed

+18563
-3624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+18563
-3624
lines changed

images/themes/default/cap_flat.png

264 Bytes
Loading

images/themes/default/cap_round.png

408 Bytes
Loading

images/themes/default/cap_square.png

261 Bytes
Loading

images/themes/default/cap_style.svg

Lines changed: 112 additions & 0 deletions
Loading

images/themes/default/join_bevel.png

658 Bytes
Loading

images/themes/default/join_miter.png

701 Bytes
Loading

images/themes/default/join_round.png

695 Bytes
Loading

images/themes/default/join_style.svg

Lines changed: 100 additions & 0 deletions
Loading
630 Bytes
Loading
632 Bytes
Loading
627 Bytes
Loading
1.38 KB
Loading
722 Bytes
Loading
1.05 KB
Loading
3.52 KB
Loading
743 Bytes
Loading

images/themes/default/symbologyUp.png

787 Bytes
Loading

python/configure.py.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ for mk in [ makefile_core, makefile_gui, makefile_analysis ]:
154154
src_path+"/src/core/renderer",
155155
src_path+"/src/core/spatialindex",
156156
src_path+"/src/core/symbology",
157+
src_path+"/src/core/symbology-ng",
157158
build_path, # qgsconfig.h, qgssvnversion.h
158159
gdal_inc_dir,
159160
geos_inc_dir]
@@ -163,6 +164,7 @@ for mk in [ makefile_core, makefile_gui, makefile_analysis ]:
163164
makefile_gui.extra_libs.append("qgis_gui")
164165
makefile_gui.extra_lib_dirs.append(build_path+"/src/gui"+intdir)
165166
makefile_gui.extra_include_dirs.append(src_path+"/src/gui")
167+
makefile_gui.extra_include_dirs.append(src_path+"/src/gui/symbology-ng")
166168
makefile_gui.extra_include_dirs.append(build_path+"/src/gui")
167169
makefile_gui.extra_include_dirs.append(build_path+"/src/ui")
168170
makefile_gui.extra_include_dirs.append(src_path+"/src/plugins") # because of qgisplugin.h TODO: sort out

python/core/conversions.sip

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ This file contains code for conversion between various (often nested) mapped typ
33
which are not wrapped by PyQt:
44
- QVector< QVector<TYPE> >
55
- QVector< QVector< QVector<TYPE> > >
6+
- QList< QList<TYPE> >
67
- QSet<int>
78
- QSet<TYPE>
89
- QMap<int, QMap<int, TYPE> >
@@ -19,6 +20,7 @@ which are not wrapped by PyQt:
1920
#if (PY_VERSION_HEX < 0x02050000)
2021
typedef int Py_ssize_t;
2122
#endif
23+
2224
%End
2325

2426

@@ -183,6 +185,85 @@ template <TYPE>
183185
};
184186

185187

188+
189+
template <TYPE>
190+
%MappedType QList< QList<TYPE> >
191+
{
192+
%TypeHeaderCode
193+
#include <QList>
194+
%End
195+
196+
%ConvertFromTypeCode
197+
// Create the list.
198+
PyObject *l;
199+
200+
if ((l = PyList_New(sipCpp->size())) == NULL)
201+
return NULL;
202+
203+
const sipMappedType* qlist_type = sipFindMappedType("QList<TYPE>");
204+
205+
// Set the list elements.
206+
for (int i = 0; i < sipCpp->size(); ++i)
207+
{
208+
QList<TYPE>* t = new QList<TYPE>(sipCpp->at(i));
209+
PyObject *tobj;
210+
211+
if ((tobj = sipConvertFromMappedType(t, qlist_type, sipTransferObj)) == NULL)
212+
{
213+
Py_DECREF(l);
214+
delete t;
215+
return NULL;
216+
}
217+
PyList_SET_ITEM(l, i, tobj);
218+
}
219+
220+
return l;
221+
%End
222+
223+
%ConvertToTypeCode
224+
const sipMappedType* qlist_type = sipFindMappedType("QList<TYPE>");
225+
226+
// Check the type if that is all that is required.
227+
if (sipIsErr == NULL)
228+
{
229+
if (!PyList_Check(sipPy))
230+
return 0;
231+
232+
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
233+
if (!sipCanConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, SIP_NOT_NONE))
234+
return 0;
235+
236+
return 1;
237+
}
238+
239+
240+
QList< QList<TYPE> > *ql = new QList< QList<TYPE> >;
241+
242+
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
243+
{
244+
int state;
245+
//TYPE *t = reinterpret_cast<TYPE *>(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
246+
QList<TYPE> * t = reinterpret_cast< QList<TYPE> * >(sipConvertToMappedType(PyList_GET_ITEM(sipPy, i), qlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
247+
248+
if (*sipIsErr)
249+
{
250+
sipReleaseInstance(t, sipClass_TYPE, state);
251+
delete ql;
252+
return 0;
253+
}
254+
ql->append(*t);
255+
sipReleaseInstance(t, sipClass_TYPE, state);
256+
}
257+
258+
*sipCppPtr = ql;
259+
return sipGetState(sipTransferObj);
260+
%End
261+
262+
};
263+
264+
265+
266+
186267
%MappedType QSet<int>
187268
{
188269
%TypeHeaderCode

python/core/core.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@
7474
%Include qgsvectorlayer.sip
7575
%Include qgsvectoroverlay.sip
7676

77+
%Include symbology-ng-core.sip

python/core/qgsapplication.sip

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
156156
//! @note deprecated
157157
static const QString svgPath();
158158

159+
//! Returns the path to user's style. Added in QGIS 1.2
160+
static const QString userStyleV2Path();
161+
162+
//! Returns the path to default style (works as a starting point). Added in QGIS 1.2
163+
static const QString defaultStyleV2Path();
164+
159165
//! Returns the path to the application prefix directory.
160166
static const QString prefixPath();
161167

python/core/qgsmaplayer.sip

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ public:
144144
*/
145145
bool writeXML(QDomNode & layer_node, QDomDocument & document) const;
146146

147+
/** Set a custom property for layer. Properties are stored in a map and saved in project file.
148+
* @note Added in v1.3 */
149+
void setCustomProperty( const QString& key, const QVariant& value );
150+
/** Read a custom property from layer. Properties are stored in a map and saved in project file.
151+
* @note Added in v1.3 */
152+
QVariant customProperty( const QString& value, const QVariant& defaultValue = QVariant() ) const;
153+
/** Remove a custom property from layer. Properties are stored in a map and saved in project file.
154+
* @note Added in v1.3 */
155+
void removeCustomProperty( const QString& key );
156+
147157
/** Read the symbology for the current layer from the Dom node supplied.
148158
* @param QDomNode node that will contain the symbology definition for this layer.
149159
* @param errorMessage reference to string that will be updated with any error messages

python/core/qgsrenderer.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class QgsRenderer
5252
virtual QgsRenderer* clone() const=0;
5353
/** Change selection color */
5454
static void setSelectionColor(QColor color);
55+
/** Get selection color */
56+
static QColor selectionColor();
5557
/**Returns true if this renderer returns a pixmap in the render method (e.g. for point data or diagrams)*/
5658
virtual bool containsPixmap() const;
5759
/**Returns true if this renderer uses its own transparency settings, e.g. differentiated by classification.

python/core/qgsvectorlayer.sip

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ public:
101101
/** Sets the renderer. If a renderer is already present, it is deleted */
102102
void setRenderer(QgsRenderer * r /Transfer/);
103103

104+
/** Return renderer V2. Added in QGIS 1.2 */
105+
QgsFeatureRendererV2* rendererV2();
106+
/** Set renderer V2. Added in QGIS 1.2 */
107+
void setRendererV2(QgsFeatureRendererV2* r);
108+
/** Return whether using renderer V2. Added in QGIS 1.2 */
109+
bool isUsingRendererV2();
110+
/** set whether to use renderer V2 for drawing. Added in QGIS 1.2 */
111+
void setUsingRendererV2(bool usingRendererV2);
112+
113+
void drawRendererV2( QgsRenderContext& rendererContext, bool labeling );
114+
void drawRendererV2Levels( QgsRenderContext& rendererContext, bool labeling );
115+
104116
/** Returns point, line or polygon */
105117
QGis::GeometryType geometryType() const;
106118

0 commit comments

Comments
 (0)