00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef QGSGRADUATEDSYMBOLDIALOG_H
00020 #define QGSGRADUATEDSYMBOLDIALOG_H
00021
00022 #include "ui_qgsgraduatedsymboldialogbase.h"
00023 #include "qgssinglesymboldialog.h"
00024 #include <map>
00025
00026 class QgsVectorLayer;
00027
00028
00029 class QgsGraduatedSymbolDialog: public QDialog, private Ui::QgsGraduatedSymbolDialogBase
00030 {
00031 Q_OBJECT
00032 public:
00034 enum mode {EMPTY, EQUAL_INTERVAL, QUANTILES};
00035 QgsGraduatedSymbolDialog( QgsVectorLayer* layer );
00036 ~QgsGraduatedSymbolDialog();
00037 public slots:
00038 void apply();
00039 protected slots:
00041 void adjustNumberOfClasses();
00043 void adjustClassification();
00045 void changeCurrentValue();
00047 void applySymbologyChanges();
00049 void modifyClass( QListWidgetItem* item );
00050 protected:
00052 QgsVectorLayer* mVectorLayer;
00054 std::map<QString, int> mFieldMap;
00056 std::map<QString, QgsSymbol*> mEntries;
00058 QgsSingleSymbolDialog sydialog;
00059 int mClassificationField;
00060
00063 int quantilesFromVectorLayer( std::list<double>& result, int attributeIndex, int numQuantiles ) const;
00069 int calculateQuantiles( std::list<double>& result, const std::vector<double>& values, int numQuantiles ) const;
00071 QColor getColorFromRamp( QString ramp, int step, int totalSteps );
00072
00073 protected slots:
00075 void deleteCurrentClass();
00076
00077 private:
00082 void updateEntryIcon( QgsSymbol * thepSymbol, QListWidgetItem * thepItem );
00084 QgsGraduatedSymbolDialog();
00085 };
00086
00087 #endif