Skip to content
Permalink
Browse files
sip sync and indentation update
  • Loading branch information
jef-n committed May 24, 2014
1 parent 7e5b6f7 commit a168b9031b7ca61580d6047c8bed4c59d7a373cb
@@ -5,66 +5,70 @@ class QgsInvertedPolygonRenderer : QgsFeatureRendererV2
%End
public:

/** Constructor
* @param embeddedRenderer optional embeddedRenderer. If null, a default one will be assigned
*/
QgsInvertedPolygonRenderer( const QgsFeatureRendererV2* embeddedRenderer /Transfer/ = 0 );
virtual ~QgsInvertedPolygonRenderer();
/** Constructor
* @param embeddedRenderer optional embeddedRenderer. If null, a default one will be assigned
*/
QgsInvertedPolygonRenderer( const QgsFeatureRendererV2* embeddedRenderer /Transfer/ = 0 );
virtual ~QgsInvertedPolygonRenderer();

/** Used to clone this feature renderer.*/
virtual QgsFeatureRendererV2* clone() /Factory/;
/** Used to clone this feature renderer.*/
virtual QgsFeatureRendererV2* clone() /Factory/;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );

/** Renders a given feature.
* This will here collect features. The actual rendering will be postponed to stopRender()
* @param feature the feature to render
* @param context the rendering context
* @param layer the symbol layer to render, if that makes sense
* @param selected whether this feature has been selected (this will add decorations)
* @param drawVertexMarker whether this feature has vertex markers (in edit mode usually)
* @returns true if the rendering was ok
*/
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
/** Renders a given feature.
* This will here collect features. The actual rendering will be postponed to stopRender()
* @param feature the feature to render
* @param context the rendering context
* @param layer the symbol layer to render, if that makes sense
* @param selected whether this feature has been selected (this will add decorations)
* @param drawVertexMarker whether this feature has vertex markers (in edit mode usually)
* @returns true if the rendering was ok
*/
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );

/**
* The actual rendering will take place here.
* Features collected during renderFeature() are rendered using the embedded feature renderer
*/
virtual void stopRender( QgsRenderContext& context );
/**
* The actual rendering will take place here.
* Features collected during renderFeature() are rendered using the embedded feature renderer
*/
virtual void stopRender( QgsRenderContext& context );

/** @returns a textual reprensation of the renderer */
virtual QString dump() const;
/** @returns a textual representation of the renderer */
virtual QString dump() const;

/** Proxy that will call this method on the embedded renderer. */
virtual QList<QString> usedAttributes();
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities();
/** Proxy that will call this method on the embedded renderer. */
virtual QgsSymbolV2List symbols();
/** Proxy that will call this method on the embedded renderer. */
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature );
/** Proxy that will call this method on the embedded renderer. */
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat );
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
/** Proxy that will call this method on the embedded renderer. */
virtual bool willRenderFeature( QgsFeature& feat );
/** Proxy that will call this method on the embedded renderer. */
virtual QList<QString> usedAttributes();
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities();
/** Proxy that will call this method on the embedded renderer. */
virtual QgsSymbolV2List symbols();
/** Proxy that will call this method on the embedded renderer. */
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature );
/** Proxy that will call this method on the embedded renderer. */
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat );
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
/** Proxy that will call this method on the embedded renderer.
@note not available in python bindings
*/
// virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, QString rule = "" );
/** Proxy that will call this method on the embedded renderer. */
virtual bool willRenderFeature( QgsFeature& feat );

/** Creates a renderer out of an XML, for loading*/
static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/;
/** Creates a renderer out of an XML, for loading*/
static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/;

/** Creates an XML representation of the renderer. Used for saving purpose
* @param doc the XML document where to create the XML subtree
* @returns the created XML subtree
*/
virtual QDomElement save( QDomDocument& doc );
/** Creates an XML representation of the renderer. Used for saving purpose
* @param doc the XML document where to create the XML subtree
* @returns the created XML subtree
*/
virtual QDomElement save( QDomDocument& doc );

