mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Added python bindings for vector field symbollayer
This commit is contained in:
parent
2b6efe5c7a
commit
ed13141b67
@ -82,6 +82,7 @@
|
||||
%Include qgsuniquevaluerenderer.sip
|
||||
%Include qgsattributeaction.sip
|
||||
%Include qgsvectordataprovider.sip
|
||||
%Include qgsvectorfieldsymbollayer.sip
|
||||
%Include qgsvectorfilewriter.sip
|
||||
%Include qgsvectorlayer.sip
|
||||
%Include qgsvectorlayerimport.sip
|
||||
|
60
python/core/qgsvectorfieldsymbollayer.sip
Normal file
60
python/core/qgsvectorfieldsymbollayer.sip
Normal file
@ -0,0 +1,60 @@
|
||||
class QgsVectorFieldSymbolLayer: QgsMarkerSymbolLayerV2
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsvectorfieldsymbollayer.h>
|
||||
%End
|
||||
public:
|
||||
enum VectorFieldType
|
||||
{
|
||||
Cartesian = 0,
|
||||
Polar,
|
||||
Height
|
||||
};
|
||||
|
||||
enum AngleOrientation
|
||||
{
|
||||
ClockwiseFromNorth = 0,
|
||||
CounterclockwiseFromEast
|
||||
};
|
||||
|
||||
enum AngleUnits
|
||||
{
|
||||
Degrees = 0,
|
||||
Radians
|
||||
};
|
||||
|
||||
QgsVectorFieldSymbolLayer();
|
||||
~QgsVectorFieldSymbolLayer();
|
||||
|
||||
static QgsSymbolLayerV2* create( const QgsStringMap& properties );
|
||||
|
||||
QString layerType() const;
|
||||
|
||||
bool setSubSymbol( QgsSymbolV2* symbol );
|
||||
QgsSymbolV2* subSymbol();
|
||||
|
||||
void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context );
|
||||
void startRender( QgsSymbolV2RenderContext& context );
|
||||
void stopRender( QgsSymbolV2RenderContext& context );
|
||||
|
||||
QgsSymbolLayerV2* clone() const;
|
||||
QgsStringMap properties() const;
|
||||
|
||||
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );
|
||||
|
||||
QSet<QString> usedAttributes() const;
|
||||
|
||||
//setters and getters
|
||||
void setXAttribute( const QString& attribute );
|
||||
QString xAttribute() const;
|
||||
void setYAttribute( const QString& attribute );
|
||||
QString yAttribute() const;
|
||||
void setScale( double s );
|
||||
double scale() const;
|
||||
void setVectorFieldType( VectorFieldType type );
|
||||
VectorFieldType vectorFieldType() const;
|
||||
void setAngleOrientation( AngleOrientation orientation );
|
||||
AngleOrientation angleOrientation() const;
|
||||
void setAngleUnits( AngleUnits units );
|
||||
AngleUnits angleUnits() const;
|
||||
};
|
@ -490,7 +490,16 @@ class QgsSymbolLayerV2
|
||||
%ConvertToSubClassCode
|
||||
switch (sipCpp->type())
|
||||
{
|
||||
case QgsSymbolV2::Marker: sipClass = sipClass_QgsMarkerSymbolLayerV2; break;
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user