Skip to content

Commit c4cbcf4

Browse files
committedJul 19, 2011
Merge ellipse symbollayer branch
2 parents 4c00456 + ce826f6 commit c4cbcf4

38 files changed

+1237
-116
lines changed
 

‎python/core/symbology-ng-core.sip

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ class QgsSymbolV2RenderContext
626626
//! @note added in 1.5
627627
void setRenderHints( int hints );
628628

629+
void setFeature( const QgsFeature* f );
630+
const QgsFeature* feature() const;
631+
629632
// Color used for selections
630633
static QColor selectionColor();
631634

@@ -759,7 +762,7 @@ public:
759762
void setSize(double size);
760763
double size();
761764

762-
void renderPoint(const QPointF& point, QgsRenderContext& context, int layer = -1, bool selected = false );
765+
void renderPoint(const QPointF& point, const QgsFeature* f, QgsRenderContext& context, int layer = -1, bool selected = false );
763766

764767
virtual QgsSymbolV2* clone() const /Factory/;
765768
};
@@ -784,7 +787,7 @@ public:
784787
void setWidth(double width);
785788
double width();
786789

787-
void renderPolyline(const QPolygonF& points, QgsRenderContext& context, int layer = -1, bool selected = false );
790+
void renderPolyline(const QPolygonF& points, const QgsFeature* f, QgsRenderContext& context, int layer = -1, bool selected = false );
788791

789792
virtual QgsSymbolV2* clone() const /Factory/;
790793
};
@@ -807,7 +810,7 @@ public:
807810
QgsFillSymbolV2(QgsSymbolLayerV2List layers /Transfer/ = QgsSymbolLayerV2List());
808811

809812
void setAngle( double angle );
810-
void renderPolygon(const QPolygonF& points, QList<QPolygonF>* rings, QgsRenderContext& context, int layer = -1, bool selected = false );
813+
void renderPolygon(const QPolygonF& points, QList<QPolygonF>* rings, const QgsFeature* f, QgsRenderContext& context, int layer = -1, bool selected = false );
811814

812815
virtual QgsSymbolV2* clone() const /Factory/;
813816
};
@@ -839,7 +842,7 @@ class QgsSymbolLayerV2AbstractMetadata
839842
/** create a symbol layer of this type given the map of properties. */
840843
virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map ) = 0 /Factory/;
841844
/** create widget for symbol layer of this type. Can return NULL if there's no GUI */
842-
virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget() /Factory/;
845+
virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget( const QgsVectorLayer* vl ) /Factory/;
843846
};
844847

845848
//////////

‎python/gui/symbology-ng-gui.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class QgsSymbolV2PropertiesDialog : QDialog //, private Ui::DlgSymbolV2Propertie
77
%End
88

99
public:
10-
QgsSymbolV2PropertiesDialog(QgsSymbolV2* symbol, QWidget* parent = NULL);
10+
QgsSymbolV2PropertiesDialog(QgsSymbolV2* symbol, const QgsVectorLayer* vl, QWidget* parent = NULL);
1111

1212

1313
public slots:
@@ -75,7 +75,7 @@ class QgsSymbolV2SelectorDialog : QDialog //, private Ui::QgsSymbolV2SelectorDia
7575
%End
7676

7777
public:
78-
QgsSymbolV2SelectorDialog(QgsSymbolV2* symbol, QgsStyleV2* style, QWidget* parent = NULL, bool embedded = false);
78+
QgsSymbolV2SelectorDialog(QgsSymbolV2* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent = NULL, bool embedded = false);
7979

8080
protected:
8181
void populateSymbolView();
@@ -106,7 +106,7 @@ class QgsSymbolLayerV2Widget : QWidget
106106
%End
107107

108108
public:
109-
QgsSymbolLayerV2Widget( QWidget* parent );
109+
QgsSymbolLayerV2Widget( QWidget* parent, const QgsVectorLayer* vl = 0 );
110110
virtual ~QgsSymbolLayerV2Widget();
111111

112112
virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0;

‎src/app/qgsannotationwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void QgsAnnotationWidget::on_mMapMarkerButton_clicked()
8787
return;
8888
}
8989
QgsMarkerSymbolV2* markerSymbol = dynamic_cast<QgsMarkerSymbolV2*>( mMarkerSymbol->clone() );
90-
QgsSymbolV2SelectorDialog dlg( markerSymbol, QgsStyleV2::defaultStyle(), this );
90+
QgsSymbolV2SelectorDialog dlg( markerSymbol, QgsStyleV2::defaultStyle(), 0, this );
9191
if ( dlg.exec() == QDialog::Rejected )
9292
{
9393
delete markerSymbol;

‎src/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ SET(QGIS_CORE_SRCS
3838
symbology-ng/qgsstylev2.cpp
3939
symbology-ng/qgssymbologyv2conversion.cpp
4040
symbology-ng/qgssvgcache.cpp
41+
symbology-ng/qgsellipsesymbollayerv2.cpp
4142

4243
qgis.cpp
4344
qgsapplication.cpp

‎src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,27 @@ void QgsCategorizedSymbolRendererV2::stopRender( QgsRenderContext& context )
284284

285285
QList<QString> QgsCategorizedSymbolRendererV2::usedAttributes()
286286
{
287-
QList<QString> lst;
288-
lst.append( mAttrName );
287+
QSet<QString> attributes;
288+
attributes.insert( mAttrName );
289289
if ( !mRotationField.isEmpty() )
290-
lst.append( mRotationField );
290+
{
291+
attributes.insert( mRotationField );
292+
}
291293
if ( !mSizeScaleField.isEmpty() )
292-
lst.append( mSizeScaleField );
293-
return lst;
294+
{
295+
attributes.insert( mSizeScaleField );
296+
}
297+
298+
QgsCategoryList::const_iterator catIt = mCategories.constBegin();
299+
for ( ; catIt != mCategories.constEnd(); ++catIt )
300+
{
301+
QgsSymbolV2* catSymbol = catIt->symbol();
302+
if ( catSymbol )
303+
{
304+
attributes.unite( catSymbol->usedAttributes() );
305+
}
306+
}
307+
return attributes.toList();
294308
}
295309

296310
QString QgsCategorizedSymbolRendererV2::dump()

0 commit comments

Comments
 (0)
Please sign in to comment.