Skip to content

Commit

Permalink
mapserver indentation update
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14112 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 21, 2010
1 parent 4e4643d commit 514b251
Show file tree
Hide file tree
Showing 54 changed files with 5,785 additions and 5,767 deletions.
498 changes: 249 additions & 249 deletions src/mapserver/qgis_map_serv.cpp

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions src/mapserver/qgsbetweenfilter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgsbetweenfilter.cpp
qgsbetweenfilter.cpp
--------------------
begin : Feb 07, 2008
copyright : (C) 2008 by Marco Hugentobler
Expand All @@ -17,35 +17,35 @@

#include "qgsbetweenfilter.h"

QgsBetweenFilter::QgsBetweenFilter(): QgsFilter(-1)
QgsBetweenFilter::QgsBetweenFilter(): QgsFilter( -1 )
{
}
QgsBetweenFilter::QgsBetweenFilter(int attributeIndex, const QString& lowerValue, const QString& upperValue): QgsFilter(attributeIndex), mLowerValue(lowerValue), mUpperValue(upperValue)

QgsBetweenFilter::QgsBetweenFilter( int attributeIndex, const QString& lowerValue, const QString& upperValue ): QgsFilter( attributeIndex ), mLowerValue( lowerValue ), mUpperValue( upperValue )
{
}

QgsBetweenFilter::~QgsBetweenFilter()
{
}

bool QgsBetweenFilter::evaluate(const QgsFeature& f) const
bool QgsBetweenFilter::evaluate( const QgsFeature& f ) const
{
QVariant propertyValue = propertyIndexValue(f);
QVariant propertyValue = propertyIndexValue( f );

//numeric or alphanumeric?
bool numeric = true;
if (propertyValue.type() == QVariant::String)
{
numeric = false;
}
if(numeric)
{
return (propertyValue.toDouble() >= mLowerValue.toDouble() && propertyValue.toDouble() <= mUpperValue.toDouble());
}
if ( propertyValue.type() == QVariant::String )
{
numeric = false;
}

if ( numeric )
{
return ( propertyValue.toDouble() >= mLowerValue.toDouble() && propertyValue.toDouble() <= mUpperValue.toDouble() );
}
else
{
return (propertyValue.toString() >= mLowerValue && propertyValue.toString() <= mUpperValue);
}
{
return ( propertyValue.toString() >= mLowerValue && propertyValue.toString() <= mUpperValue );
}
}
36 changes: 18 additions & 18 deletions src/mapserver/qgsbetweenfilter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgsbetweenfilter.h
qgsbetweenfilter.h
-------------------
begin : Feb 07, 2008
copyright : (C) 2008 by Marco Hugentobler
Expand Down Expand Up @@ -36,24 +36,24 @@ Sample xml fragment:
*/
class QgsBetweenFilter: public QgsFilter
{
public:
QgsBetweenFilter();
QgsBetweenFilter(int attributeIndex, const QString& lowerValue, const QString& upperValue);
~QgsBetweenFilter();

/**Evaluates a feature against the filter.
@return true if the filter applies for the feature*/
bool evaluate(const QgsFeature& f) const;
QString lowerValue() const {return mLowerValue;}
QString upperValue() const {return mUpperValue;}
void setLowerValue(const QString& lv){mLowerValue = lv;}
void setUpperValue(const QString& uv){mUpperValue = uv;}
public:
QgsBetweenFilter();
QgsBetweenFilter( int attributeIndex, const QString& lowerValue, const QString& upperValue );
~QgsBetweenFilter();

private:
/**Lower boundary*/
QString mLowerValue;
/**Upper boundary*/
QString mUpperValue;
/**Evaluates a feature against the filter.
@return true if the filter applies for the feature*/
bool evaluate( const QgsFeature& f ) const;
QString lowerValue() const {return mLowerValue;}
QString upperValue() const {return mUpperValue;}
void setLowerValue( const QString& lv ) {mLowerValue = lv;}
void setUpperValue( const QString& uv ) {mUpperValue = uv;}

private:
/**Lower boundary*/
QString mLowerValue;
/**Upper boundary*/
QString mUpperValue;
};

#endif //QGSBETWEENFILTER_H
122 changes: 61 additions & 61 deletions src/mapserver/qgscomparisonfilter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgscomparisonfilter.cpp
qgscomparisonfilter.cpp
-----------------------
begin : Jan 31, 2008
copyright : (C) 2008 by Marco Hugentobler
Expand All @@ -17,98 +17,98 @@

#include "qgscomparisonfilter.h"

QgsComparisonFilter::QgsComparisonFilter(): QgsFilter(), mComparisonType(QgsComparisonFilter::UNKNOWN)
QgsComparisonFilter::QgsComparisonFilter(): QgsFilter(), mComparisonType( QgsComparisonFilter::UNKNOWN )
{
}
QgsComparisonFilter::QgsComparisonFilter(int propertyIndex, COMPARISON_TYPE ct, QString value): QgsFilter(propertyIndex), mComparisonType(ct), mComparisonValue(value)

QgsComparisonFilter::QgsComparisonFilter( int propertyIndex, COMPARISON_TYPE ct, QString value ): QgsFilter( propertyIndex ), mComparisonType( ct ), mComparisonValue( value )
{
}

QgsComparisonFilter::~QgsComparisonFilter()
{
}

