Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
indentation update
  • Loading branch information
jef-n committed Dec 17, 2013
1 parent bf45669 commit 24acebe
Show file tree
Hide file tree
Showing 27 changed files with 255 additions and 251 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/JoinAttributes.py
Expand Up @@ -75,7 +75,7 @@ def processAlgorithm(self, progress):
joinField2Index = layer2.fieldNameIndex(field2)

# Output
outFields = vector.combineVectorFields(layer,layer2)
outFields = vector.combineVectorFields(layer,layer2)

writer = output.getVectorWriter(outFields, provider.geometryType(),
layer.crs())
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsoptions.cpp
Expand Up @@ -561,9 +561,9 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
chkUseRenderCaching->setChecked( settings.value( "/qgis/enable_render_caching", false ).toBool() );

// Default simplify drawing configuration
mSimplifyDrawingGroupBox->setChecked( settings.value( "/qgis/simplifyDrawingHints", (int)QgsVectorLayer::DefaultSimplification ).toInt() != QgsVectorLayer::NoSimplification );
mSimplifyDrawingSlider->setValue( (int)(5.0f * (settings.value( "/qgis/simplifyDrawingTol", QGis::DEFAULT_MAPTOPIXEL_THRESHOLD ).toFloat()-1)) );
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value()>0 );
mSimplifyDrawingGroupBox->setChecked( settings.value( "/qgis/simplifyDrawingHints", ( int )QgsVectorLayer::DefaultSimplification ).toInt() != QgsVectorLayer::NoSimplification );
mSimplifyDrawingSlider->setValue(( int )( 5.0f * ( settings.value( "/qgis/simplifyDrawingTol", QGis::DEFAULT_MAPTOPIXEL_THRESHOLD ).toFloat() - 1 ) ) );
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value() > 0 );

// Slightly awkard here at the settings value is true to use QImage,
// but the checkbox is true to use QPixmap
Expand Down Expand Up @@ -2080,6 +2080,6 @@ void QgsOptions::saveDefaultDatumTransformations()

void QgsOptions::on_mSimplifyDrawingSlider_valueChanged( int value )
{
mSimplifyDrawingPanel->setVisible( value>0 );
mSimplifyDrawingPanel->setVisible( value > 0 );
}

6 changes: 3 additions & 3 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -394,8 +394,8 @@ void QgsVectorLayerProperties::syncToLayer( void )

// get simplify drawing configuration
mSimplifyDrawingGroupBox->setChecked( layer->simplifyDrawingHints() != QgsVectorLayer::NoSimplification );
mSimplifyDrawingSlider->setValue( (int)(5.0f * (layer->simplifyDrawingTol()-1)) );
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value()>0 );
mSimplifyDrawingSlider->setValue(( int )( 5.0f * ( layer->simplifyDrawingTol() - 1 ) ) );
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value() > 0 );

// load appropriate symbology page (V1 or V2)
updateSymbologyPage();
Expand Down Expand Up @@ -1085,5 +1085,5 @@ void QgsVectorLayerProperties::on_mMaximumScaleSetCurrentPushButton_clicked()

void QgsVectorLayerProperties::on_mSimplifyDrawingSlider_valueChanged( int value )
{
mSimplifyDrawingPanel->setVisible( value>0 );
mSimplifyDrawingPanel->setVisible( value > 0 );
}
4 changes: 2 additions & 2 deletions src/core/qgsclipper.cpp
Expand Up @@ -45,8 +45,8 @@ const unsigned char* QgsClipper::clippedLineWKB( const unsigned char* wkb, const

bool hasZValue = ( wkbType == QGis::WKBLineString25D );

int sizeOfDoubleX = sizeof(double);
int sizeOfDoubleY = hasZValue ? 2*sizeof(double) : sizeof(double);
int sizeOfDoubleX = sizeof( double );
int sizeOfDoubleY = hasZValue ? 2 * sizeof( double ) : sizeof( double );

double p0x, p0y, p1x = 0.0, p1y = 0.0; //original coordinates
double p1x_c, p1y_c; //clipped end coordinates
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -1682,7 +1682,7 @@ int QgsCoordinateReferenceSystem::syncDb()

int inserted = 0, updated = 0, deleted = 0, errors = 0;

qDebug( "Load srs db from: %s", QgsApplication::srsDbFilePath().toLocal8Bit().constData());
qDebug( "Load srs db from: %s", QgsApplication::srsDbFilePath().toLocal8Bit().constData() );

sqlite3 *database;
if ( sqlite3_open( dbFilePath.toUtf8().constData(), &database ) != SQLITE_OK )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgscoordinatetransform.cpp
Expand Up @@ -657,7 +657,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
}
}

dir = (direction == ForwardTransform) ? tr( "forward transform" ) : tr( "inverse transform" );
dir = ( direction == ForwardTransform ) ? tr( "forward transform" ) : tr( "inverse transform" );

QString msg = tr( "%1 of\n"
"%2"
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsfeaturerequest.cpp
Expand Up @@ -190,19 +190,19 @@ bool QgsFeatureRequest::acceptFeature( const QgsFeature& feature )
return true;
}

QgsFeatureRequest& QgsFeatureRequest::setCoordinateTransform( const QgsCoordinateTransform* ct )
QgsFeatureRequest& QgsFeatureRequest::setCoordinateTransform( const QgsCoordinateTransform* ct )
{
mMapCoordTransform = ct;
return *this;
}

