Skip to content
Permalink
Browse files

Arrow symbol layer: halved arrows and head width/height

The head size can now be configured by its width and its height
Arrows can also be rendered as "half arrows"
  • Loading branch information
mhugo committed Jun 1, 2016
1 parent 99c16f0 commit 6c9b5889062491ea7358f43318efe491b9178156
@@ -54,18 +54,31 @@ class QgsArrowSymbolLayer : public QgsLineSymbolLayerV2
/** Set the scale for the arrow start width */
void setArrowStartWidthUnitScale( const QgsMapUnitScale& s );

/** Get the current arrow head size */
double headSize() const;
/** Set the arrow head size */
void setHeadSize( double s );
/** Get the unit for the head size */
QgsSymbolV2::OutputUnit headSizeUnit() const;
/** Set the unit for the head size */
void setHeadSizeUnit( QgsSymbolV2::OutputUnit u );
/** Get the scale for the head size */
QgsMapUnitScale headSizeUnitScale() const;
/** Set the scale for the head size */
void setHeadSizeUnitScale( const QgsMapUnitScale& s );
/** Get the current arrow head width */
double headWidth() const;
/** Set the arrow head width */
void setHeadWidth( double s );
/** Get the unit for the head width */
QgsSymbolV2::OutputUnit headWidthUnit() const;
/** Set the unit for the head width */
void setHeadWidthUnit( QgsSymbolV2::OutputUnit u );
/** Get the scale for the head width */
QgsMapUnitScale headWidthUnitScale() const;
/** Set the scale for the head width */
void setHeadWidthUnitScale( const QgsMapUnitScale& s );

/** Get the current arrow head height */
double headHeight() const;
/** Set the arrow head height */
void setHeadHeight( double s );
/** Get the unit for the head height */
QgsSymbolV2::OutputUnit headHeightUnit() const;
/** Set the unit for the head height */
void setHeadHeightUnit( QgsSymbolV2::OutputUnit u );
/** Get the scale for the head height */
QgsMapUnitScale headHeightUnitScale() const;
/** Set the scale for the head height */
void setHeadHeightUnitScale( const QgsMapUnitScale& s );

/** Return whether it is a curved arrow or a straight one */
bool isCurved() const;
@@ -85,6 +98,19 @@ class QgsArrowSymbolLayer : public QgsLineSymbolLayerV2
/** Set the head type */
void setHeadType( HeadType t );

/** Possible arrow types */
enum ArrowType
{
ArrowPlain, //< Regular arrow
ArrowLeftHalf, //< Halved arrow, only the left side of the arrow is rendered (for straight arrows) or the side toward the exterior (for curved arrows)
ArrowRightHalf //< Halved arrow, only the right side of the arrow is rendered (for straight arrows) or the side toward the interior (for curved arrows)
};

/** Get the current arrow type */
ArrowType arrowType() const;
/** Set the arrow type */
void setArrowType( ArrowType t );

/**
* Should be reimplemented by subclasses to return a string map that
* contains the configuration information for the symbol layer. This

0 comments on commit 6c9b588

Please sign in to comment.
You can’t perform that action at this time.