Skip to content

Commit

Permalink
automatic indentation update (r12139-r12177)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12178 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 18, 2009
1 parent 621ee62 commit 29adf23
Show file tree
Hide file tree
Showing 17 changed files with 557 additions and 557 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsmeasuredialog.cpp
Expand Up @@ -35,7 +35,7 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WFlags f )
: QDialog( tool->canvas()->topLevelWidget(), f ), mTool( tool )
{
setupUi( this );

QPushButton *nb = new QPushButton( tr( "&New" ) );
buttonBox->addButton( nb, QDialogButtonBox::ActionRole );
connect( nb, SIGNAL( clicked() ), this, SLOT( restart() ) );
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsmaplayer.h
Expand Up @@ -78,10 +78,10 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
QString const & name() const;

/** This is the method that does the actual work of
/** This is the method that does the actual work of
* drawing the layer onto a paint device.
* @param QgsRenderContext - describes the extents,
* resolution etc. that should be used when rendering the
* @param QgsRenderContext - describes the extents,
* resolution etc. that should be used when rendering the
* layer.
*/
virtual bool draw( QgsRenderContext& rendererContext );
Expand Down Expand Up @@ -291,9 +291,9 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** Get the QImage used for caching render operations
* @note This method was added in QGIS 1.4 **/
QImage * cacheImage() { return mpCacheImage; }
/** Set the QImage used for caching render operations
/** Set the QImage used for caching render operations
* @note This method was added in QGIS 1.4 **/
void setCacheImage( QImage * thepImage );
void setCacheImage( QImage * thepImage );

public slots:

Expand Down
48 changes: 24 additions & 24 deletions src/core/qgsmaprenderer.cpp
Expand Up @@ -212,7 +212,7 @@ void QgsMapRenderer::adjustExtentToSize()

void QgsMapRenderer::render( QPainter* painter )
{
//flag to see if the render context has changed
//flag to see if the render context has changed
//since the last time we rendered. If it hasnt changed we can
//take some shortcuts with rendering
bool mySameAsLastFlag = true;
Expand Down Expand Up @@ -285,20 +285,20 @@ void QgsMapRenderer::render( QPainter* painter )
mySameAsLastFlag = false;
}

mRenderContext.setLabelingEngine(mLabelingEngine);
mRenderContext.setLabelingEngine( mLabelingEngine );
if ( mLabelingEngine )
mLabelingEngine->init();

// know we know if this render is just a repeat of the last time, we
// know we know if this render is just a repeat of the last time, we
// can clear caches if it has changed
if ( !mySameAsLastFlag )
{
//clear the cache pixmap if we changed resolution / extent
QSettings mySettings;
if ( mySettings.value ( "/qgis/enable_render_caching", false ).toBool() )
{
QgsMapLayerRegistry::instance()->clearAllLayerCaches();
}
//clear the cache pixmap if we changed resolution / extent
QSettings mySettings;
if ( mySettings.value( "/qgis/enable_render_caching", false ).toBool() )
{
QgsMapLayerRegistry::instance()->clearAllLayerCaches();
}
}

bool placeOverlays = false;
Expand All @@ -322,7 +322,7 @@ void QgsMapRenderer::render( QPainter* painter )
break;
}

// Store the painter in case we need to swap it out for the
// Store the painter in case we need to swap it out for the
// cache painter
QPainter * mypContextPainter = mRenderContext.painter();

Expand Down Expand Up @@ -422,31 +422,31 @@ void QgsMapRenderer::render( QPainter* painter )
ml->setCacheImage( 0 );
}
}

