Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QgsFillSymbolLayerV2 descendants missing from sip #237

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/core/core.sip
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
%Include qgsnetworkaccessmanager.sip

%Include symbology-ng-core.sip
%Include qgsmarkersymbollayer.sip
%Include qgslinesymbollayer.sip
%Include qgsfillsymbollayer.sip

%Include qgsgpsconnection.sip
%Include qgsgpsconnectionregistry.sip
Expand Down
223 changes: 223 additions & 0 deletions python/core/qgsfillsymbollayer.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
class QgsFillSymbolLayerV2 : QgsSymbolLayerV2
{
%TypeHeaderCode
#include <qgssymbollayerv2.h>
%End

%ConvertToSubClassCode
if (dynamic_cast<QgsSimpleFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsSimpleFillSymbolLayerV2;
else if (dynamic_cast<QgsImageFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsImageFillSymbolLayer;
else if (dynamic_cast<QgsCentroidFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsCentroidFillSymbolLayerV2;
else
sipClass = 0;
%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);
};

///////////////

class QgsCentroidFillSymbolLayerV2:QgsFillSymbolLayerV2
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End

public:
QgsCentroidFillSymbolLayerV2();
~QgsCentroidFillSymbolLayerV2();

//! static stuff
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
static QgsSymbolLayerV2* createFromSld( QDomElement &element );

//! implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
void setColor( const QColor& color );
QgsSymbolV2* subSymbol();
bool setSubSymbol( QgsSymbolV2* symbol );

};

///////////////
class QgsSimpleFillSymbolLayerV2:QgsFillSymbolLayerV2
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End

public:
QgsSimpleFillSymbolLayerV2(QColor color = DEFAULT_SIMPLEFILL_COLOR,
Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
QColor borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH);
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
Qt::BrushStyle brushStyle() const;
void setBrushStyle( Qt::BrushStyle style );
QColor borderColor() const;
void setBorderColor( QColor borderColor );
Qt::PenStyle borderStyle() const ;
void setBorderStyle( Qt::PenStyle borderStyle );
double borderWidth() const;
void setBorderWidth( double borderWidth );
void setOffset( QPointF offset ) ;
QPointF offset() ;
};


class QgsImageFillSymbolLayer:QgsFillSymbolLayerV2
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End

%ConvertToSubClassCode
if (dynamic_cast<QgsLinePatternFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsLinePatternFillSymbolLayer;
else if (dynamic_cast<QgsPointPatternFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsPointPatternFillSymbolLayer;
else if (dynamic_cast<QgsSVGFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsSVGFillSymbolLayer;
else
sipClass = 0;
%End

public:
QgsImageFillSymbolLayer ();
virtual ~QgsImageFillSymbolLayer ();

void renderPolygon (const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context);
virtual QgsSymbolV2 * subSymbol ();
virtual bool setSubSymbol (QgsSymbolV2 *symbol);

};


///////////////

class QgsSVGFillSymbolLayer:QgsImageFillSymbolLayer
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End

public:
QgsSVGFillSymbolLayer( const QString& svgFilePath = "", double width = 20, double rotation = 0.0 );
QgsSVGFillSymbolLayer( const QByteArray& svgData, double width = 20, double rotation = 0.0 );
~QgsSVGFillSymbolLayer();

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
static QgsSymbolLayerV2* createFromSld( QDomElement &element );

//! implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

//! getters and setters
void setSvgFilePath( const QString& svgPath );
QString svgFilePath() const;
void setPatternWidth( double width );
double patternWidth() const;

void setSvgFillColor( const QColor& c );
QColor svgFillColor() const;
void setSvgOutlineColor( const QColor& c );
QColor svgOutlineColor() const;
void setSvgOutlineWidth( double w );
double svgOutlineWidth() const;

};

///////////////

class QgsPointPatternFillSymbolLayer:QgsImageFillSymbolLayer
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End

public:
QgsPointPatternFillSymbolLayer();
~QgsPointPatternFillSymbolLayer();

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
static QgsSymbolLayerV2* createFromSld( QDomElement &element );
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
//! getters and setters
double distanceX() const;
void setDistanceX( double d );
double distanceY() const;
void setDistanceY( double d );
double displacementX() const;
void setDisplacementX( double d );
double displacementY() const;
void setDisplacementY( double d );
bool setSubSymbol( QgsSymbolV2* symbol );
virtual QgsSymbolV2* subSymbol();
};

///////////////

