Skip to content

Commit a7cf5e4

Browse files
committedJan 24, 2012
[FEATURE] Merge branch 'rules' - new rule-based rendering
Conflicts: src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
2 parents 0b1fd34 + 1c3c02f commit a7cf5e4

Some content is hidden

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

41 files changed

+2849
-969
lines changed
 

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

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
390390

391391
public:
392392

393+
//typedef QList<QgsRuleBasedRendererV2::Rule*> RuleList;
394+
393395
/**
394396
This class keeps data about a rules for rule-based renderer.
395397
A rule consists of a symbol, filter expression and range of scales.
@@ -403,10 +405,10 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
403405
public:
404406
//! Constructor takes ownership of the symbol
405407
Rule( QgsSymbolV2* symbol /Transfer/, int scaleMinDenom = 0, int scaleMaxDenom = 0, QString filterExp = QString() );
406-
Rule( const QgsRuleBasedRendererV2::Rule& other );
408+
//Rule( const QgsRuleBasedRendererV2::Rule& other );
407409
~Rule();
408410
QString dump() const;
409-
QStringList needsFields() const;
411+
//QStringList needsFields() const;
410412
bool isFilterOK( QgsFeature& f ) const;
411413
bool isScaleOK( double scale ) const;
412414

@@ -428,7 +430,9 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
428430

429431
static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/;
430432

431-
//! Constructor. Takes ownership of the defult symbol.
433+
//! Constructs the renderer from given tree of rules
434+
QgsRuleBasedRendererV2( QgsRuleBasedRendererV2::Rule* root /Transfer/ );
435+
//! Constructor for convenience. Creates a root rule and adds a default rule with symbol
432436
QgsRuleBasedRendererV2( QgsSymbolV2* defaultSymbol /Transfer/ );
433437

434438
//! return symbol for current feature. Should not be used individually: there could be more symbols for a feature
@@ -454,27 +458,15 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
454458

455459
/////
456460

457-
//! return the total number of rules
458-
int ruleCount();
459-
//! get reference to rule at index (valid indexes: 0...count-1)
460-
QgsRuleBasedRendererV2::Rule& ruleAt( int index );
461-
//! add rule to the end of the list of rules
462-
void addRule( const QgsRuleBasedRendererV2::Rule& rule );
463-
//! insert rule to a specific position of the list of rules
464-
void insertRule( int index, const QgsRuleBasedRendererV2::Rule& rule );
465-
//! modify the rule at a specific position of the list of rules
466-
void updateRuleAt( int index, const QgsRuleBasedRendererV2::Rule& rule );
467-
//! remove the rule at the specified index
468-
void removeRuleAt( int index );
469461

470462
//////
471463

472464
//! take a rule and create a list of new rules based on the categories from categorized symbol renderer
473-
static QList<QgsRuleBasedRendererV2::Rule> refineRuleCategories( QgsRuleBasedRendererV2::Rule& initialRule, QgsCategorizedSymbolRendererV2* r );
465+
//static QgsRuleBasedRendererV2::RuleList refineRuleCategories( QgsRuleBasedRendererV2::Rule* initialRule, QgsCategorizedSymbolRendererV2* r );
474466
//! take a rule and create a list of new rules based on the ranges from graduated symbol renderer
475-
static QList<QgsRuleBasedRendererV2::Rule> refineRuleRanges( QgsRuleBasedRendererV2::Rule& initialRule, QgsGraduatedSymbolRendererV2* r );
467+
//static QgsRuleBasedRendererV2::RuleList refineRuleRanges( QgsRuleBasedRendererV2::Rule* initialRule, QgsGraduatedSymbolRendererV2* r );
476468
//! take a rule and create a list of new rules with intervals of scales given by the passed scale denominators
477-
static QList<QgsRuleBasedRendererV2::Rule> refineRuleScales( QgsRuleBasedRendererV2::Rule& initialRule, QList<int> scales );
469+
//static QgsRuleBasedRendererV2::RuleList refineRuleScales( QgsRuleBasedRendererV2::Rule* initialRule, QList<int> scales );
478470

479471
};
480472

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public slots:
4242
void apply();
4343
void onOK();
4444

45-
void showSymbolLevels();
46-
4745
protected:
4846

4947
//! Reimplements dialog keyPress event so we can ignore it

0 commit comments

Comments
 (0)
Please sign in to comment.