QSettings mySettings;
if ( ! split )//render caching does not yet cater for split extents
{
if ( mySettings.value ( "/qgis/enable_render_caching", false ).toBool() )
if ( mySettings.value( "/qgis/enable_render_caching", false ).toBool() )
{
if ( !mySameAsLastFlag || ml->cacheImage() == 0 )
if ( !mySameAsLastFlag || ml->cacheImage() == 0 )
{
QgsDebugMsg( "\n\n\nCaching enabled but layer redraw forced by extent change or empty cache\n\n\n" );
QImage * mypImage = new QImage( mRenderContext.painter()->device()->width(),
mRenderContext.painter()->device()->height(), QImage::Format_ARGB32 );
QImage * mypImage = new QImage( mRenderContext.painter()->device()->width(),
mRenderContext.painter()->device()->height(), QImage::Format_ARGB32 );
mypImage->fill( 0 );
ml->setCacheImage( mypImage ); //no need to delete the old one, maplayer does it for you
QPainter * mypPainter = new QPainter( ml->cacheImage() );
if ( mySettings.value( "/qgis/enable_anti_aliasing", false ).toBool() )
{
mypPainter->setRenderHint( QPainter::Antialiasing );
}
mRenderContext.setPainter( mypPainter );
mRenderContext.setPainter( mypPainter );
}
else if ( mySameAsLastFlag )
{
//draw from cached image
QgsDebugMsg( "\n\n\nCaching enabled --- drawing layer from cached image\n\n\n" );
mypContextPainter->drawImage( 0,0, *(ml->cacheImage()) );
mypContextPainter->drawImage( 0, 0, *( ml->cacheImage() ) );
disconnect( ml, SIGNAL( drawingProgress( int, int ) ), this, SLOT( onDrawingProgress( int, int ) ) );
//short circuit as there is nothing else to do...
continue;
Expand All @@ -472,7 +472,7 @@ void QgsMapRenderer::render( QPainter* painter )
}
else
{
QgsDebugMsg( "\n\n\nLayer rendered without issues\n\n\n" );
QgsDebugMsg( "\n\n\nLayer rendered without issues\n\n\n" );
}
if ( split )
{
Expand All @@ -489,24 +489,24 @@ void QgsMapRenderer::render( QPainter* painter )
mRenderContext.painter()->restore();
}

if ( mySettings.value ( "/qgis/enable_render_caching", false ).toBool() )
if ( mySettings.value( "/qgis/enable_render_caching", false ).toBool() )
{
if ( !split )
{
// composite the cached image into our view and then clean up from caching
// by reinstating the painter as it was swapped out for caching renders
delete mRenderContext.painter();
mRenderContext.setPainter( mypContextPainter );
mRenderContext.setPainter( mypContextPainter );
//draw from cached image that we created further up
mypContextPainter->drawImage( 0,0, *(ml->cacheImage()) );
mypContextPainter->drawImage( 0, 0, *( ml->cacheImage() ) );
}
}
disconnect( ml, SIGNAL( drawingProgress( int, int ) ), this, SLOT( onDrawingProgress( int, int ) ) );
}
else // layer not visible due to scale
{
QgsDebugMsg( "Layer not rendered because it is not within the defined "
"visibility scale range" );
"visibility scale range" );
}

} // while (li.hasPrevious())
Expand Down Expand Up @@ -1055,9 +1055,9 @@ bool QgsMapRenderer::writeXML( QDomNode & theNode, QDomDocument & theDoc )
return true;
}

