Skip to content

Commit

Permalink
Merge ellipse symbollayer branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 19, 2011
2 parents 4c00456 + ce826f6 commit c4cbcf4
Show file tree
Hide file tree
Showing 38 changed files with 1,237 additions and 116 deletions.
11 changes: 7 additions & 4 deletions python/core/symbology-ng-core.sip
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ class QgsSymbolV2RenderContext
//! @note added in 1.5
void setRenderHints( int hints );

void setFeature( const QgsFeature* f );
const QgsFeature* feature() const;

// Color used for selections
static QColor selectionColor();

Expand Down Expand Up @@ -759,7 +762,7 @@ public:
void setSize(double size);
double size();

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

virtual QgsSymbolV2* clone() const /Factory/;
};
Expand All @@ -784,7 +787,7 @@ public:
void setWidth(double width);
double width();

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

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

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

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

//////////
Expand Down
6 changes: 3 additions & 3 deletions python/gui/symbology-ng-gui.sip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class QgsSymbolV2PropertiesDialog : QDialog //, private Ui::DlgSymbolV2Propertie
%End

public:
QgsSymbolV2PropertiesDialog(QgsSymbolV2* symbol, QWidget* parent = NULL);
QgsSymbolV2PropertiesDialog(QgsSymbolV2* symbol, const QgsVectorLayer* vl, QWidget* parent = NULL);


public slots:
Expand Down Expand Up @@ -75,7 +75,7 @@ class QgsSymbolV2SelectorDialog : QDialog //, private Ui::QgsSymbolV2SelectorDia
%End

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

protected:
void populateSymbolView();
Expand Down Expand Up @@ -106,7 +106,7 @@ class QgsSymbolLayerV2Widget : QWidget
%End

public:
QgsSymbolLayerV2Widget( QWidget* parent );
QgsSymbolLayerV2Widget( QWidget* parent, const QgsVectorLayer* vl = 0 );
virtual ~QgsSymbolLayerV2Widget();

virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsannotationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void QgsAnnotationWidget::on_mMapMarkerButton_clicked()
return;
}
QgsMarkerSymbolV2* markerSymbol = dynamic_cast<QgsMarkerSymbolV2*>( mMarkerSymbol->clone() );
QgsSymbolV2SelectorDialog dlg( markerSymbol, QgsStyleV2::defaultStyle(), this );
QgsSymbolV2SelectorDialog dlg( markerSymbol, QgsStyleV2::defaultStyle(), 0, this );
if ( dlg.exec() == QDialog::Rejected )
{
delete markerSymbol;
Expand Down
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ SET(QGIS_CORE_SRCS
symbology-ng/qgsstylev2.cpp
symbology-ng/qgssymbologyv2conversion.cpp
symbology-ng/qgssvgcache.cpp
symbology-ng/qgsellipsesymbollayerv2.cpp

qgis.cpp
qgsapplication.cpp
Expand Down
24 changes: 19 additions & 5 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,27 @@ void QgsCategorizedSymbolRendererV2::stopRender( QgsRenderContext& context )

QList<QString> QgsCategorizedSymbolRendererV2::usedAttributes()
{
QList<QString> lst;
lst.append( mAttrName );
QSet<QString> attributes;
attributes.insert( mAttrName );
if ( !mRotationField.isEmpty() )
lst.append( mRotationField );
{
attributes.insert( mRotationField );
}
if ( !mSizeScaleField.isEmpty() )
lst.append( mSizeScaleField );
return lst;
{
attributes.insert( mSizeScaleField );
}

QgsCategoryList::const_iterator catIt = mCategories.constBegin();
for ( ; catIt != mCategories.constEnd(); ++catIt )
{
QgsSymbolV2* catSymbol = catIt->symbol();
if ( catSymbol )
{
attributes.unite( catSymbol->usedAttributes() );
}
}
return attributes.toList();
}

QString QgsCategorizedSymbolRendererV2::dump()
Expand Down
Loading

0 comments on commit c4cbcf4

Please sign in to comment.