/** sets the embedded renderer
* @param subRenderer the embedded renderer (will be cloned)
*/
void setEmbeddedRenderer( const QgsFeatureRendererV2* subRenderer );
/** @returns the current embedded renderer
*/
const QgsFeatureRendererV2* embeddedRenderer() const;
/** sets the embedded renderer
* @param subRenderer the embedded renderer (will be cloned)
*/
void setEmbeddedRenderer( const QgsFeatureRendererV2* subRenderer );
/** @returns the current embedded renderer
*/
const QgsFeatureRendererV2* embeddedRenderer() const;
};
@@ -3,21 +3,21 @@ class QgsInvertedPolygonRendererWidget : QgsRendererV2Widget
%TypeHeaderCode
#include <qgsinvertedpolygonrendererwidget.h>
%End
public:
/** static creation method
* @param layer the layer where this renderer is applied
* @param style
* @param renderer the mask renderer (will take ownership)
*/
static QgsRendererV2Widget* create( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) /Factory/;
public:
/** static creation method
* @param layer the layer where this renderer is applied
* @param style
* @param renderer the mask renderer (will take ownership)
*/
static QgsRendererV2Widget* create( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) /Factory/;

/** Constructor
* @param layer the layer where this renderer is applied
* @param style
* @param renderer the mask renderer (will take ownership)
*/
QgsInvertedPolygonRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer );
/** Constructor
* @param layer the layer where this renderer is applied
* @param style
* @param renderer the mask renderer (will take ownership)
*/
QgsInvertedPolygonRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer );

/** @returns the current feature renderer */
virtual QgsFeatureRendererV2* renderer();
/** @returns the current feature renderer */
virtual QgsFeatureRendererV2* renderer();
};
@@ -22,30 +22,6 @@ set -e
export elcr="$(tput el)$(tput cr)"

find python src tests -type f -print | while read f; do
case "$f" in
src/app/gps/qwtpolar-*|src/core/spatialite/*|src/core/spatialindex/src/*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/ext-libs/*|src/providers/sqlanywhere/sqlanyconnection/*|src/providers/spatialite/qspatialite/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped
continue
;;

*.cpp|*.h|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H|*.hpp)
cmd=astyle.sh
;;

*.ui|*.qgm|*.txt|*.t2t|*.sip|resources/context_help/*)
cmd="flip -ub"
;;

*.py)
cmd="perl -i.prepare -pe 's/[\r\t ]+$//;'"
;;

*)
echo -ne "$f skipped $elcr"
continue
;;
esac

if [ -f "$f.astyle" ]; then
# reformat backup
cp "$f.astyle" "$f"
@@ -56,8 +32,8 @@ find python src tests -type f -print | while read f; do
touch -r "$f" "$f.astyle"
fi

echo -ne "Reformating $f $elcr"
eval "$cmd '$f'"
echo -ne "Reformatting $f $elcr"
astyle.sh "$f"
done

echo
@@ -59,12 +59,36 @@ $ARTISTIC_STYLE_OPTIONS \
--unpad=paren"

for f in "$@"; do
case "$f" in
src/app/gps/qwtpolar-*|src/core/spatialite/*|src/core/spatialindex/src/*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/ext-libs/*|src/providers/sqlanywhere/sqlanyconnection/*|src/providers/spatialite/qspatialite/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped
continue
;;

*.cpp|*.h|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H|*.hpp)
cmd="$ASTYLE $ARTISTIC_STYLE_OPTIONS"
;;

*.ui|*.qgm|*.txt|*.t2t|*.sip|resources/context_help/*)
cmd=:
;;

*.py)
cmd="perl -i.prepare -pe 's/[\r\t ]+$//;'"
;;

*)
echo -ne "$f skipped $elcr"
continue
;;
esac

if ! [ -f "$f" ]; then
echo "$f not found" >&2
continue
fi

flip -ub "$f"
#qgsloggermig.pl "$f"
$ASTYLE $ARTISTIC_STYLE_OPTIONS "$f"
eval "$cmd '$f'"
done

0 comments on commit a168b90

Please sign in to comment.