void QgsMapRenderer::setLabelingEngine(QgsLabelingEngineInterface* iface)
void QgsMapRenderer::setLabelingEngine( QgsLabelingEngineInterface* iface )
{
if (mLabelingEngine)
if ( mLabelingEngine )
delete mLabelingEngine;

mLabelingEngine = iface;
Expand Down
30 changes: 15 additions & 15 deletions src/core/qgsmaprenderer.h
Expand Up @@ -42,19 +42,19 @@ class QgsFeature;
*/
class QgsLabelingEngineInterface
{
public:
virtual ~QgsLabelingEngineInterface() {}

//! called when we're going to start with rendering
virtual void init() = 0;
//! called when starting rendering of a layer
virtual int prepareLayer(QgsVectorLayer* layer, int& attrIndex) = 0;
//! called for every feature
virtual void registerFeature( QgsVectorLayer* layer, QgsFeature& feat ) = 0;
//! called when the map is drawn and labels should be placed
virtual void drawLabeling( QgsRenderContext& context ) = 0;
//! called when we're done with rendering
virtual void exit() = 0;
public:
virtual ~QgsLabelingEngineInterface() {}

//! called when we're going to start with rendering
virtual void init() = 0;
//! called when starting rendering of a layer
virtual int prepareLayer( QgsVectorLayer* layer, int& attrIndex ) = 0;
//! called for every feature
virtual void registerFeature( QgsVectorLayer* layer, QgsFeature& feat ) = 0;
//! called when the map is drawn and labels should be placed
virtual void drawLabeling( QgsRenderContext& context ) = 0;
//! called when we're done with rendering
virtual void exit() = 0;

};

Expand Down Expand Up @@ -178,7 +178,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
//! Set labeling engine. Previous engine (if any) is deleted.
//! Takes ownership of the engine.
//! Added in QGIS v1.4
void setLabelingEngine(QgsLabelingEngineInterface* iface);
void setLabelingEngine( QgsLabelingEngineInterface* iface );

signals:

Expand Down Expand Up @@ -234,7 +234,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
//! current extent to be drawn
QgsRectangle mExtent;
//
/** Last extent to we drew so we know if we can
/** Last extent to we drew so we know if we can
used layer render caching or not. Note there are no
accessors for this as it is intended to internal
use only.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrendercontext.cpp
Expand Up @@ -19,7 +19,7 @@
#include "qgsrendercontext.h"

QgsRenderContext::QgsRenderContext()
: mPainter( 0 ),
: mPainter( 0 ),
mCoordTransform( 0 ),
mDrawEditingInformation( false ),
mForceVectorOutput( true ),
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrendercontext.h
Expand Up @@ -76,7 +76,7 @@ class CORE_EXPORT QgsRenderContext
void setRendererScale( double scale ) {mRendererScale = scale;}
void setPainter( QPainter* p ) {mPainter = p;}
//! Added in QGIS v1.4
void setLabelingEngine(QgsLabelingEngineInterface* iface) { mLabelingEngine = iface; }
void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabelingEngine = iface; }

private:

Expand Down
72 changes: 36 additions & 36 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Expand Up @@ -6,33 +6,33 @@

#include <QPainter>

QgsSimpleFillSymbolLayerV2::QgsSimpleFillSymbolLayerV2(QColor color, Qt::BrushStyle style, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth)
: mBrushStyle(style), mBorderColor(borderColor), mBorderStyle(borderStyle), mBorderWidth(borderWidth)
QgsSimpleFillSymbolLayerV2::QgsSimpleFillSymbolLayerV2( QColor color, Qt::BrushStyle style, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth )
: mBrushStyle( style ), mBorderColor( borderColor ), mBorderStyle( borderStyle ), mBorderWidth( borderWidth )
{
mColor = color;
}


QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::create(const QgsStringMap& props)
QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::create( const QgsStringMap& props )
{
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;

if (props.contains("color"))
color = QgsSymbolLayerV2Utils::decodeColor(props["color"]);
if (props.contains("style"))
style = QgsSymbolLayerV2Utils::decodeBrushStyle(props["style"]);
if (props.contains("color_border"))
borderColor = QgsSymbolLayerV2Utils::decodeColor(props["color_border"]);
if (props.contains("style_border"))
borderStyle = QgsSymbolLayerV2Utils::decodePenStyle(props["style_border"]);
if (props.contains("width_border"))
if ( props.contains( "color" ) )
color = QgsSymbolLayerV2Utils::decodeColor( props["color"] );
if ( props.contains( "style" ) )
style = QgsSymbolLayerV2Utils::decodeBrushStyle( props["style"] );
if ( props.contains( "color_border" ) )
borderColor = QgsSymbolLayerV2Utils::decodeColor( props["color_border"] );
if ( props.contains( "style_border" ) )
borderStyle = QgsSymbolLayerV2Utils::decodePenStyle( props["style_border"] );
if ( props.contains( "width_border" ) )
borderWidth = props["width_border"].toDouble();

return new QgsSimpleFillSymbolLayerV2(color, style, borderColor, borderStyle, borderWidth);
return new QgsSimpleFillSymbolLayerV2( color, style, borderColor, borderStyle, borderWidth );
}


Expand All @@ -41,54 +41,54 @@ QString QgsSimpleFillSymbolLayerV2::layerType() const
return "SimpleFill";
}

void QgsSimpleFillSymbolLayerV2::startRender(QgsRenderContext& context)
void QgsSimpleFillSymbolLayerV2::startRender( QgsRenderContext& context )
{
mBrush = QBrush(mColor, mBrushStyle);
mPen = QPen(mBorderColor);
mPen.setStyle(mBorderStyle);
mPen.setWidthF(mBorderWidth);
mBrush = QBrush( mColor, mBrushStyle );
mPen = QPen( mBorderColor );
mPen.setStyle( mBorderStyle );
mPen.setWidthF( mBorderWidth );
}

void QgsSimpleFillSymbolLayerV2::stopRender(QgsRenderContext& context)
void QgsSimpleFillSymbolLayerV2::stopRender( QgsRenderContext& context )
{
}

void QgsSimpleFillSymbolLayerV2::renderPolygon(const QPolygonF& points, QList<QPolygonF>* rings, QgsRenderContext& context)
void QgsSimpleFillSymbolLayerV2::renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsRenderContext& context )
{
QPainter* p = context.painter();
p->setBrush(mBrush);
p->setPen(mPen);
if (rings == NULL)
p->setBrush( mBrush );
p->setPen( mPen );

if ( rings == NULL )
{
// simple polygon without holes
p->drawPolygon(points);
p->drawPolygon( points );
}
else
{
// polygon with holes must be drawn using painter path
QPainterPath path;
path.addPolygon(points);
path.addPolygon( points );
QList<QPolygonF>::iterator it;
for (it = rings->begin(); it != rings->end(); ++it)
path.addPolygon(*it);
p->drawPath(path);
for ( it = rings->begin(); it != rings->end(); ++it )
path.addPolygon( *it );

p->drawPath( path );
}
}

QgsStringMap QgsSimpleFillSymbolLayerV2::properties() const
{
QgsStringMap map;
map["color"] = QgsSymbolLayerV2Utils::encodeColor(mColor);
map["style"] = QgsSymbolLayerV2Utils::encodeBrushStyle(mBrushStyle);
map["color_border"] = QgsSymbolLayerV2Utils::encodeColor(mBorderColor);
map["style_border"] = QgsSymbolLayerV2Utils::encodePenStyle(mBorderStyle);
map["width_border"] = QString::number(mBorderWidth);
map["color"] = QgsSymbolLayerV2Utils::encodeColor( mColor );
map["style"] = QgsSymbolLayerV2Utils::encodeBrushStyle( mBrushStyle );
map["color_border"] = QgsSymbolLayerV2Utils::encodeColor( mBorderColor );
map["style_border"] = QgsSymbolLayerV2Utils::encodePenStyle( mBorderStyle );
map["width_border"] = QString::number( mBorderWidth );
return map;
}

QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::clone() const
{
return new QgsSimpleFillSymbolLayerV2(mColor, mBrushStyle, mBorderColor, mBorderStyle, mBorderWidth);
return new QgsSimpleFillSymbolLayerV2( mColor, mBrushStyle, mBorderColor, mBorderStyle, mBorderWidth );
}
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsfillsymbollayerv2.h
Expand Up @@ -21,7 +21,7 @@ class CORE_EXPORT QgsSimpleFillSymbolLayerV2 : public QgsFillSymbolLayerV2
QColor borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH );

// static stuff

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgslinesymbollayerv2.cpp
Expand Up @@ -101,7 +101,7 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::clone() const
class MyLine
{
public:
MyLine( QPointF p1, QPointF p2 ) : mVertical(false), mIncreasing(false), mT(0.0), mLength(0.0)
MyLine( QPointF p1, QPointF p2 ) : mVertical( false ), mIncreasing( false ), mT( 0.0 ), mLength( 0.0 )
{
if ( p1 == p2 )
return; // invalid
Expand Down Expand Up @@ -356,7 +356,7 @@ static double _calculateAngle( double x1, double y1, double x2, double y2 )
{
// return angle (in radians) between two points
if ( x1 == x2 )
return M_PI * ( y2 >= y1 ? 1 / 2 : 3 / 2 ); // angle is 90 or 270
return M_PI *( y2 >= y1 ? 1 / 2 : 3 / 2 ); // angle is 90 or 270

double t = ( y2 - y1 ) / ( x2 - x1 );
if ( t >= 0 )
Expand Down

0 comments on commit 29adf23

Please sign in to comment.