bool QgsComparisonFilter::evaluate(const QgsFeature& f) const
bool QgsComparisonFilter::evaluate( const QgsFeature& f ) const
{
QVariant propertyValue = propertyIndexValue(f);
if(!propertyValue.isValid())
{
return false;
}
QVariant propertyValue = propertyIndexValue( f );

if ( !propertyValue.isValid() )
{
return false;
}

bool numeric = true;
if (propertyValue.type() == QVariant::String)
{
numeric = false;
}
if ( propertyValue.type() == QVariant::String )
{
numeric = false;
}

switch(mComparisonType)
{
switch ( mComparisonType )
{
case EQUAL:
if(numeric)
{
return (propertyValue.toDouble() == mComparisonValue.toDouble());
}
if ( numeric )
{
return ( propertyValue.toDouble() == mComparisonValue.toDouble() );
}
else
{
return (propertyValue.toString() == mComparisonValue);
}
{
return ( propertyValue.toString() == mComparisonValue );
}
break;
case NOT_EQUAL:
if(numeric)
{
return (propertyValue.toDouble() != mComparisonValue.toDouble());
}
if ( numeric )
{
return ( propertyValue.toDouble() != mComparisonValue.toDouble() );
}
else
{
return (propertyValue.toString() != mComparisonValue);
}
{
return ( propertyValue.toString() != mComparisonValue );
}
break;
case LESSER:
if(numeric)
{
return (propertyValue.toDouble() < mComparisonValue.toDouble());
}
if ( numeric )
{
return ( propertyValue.toDouble() < mComparisonValue.toDouble() );
}
else
{
return (propertyValue.toString() < mComparisonValue);
}
{
return ( propertyValue.toString() < mComparisonValue );
}
break;
case GREATER:
if(numeric)
{
return (propertyValue.toDouble() > mComparisonValue.toDouble());
}
if ( numeric )
{
return ( propertyValue.toDouble() > mComparisonValue.toDouble() );
}
else
{
return (propertyValue.toString() > mComparisonValue);
}
{
return ( propertyValue.toString() > mComparisonValue );
}
break;
case LESSER_OR_EQUAL:
if(numeric)
{
return (propertyValue.toDouble() <= mComparisonValue.toDouble());
}
if ( numeric )
{
return ( propertyValue.toDouble() <= mComparisonValue.toDouble() );
}
else
{
return (propertyValue.toString() <= mComparisonValue);
}
{
return ( propertyValue.toString() <= mComparisonValue );
}
break;
case GREATER_OR_EQUAL:
if(numeric)
{
return (propertyValue.toDouble() >= mComparisonValue.toDouble());
}
if ( numeric )
{
return ( propertyValue.toDouble() >= mComparisonValue.toDouble() );
}
else
{
return (propertyValue.toString() >= mComparisonValue);
}
{
return ( propertyValue.toString() >= mComparisonValue );
}
break;
case UNKNOWN:
default:
return false;
}
}
return false; //soon...
}
40 changes: 20 additions & 20 deletions src/mapserver/qgscomparisonfilter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgscomparisonfilter.h
qgscomparisonfilter.h
---------------------
begin : Jan 31, 2008
copyright : (C) 2008 by Marco Hugentobler
Expand All @@ -20,7 +20,7 @@

#include <qgsfilter.h>

/**A filter for the comparison operators <,<=,>,>=,!=,=
/**A filter for the comparison operators <,<=,>,>=,!=,=
Sample xml fragment:
<Filter xmlns="http://www.opengis.net/ogc">
<PropertyIsLessThan>
Expand All @@ -31,8 +31,8 @@ Sample xml fragment:
*/
class QgsComparisonFilter: public QgsFilter
{
public:
enum COMPARISON_TYPE
public:
enum COMPARISON_TYPE
{
EQUAL,
NOT_EQUAL,
Expand All @@ -42,24 +42,24 @@ class QgsComparisonFilter: public QgsFilter
GREATER_OR_EQUAL,
UNKNOWN
};

QgsComparisonFilter();
/**Constructor that takes index of the feature attribute, type of comparison \
and reference value to compare against*/
QgsComparisonFilter(int propertyIndex, COMPARISON_TYPE ct, QString value);
~QgsComparisonFilter();

/**Evaluates a feature against the filter.
@return true if the filter applies for the feature*/
bool evaluate(const QgsFeature& f) const;

//setters and getters
COMPARISON_TYPE comparisonType() const {return mComparisonType;}
void setComparisonType(COMPARISON_TYPE t){mComparisonType = t;}
QgsComparisonFilter();
/**Constructor that takes index of the feature attribute, type of comparison \
and reference value to compare against*/
QgsComparisonFilter( int propertyIndex, COMPARISON_TYPE ct, QString value );
~QgsComparisonFilter();

private:
COMPARISON_TYPE mComparisonType;
QString mComparisonValue;
/**Evaluates a feature against the filter.
@return true if the filter applies for the feature*/
bool evaluate( const QgsFeature& f ) const;

//setters and getters
COMPARISON_TYPE comparisonType() const {return mComparisonType;}
void setComparisonType( COMPARISON_TYPE t ) {mComparisonType = t;}

private:
COMPARISON_TYPE mComparisonType;
QString mComparisonValue;
};

#endif //QGSCOMPARISONFILTER_H
Loading

0 comments on commit 514b251

Please sign in to comment.