class QgsLinePatternFillSymbolLayer:QgsImageFillSymbolLayer
{
%TypeHeaderCode
#include <qgsfillsymbollayerv2.h>
%End

public:
QgsLinePatternFillSymbolLayer();
~QgsLinePatternFillSymbolLayer();

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
static QgsSymbolLayerV2* createFromSld( QDomElement &element );
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
void setLineAngle( double a );
double lineAngle() const;
void setDistance( double d );
double distance() const;
void setLineWidth( double w );
double lineWidth() const;
void setColor( const QColor& c );
QColor color() const;
void setOffset( double offset );
double offset() const;
};
165 changes: 165 additions & 0 deletions python/core/qgslinesymbollayer.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
class QgsLineSymbolLayerV2 : QgsSymbolLayerV2
{
%TypeHeaderCode
#include <qgssymbollayerv2.h>
%End

%ConvertToSubClassCode
if (dynamic_cast<QgsLineDecorationSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsLineDecorationSymbolLayerV2;
else if (dynamic_cast<QgsMarkerLineSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsMarkerLineSymbolLayerV2;
else if (dynamic_cast<QgsSimpleLineSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsSimpleLineSymbolLayerV2;
else
sipClass = 0;
%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 );

void setWidth(double width);
double width() const;

void drawPreviewIcon(QgsSymbolV2RenderContext& context, QSize size);

protected:
QgsLineSymbolLayerV2(bool locked = false);

};

///////////////

class QgsLineDecorationSymbolLayerV2:QgsLineSymbolLayerV2
{
%TypeHeaderCode
#include <qgslinesymbollayerv2.h>
%End

public:
QgsLineDecorationSymbolLayerV2( QColor color = DEFAULT_LINEDECORATION_COLOR,
double width = DEFAULT_LINEDECORATION_WIDTH );

~QgsLineDecorationSymbolLayerV2();

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );

// missing implementation in .cpp
//static QgsSymbolLayerV2* createFromSld( QDomElement &element );

QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

};

///////////////

class QgsMarkerLineSymbolLayerV2:QgsLineSymbolLayerV2
{
%TypeHeaderCode
#include <qgslinesymbollayerv2.h>
%End

public:
QgsMarkerLineSymbolLayerV2( bool rotateMarker = DEFAULT_MARKERLINE_ROTATE,
double interval = DEFAULT_MARKERLINE_INTERVAL );

~QgsMarkerLineSymbolLayerV2();

enum Placement
{
Interval,
Vertex,
LastVertex,
FirstVertex,
CentralPoint
};

// static stuff

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
static QgsSymbolLayerV2* createFromSld( QDomElement &element );

// implemented from base classes

QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
void setColor( const QColor& color );
QgsSymbolV2* subSymbol();
bool setSubSymbol( QgsSymbolV2* symbol );
virtual void setWidth( double width );
virtual double width() const;

bool rotateMarker() const;
void setRotateMarker( bool rotate );
double interval() const;
void setInterval( double interval );
double offset() const;
void setOffset( double offset );
Placement placement() const;
void setPlacement( Placement p );

protected:

void renderPolylineInterval( const QPolygonF& points, QgsSymbolV2RenderContext& context );
void renderPolylineVertex( const QPolygonF& points, QgsSymbolV2RenderContext& context );
void renderPolylineCentral( const QPolygonF& points, QgsSymbolV2RenderContext& context );

};

///////////////

class QgsSimpleLineSymbolLayerV2:QgsLineSymbolLayerV2
{
%TypeHeaderCode
#include <qgslinesymbollayerv2.h>
%End

public:
QgsSimpleLineSymbolLayerV2( QColor color = DEFAULT_SIMPLELINE_COLOR,
double width = DEFAULT_SIMPLELINE_WIDTH,
Qt::PenStyle penStyle = DEFAULT_SIMPLELINE_PENSTYLE );

// static stuff

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
static QgsSymbolLayerV2* createFromSld( QDomElement &element );

// implemented from base classes

QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

Qt::PenStyle penStyle() const;
void setPenStyle( Qt::PenStyle style );
Qt::PenJoinStyle penJoinStyle() const;
void setPenJoinStyle( Qt::PenJoinStyle style );
Qt::PenCapStyle penCapStyle() const;
void setPenCapStyle( Qt::PenCapStyle style );
double offset() const;
void setOffset( double offset );
bool useCustomDashPattern() const;
void setUseCustomDashPattern( bool b );
QVector<qreal> customDashVector() const;
void setCustomDashVector( const QVector<qreal>& vector );

};
Loading