mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
- update methods of existing classes - add comment to methods missing in the sip bindings - split up collective sip files into single files and use same directory structure in python/ as in src/ - add a lot of missing classes (some might not make sense because of missing python methods in those classes) - remove some non-existing methods from the header files - add scripts/sipdiff - replace some usages of std::vector and std::set with QVector/QSet
140 lines
3.9 KiB
Plaintext
140 lines
3.9 KiB
Plaintext
class QgsSymbolLayerV2
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgssymbollayerv2.h>
|
|
%End
|
|
|
|
%ConvertToSubClassCode
|
|
switch (sipCpp->type())
|
|
{
|
|
case QgsSymbolV2::Marker:
|
|
if( sipCpp->layerType() == "VectorField" )
|
|
{
|
|
sipClass = sipClass_QgsVectorFieldSymbolLayer;
|
|
}
|
|
else
|
|
{
|
|
sipClass = sipClass_QgsMarkerSymbolLayerV2;
|
|
}
|
|
break;
|
|
case QgsSymbolV2::Line: sipClass = sipClass_QgsLineSymbolLayerV2; break;
|
|
case QgsSymbolV2::Fill: sipClass = sipClass_QgsFillSymbolLayerV2; break;
|
|
default: sipClass = 0; break;
|
|
}
|
|
%End
|
|
|
|
public:
|
|
|
|
// not necessarily supported by all symbol layers...
|
|
virtual void setColor( const QColor& color );
|
|
virtual QColor color() const;
|
|
|
|
virtual ~QgsSymbolLayerV2();
|
|
|
|
virtual QString layerType() const = 0;
|
|
|
|
virtual void startRender( QgsSymbolV2RenderContext& context ) = 0;
|
|
virtual void stopRender( QgsSymbolV2RenderContext& context ) = 0;
|
|
|
|
virtual QgsSymbolLayerV2* clone() const = 0 /Factory/;
|
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
|
|
|
|
virtual QgsStringMap properties() const = 0;
|
|
|
|
virtual void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) = 0;
|
|
|
|
virtual QgsSymbolV2* subSymbol();
|
|
// set layer's subsymbol. takes ownership of the passed symbol
|
|
virtual bool setSubSymbol( QgsSymbolV2* symbol /Transfer/ );
|
|
|
|
QgsSymbolV2::SymbolType type() const;
|
|
|
|
void setLocked( bool locked );
|
|
bool isLocked() const;
|
|
|
|
// used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
|
|
void setRenderingPass( int renderingPass );
|
|
int renderingPass() const;
|
|
|
|
// symbol layers normally only use additional attributes to provide data defined settings
|
|
virtual QSet<QString> usedAttributes() const;
|
|
|
|
protected:
|
|
QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false );
|
|
};
|
|
|
|
//////////////////////
|
|
|
|
class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgssymbollayerv2.h>
|
|
%End
|
|
|
|
public:
|
|
virtual void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ) = 0;
|
|
|
|
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );
|
|
|
|
void setAngle( double angle );
|
|
double angle() const;
|
|
|
|
void setSize( double size );
|
|
double size() const;
|
|
|
|
void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod );
|
|
QgsSymbolV2::ScaleMethod scaleMethod() const;
|
|
|
|
void setOffset( QPointF offset );
|
|
QPointF offset();
|
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
|
|
|
|
virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
|
|
|
|
protected:
|
|
QgsMarkerSymbolLayerV2( bool locked = false );
|
|
};
|
|
|
|
class QgsLineSymbolLayerV2 : QgsSymbolLayerV2
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgssymbollayerv2.h>
|
|
%End
|
|
|
|
public:
|
|
virtual void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context ) = 0;
|
|
|
|
//! @note added in v1.7
|
|
virtual void renderPolygonOutline( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
|
|
|
|
virtual void setWidth( double width );
|
|
virtual double width() const;
|
|
|
|
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );
|
|
|
|
protected:
|
|
QgsLineSymbolLayerV2( bool locked = false );
|
|
};
|
|
|
|
class QgsFillSymbolLayerV2 : QgsSymbolLayerV2
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgssymbollayerv2.h>
|
|
%End
|
|
|
|
public:
|
|
virtual void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context ) = 0;
|
|
|
|
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );
|
|
|
|
void setAngle( double angle );
|
|
double angle() const;
|
|
|
|
protected:
|
|
QgsFillSymbolLayerV2( bool locked = false );
|
|
/**Default method to render polygon*/
|
|
void _renderPolygon( QPainter* p, const QPolygonF& points, const QList<QPolygonF>* rings );
|
|
};
|