mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Some features are still disabled - will be fixed later Conflicts: python/core/composer/qgscomposition.sip python/core/diagram/qgsdiagram.sip python/core/diagram/qgshistogramdiagram.sip python/core/diagram/qgspiediagram.sip python/core/diagram/qgstextdiagram.sip python/core/qgsdiagramrendererv2.sip python/core/qgsfield.sip python/core/qgslabelsearchtree.sip python/core/qgsmaprenderer.sip python/core/qgsrenderchecker.sip python/core/symbology-ng/qgssymbollayerv2.sip python/gui/qgsmapcanvas.sip src/app/composer/qgscomposerlegendwidget.cpp src/app/qgisapp.cpp src/core/composer/qgsatlascomposition.cpp src/core/composer/qgscomposerattributetable.cpp src/core/composer/qgscomposermap.cpp src/core/composer/qgscomposition.cpp src/core/composer/qgscomposition.h src/core/diagram/qgsdiagram.h src/core/diagram/qgshistogramdiagram.cpp src/core/diagram/qgshistogramdiagram.h src/core/diagram/qgspiediagram.cpp src/core/diagram/qgspiediagram.h src/core/diagram/qgstextdiagram.cpp src/core/diagram/qgstextdiagram.h src/core/qgsdiagramrendererv2.cpp src/core/qgsdiagramrendererv2.h src/core/qgsmaprenderer.cpp src/core/qgsmaprenderer.h src/core/qgsnetworkaccessmanager.h src/core/qgspallabeling.cpp src/core/qgsrenderchecker.h src/core/qgsvectorlayer.cpp src/core/qgsvectorlayer.h src/core/qgsvectorlayerfeatureiterator.cpp src/core/qgsvectorlayerfeatureiterator.h src/core/raster/qgsrasterlayer.cpp src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp src/core/symbology-ng/qgsmarkersymbollayerv2.cpp src/core/symbology-ng/qgssinglesymbolrendererv2.cpp src/core/symbology-ng/qgssymbollayerv2.cpp src/core/symbology-ng/qgssymbollayerv2.h src/core/symbology-ng/qgssymbolv2.cpp src/gui/qgshighlight.cpp src/gui/qgsmapcanvas.cpp src/gui/qgsmapcanvas.h src/gui/qgsmapcanvasitem.cpp src/gui/qgsmaptoolidentify.cpp src/plugins/georeferencer/qgsgeorefplugingui.cpp src/providers/memory/qgsmemoryfeatureiterator.cpp src/providers/ogr/qgsogrfeatureiterator.cpp src/providers/ogr/qgsogrfeatureiterator.h src/providers/ogr/qgsogrprovider.cpp src/providers/oracle/qgsoraclefeatureiterator.cpp src/providers/oracle/qgsoracleprovider.cpp src/providers/postgres/qgspostgresconn.cpp src/providers/postgres/qgspostgresfeatureiterator.cpp src/providers/postgres/qgspostgresfeatureiterator.h src/providers/wfs/qgswfsfeatureiterator.cpp src/providers/wms/qgswmsprovider.cpp src/providers/wms/qgswmsprovider.h src/ui/qgsoptionsbase.ui tests/src/core/CMakeLists.txt tests/src/core/testqgscomposereffects.cpp tests/src/core/testqgscomposerhtml.cpp tests/src/core/testqgscomposerscalebar.cpp tests/src/core/testqgscomposershapes.cpp
161 lines
4.7 KiB
Plaintext
161 lines
4.7 KiB
Plaintext
class QgsRendererRangeV2
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgsgraduatedsymbolrendererv2.h>
|
|
%End
|
|
|
|
public:
|
|
QgsRendererRangeV2( double lowerValue, double upperValue, QgsSymbolV2* symbol /Transfer/, QString label );
|
|
QgsRendererRangeV2( const QgsRendererRangeV2& range );
|
|
|
|
~QgsRendererRangeV2();
|
|
|
|
double lowerValue() const;
|
|
double upperValue() const;
|
|
|
|
QgsSymbolV2* symbol() const;
|
|
QString label() const;
|
|
|
|
void setSymbol( QgsSymbolV2* s /Transfer/ );
|
|
void setLabel( QString label );
|
|
void setLowerValue( double lowerValue );
|
|
void setUpperValue( double upperValue );
|
|
|
|
// debugging
|
|
QString dump() const;
|
|
|
|
void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const;
|
|
};
|
|
|
|
typedef QList<QgsRendererRangeV2> QgsRangeList;
|
|
|
|
class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgsgraduatedsymbolrendererv2.h>
|
|
%End
|
|
|
|
public:
|
|
QgsGraduatedSymbolRendererV2( QString attrName = QString(), QgsRangeList ranges = QgsRangeList() );
|
|
|
|
virtual ~QgsGraduatedSymbolRendererV2();
|
|
|
|
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature );
|
|
|
|
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
|
|
|
|
virtual void stopRender( QgsRenderContext& context );
|
|
|
|
virtual QList<QString> usedAttributes();
|
|
|
|
virtual QString dump() const;
|
|
|
|
virtual QgsFeatureRendererV2* clone() /Factory/;
|
|
|
|
virtual void toSld( QDomDocument& doc, QDomElement &element ) const;
|
|
|
|
//! returns bitwise OR-ed capabilities of the renderer
|
|
//! \note added in 2.0
|
|
virtual int capabilities();
|
|
|
|
virtual QgsSymbolV2List symbols();
|
|
|
|
QString classAttribute() const;
|
|
void setClassAttribute( QString attr );
|
|
|
|
const QgsRangeList& ranges();
|
|
|
|
bool updateRangeSymbol( int rangeIndex, QgsSymbolV2* symbol /Transfer/ );
|
|
bool updateRangeLabel( int rangeIndex, QString label );
|
|
bool updateRangeUpperValue( int rangeIndex, double value );
|
|
bool updateRangeLowerValue( int rangeIndex, double value );
|
|
|
|
void addClass( QgsSymbolV2* symbol );
|
|
//! @note available in python bindings as addClassRange
|
|
void addClass( QgsRendererRangeV2 range ) /PyName=addClassRange/;
|
|
void deleteClass( int idx );
|
|
void deleteAllClasses();
|
|
|
|
//! Moves the category at index position from to index position to.
|
|
void moveClass( int from, int to );
|
|
|
|
void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
|
|
void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
|
|
|
|
enum Mode
|
|
{
|
|
EqualInterval,
|
|
Quantile,
|
|
Jenks,
|
|
StdDev,
|
|
Pretty,
|
|
Custom
|
|
};
|
|
|
|
Mode mode() const;
|
|
void setMode( Mode mode );
|
|
|
|
static QgsGraduatedSymbolRendererV2* createRenderer(
|
|
QgsVectorLayer* vlayer,
|
|
QString attrName,
|
|
int classes,
|
|
Mode mode,
|
|
QgsSymbolV2* symbol /Transfer/,
|
|
QgsVectorColorRampV2* ramp /Transfer/,
|
|
bool inverted = false ) /Factory/;
|
|
|
|
//! create renderer from XML element
|
|
static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/;
|
|
|
|
//! store renderer info to XML element
|
|
virtual QDomElement save( QDomDocument& doc );
|
|
|
|
//! return a list of symbology items for the legend
|
|
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
|
|
|
|
//! return a list of item text / symbol
|
|
//! @note: this method was added in version 1.5
|
|
//! @note not available in python bindings
|
|
// virtual QgsLegendSymbolList legendSymbolItems();
|
|
|
|
QgsSymbolV2* sourceSymbol();
|
|
void setSourceSymbol( QgsSymbolV2* sym /Transfer/ );
|
|
|
|
QgsVectorColorRampV2* sourceColorRamp();
|
|
void setSourceColorRamp( QgsVectorColorRampV2* ramp /Transfer/ );
|
|
//! @note added in 2.1
|
|
bool invertedColorRamp();
|
|
void setInvertedColorRamp( bool inverted );
|
|
|
|
/** Update the color ramp used. Also updates all symbols colors.
|
|
* Doesn't alter current breaks.
|
|
*/
|
|
void updateColorRamp( QgsVectorColorRampV2* ramp /Transfer/ );
|
|
|
|
/** Update the all symbols but leave breaks and colors. */
|
|
void updateSymbols( QgsSymbolV2* sym /Transfer/ );
|
|
|
|
//! @note added in 1.6
|
|
void setRotationField( QString fieldOrExpression );
|
|
//! @note added in 1.6
|
|
QString rotationField() const;
|
|
|
|
//! @note added in 1.6
|
|
void setSizeScaleField( QString fieldOrExpression );
|
|
//! @note added in 1.6
|
|
QString sizeScaleField() const;
|
|
|
|
//! @note added in 2.0
|
|
void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod );
|
|
//! @note added in 2.0
|
|
QgsSymbolV2::ScaleMethod scaleMethod() const;
|
|
|
|
|
|
protected:
|
|
QgsSymbolV2* symbolForValue( double value );
|
|
|
|
private:
|
|
QgsGraduatedSymbolRendererV2( const QgsGraduatedSymbolRendererV2 & );
|
|
QgsGraduatedSymbolRendererV2 & operator=( const QgsGraduatedSymbolRendererV2 & );
|
|
};
|