QgsFeatureRequest& QgsFeatureRequest::setMapToPixel( const QgsMapToPixel* mtp )
QgsFeatureRequest& QgsFeatureRequest::setMapToPixel( const QgsMapToPixel* mtp )
{
mMapToPixel = mtp;
return *this;
}

QgsFeatureRequest& QgsFeatureRequest::setMapToPixelTol( float map2pixelTol )
QgsFeatureRequest& QgsFeatureRequest::setMapToPixelTol( float map2pixelTol )
{
mMapToPixelTol = map2pixelTol;
return *this;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsfeaturerequest.h
Expand Up @@ -142,7 +142,7 @@ class CORE_EXPORT QgsFeatureRequest

const QgsCoordinateTransform* coordinateTransform() const { return mMapCoordTransform; }
QgsFeatureRequest& setCoordinateTransform( const QgsCoordinateTransform* ct );

const QgsMapToPixel* mapToPixel() const { return mMapToPixel; }
QgsFeatureRequest& setMapToPixel( const QgsMapToPixel* mtp );

Expand All @@ -159,7 +159,7 @@ class CORE_EXPORT QgsFeatureRequest
QgsAttributeList mAttrs;

//! For transformation between coordinate systems from current layer to map target. Can be 0 if on-the-fly reprojection is not used
const QgsCoordinateTransform* mMapCoordTransform;
const QgsCoordinateTransform* mMapCoordTransform;
//! For transformation between map coordinates and device coordinates
const QgsMapToPixel* mMapToPixel;
//! Factor tolterance to apply in transformation between map coordinates and device coordinates
Expand Down
14 changes: 7 additions & 7 deletions src/core/qgsgeometrysimplifier.cpp
Expand Up @@ -20,13 +20,13 @@
//! Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance
bool QgsAbstractGeometrySimplifier::canbeGeneralizedByDeviceBoundingBox( const QgsRectangle& envelope, float mapToPixelTol )
{
return (envelope.xMaximum()-envelope.xMinimum()) < mapToPixelTol && (envelope.yMaximum()-envelope.yMinimum()) < mapToPixelTol;
return ( envelope.xMaximum() - envelope.xMinimum() ) < mapToPixelTol && ( envelope.yMaximum() - envelope.yMinimum() ) < mapToPixelTol;
}

//! Returns whether the device-geometry can be replaced by its BBOX when is applied the specified tolerance
bool QgsAbstractGeometrySimplifier::canbeGeneralizedByDeviceBoundingBox( const QVector<QPointF>& points, float mapToPixelTol )
{
double xmin = std::numeric_limits<double>::max(), x,y;
double xmin = std::numeric_limits<double>::max(), x, y;
double ymin = std::numeric_limits<double>::max();
double xmax = -std::numeric_limits<double>::max();
double ymax = -std::numeric_limits<double>::max();
Expand All @@ -36,10 +36,10 @@ bool QgsAbstractGeometrySimplifier::canbeGeneralizedByDeviceBoundingBox( const Q
x = points[i].x();
y = points[i].y();

if (xmin>x) xmin = x;
if (ymin>y) ymin = y;
if (xmax<x) xmax = x;
if (ymax<y) ymax = y;
if ( xmin > x ) xmin = x;
if ( ymin > y ) ymin = y;
if ( xmax < x ) xmax = x;
if ( ymax < y ) ymax = y;
}
return canbeGeneralizedByDeviceBoundingBox( QgsRectangle( xmin, ymin, xmax, ymax ), mapToPixelTol );
}
Expand Down Expand Up @@ -69,7 +69,7 @@ bool QgsTopologyPreservingSimplifier::simplifyGeometry( QgsGeometry* geometry )
if ( g )
{
size_t wkbSize = g->wkbSize();
unsigned char* wkb = (unsigned char*)malloc( wkbSize );
unsigned char* wkb = ( unsigned char* )malloc( wkbSize );
memcpy( wkb, g->asWkb(), wkbSize );
geometry->fromWkb( wkb, wkbSize );
delete g;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsgeometrysimplifier.h
Expand Up @@ -30,7 +30,7 @@ class CORE_EXPORT QgsAbstractGeometrySimplifier
//! Simplifies the specified geometry
virtual bool simplifyGeometry( QgsGeometry* geometry ) = 0;

// MapToPixel simplification helper methods
// MapToPixel simplification helper methods
public:
//! Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance
static bool canbeGeneralizedByDeviceBoundingBox( const QgsRectangle& envelope, float mapToPixelTol = 1.0f );
Expand All @@ -42,7 +42,7 @@ class CORE_EXPORT QgsAbstractGeometrySimplifier
/**
* Implementation of GeometrySimplifier using the Douglas-Peucker algorithm
*
* Simplifies a geometry, ensuring that the result is a valid geometry having the same dimension and number of components as the input.
* Simplifies a geometry, ensuring that the result is a valid geometry having the same dimension and number of components as the input.
* The simplification uses a maximum distance difference algorithm similar to the one used in the Douglas-Peucker algorithm.
*/
class CORE_EXPORT QgsTopologyPreservingSimplifier : public QgsAbstractGeometrySimplifier
Expand Down

0 comments on commit 24acebe

Please sign in to comment.