114 changes: 57 additions & 57 deletions src/plugins/topology/dockModel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
dockModel.h
dockModel.h
TOPOLogy checker
-------------------
date : May 2009
Expand All @@ -26,66 +26,66 @@

class DockModel: public QAbstractTableModel
{
Q_OBJECT
Q_OBJECT

public:
/**
* Constructor
* @param theErrorList reference to the ErrorList where errors will be stored
* @param parent parent object
*/
DockModel(ErrorList& theErrorList, QObject *parent);
/**
* Returns header data
* @param section required section
* @param orientation horizontal or vertical orientation
* @param role data role
*/
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
/**
* Returns data on the given index
* @param index model index
* @param role data role
*/
virtual QVariant data(const QModelIndex &index, int role) const;
/**
* Updates data on given index
* @param index model index
* @param value new data value
* @param role data role
*/
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
/**
* Returns item flags for the index
* @param index model index
*/
Qt::ItemFlags flags(const QModelIndex &index) const;
public:
/**
* Constructor
* @param theErrorList reference to the ErrorList where errors will be stored
* @param parent parent object
*/
DockModel( ErrorList& theErrorList, QObject *parent );
/**
* Returns header data
* @param section required section
* @param orientation horizontal or vertical orientation
* @param role data role
*/
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
/**
* Returns data on the given index
* @param index model index
* @param role data role
*/
virtual QVariant data( const QModelIndex &index, int role ) const;
/**
* Updates data on given index
* @param index model index
* @param value new data value
* @param role data role
*/
virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
/**
* Returns item flags for the index
* @param index model index
*/
Qt::ItemFlags flags( const QModelIndex &index ) const;

/**
* Returns the number of rows
* @param parent parent index
*/
int rowCount(const QModelIndex &parent) const;
/**
* Returns the number of columns
* @param parent parent index
*/
int columnCount(const QModelIndex &parent) const;
/**
* Returns the number of rows
* @param parent parent index
*/
int rowCount( const QModelIndex &parent ) const;
/**
* Returns the number of columns
* @param parent parent index
*/
int columnCount( const QModelIndex &parent ) const;

/**
* Reloads the model data between indices
* @param index1 start index
* @param index2 end index
*/
void reload(const QModelIndex &index1, const QModelIndex &index2);
/**
* Resets the model
*/
void resetModel();
/**
* Reloads the model data between indices
* @param index1 start index
* @param index2 end index
*/
void reload( const QModelIndex &index1, const QModelIndex &index2 );
/**
* Resets the model
*/
void resetModel();

private:
ErrorList& mErrorlist;
QList<QString> mHeader;
private:
ErrorList& mErrorlist;
QList<QString> mHeader;
};

#endif
123 changes: 0 additions & 123 deletions src/plugins/topology/geosFunctions.h

This file was deleted.

102 changes: 51 additions & 51 deletions src/plugins/topology/rulesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ rulesDialog::rulesDialog( QList<QString> layerList, QMap<QString, TopologyRule>

}

connect (mLayer1Box, SIGNAL( currentIndexChanged(const QString&) ),this, SLOT( updateRuleItems(const QString&) ) );
connect( mLayer1Box, SIGNAL( currentIndexChanged( const QString& ) ), this, SLOT( updateRuleItems( const QString& ) ) );

connect( mAddTestButton, SIGNAL( clicked() ), this, SLOT( addTest() ) );
connect( mAddTestButton, SIGNAL( clicked() ), mTestTable, SLOT( resizeColumnsToContents() ) );
Expand Down Expand Up @@ -175,44 +175,44 @@ void rulesDialog::projectRead()
void rulesDialog::showControls( const QString& testName )
{
mLayer2Box->clear();
mLayer2Box->addItem("No layer");
mLayer2Box->addItem( "No layer" );
TopologyRule topologyRule = mTestConfMap[testName];
QgsMapLayerRegistry* layerRegistry = QgsMapLayerRegistry::instance();

if( topologyRule.useSecondLayer)
if ( topologyRule.useSecondLayer )
{
mLayer2Box->setVisible( true );
for ( int i = 0; i < mLayerIds.count(); ++i )
{
mLayer2Box->setVisible(true);
for(int i = 0; i < mLayerIds.count(); ++i)
{
QgsVectorLayer* v1 = ( QgsVectorLayer* )layerRegistry->mapLayers()[mLayerIds.at(i)];

if ( v1->name() == mLayer1Box->currentText())
{
continue;
}

if( topologyRule.layer2AcceptsType( v1->geometryType()) )
{
mLayer2Box->addItem( v1->name());
}
}
QgsVectorLayer* v1 = ( QgsVectorLayer* )layerRegistry->mapLayers()[mLayerIds.at( i )];

if ( v1->name() == mLayer1Box->currentText() )
{
continue;
}

if ( topologyRule.layer2AcceptsType( v1->geometryType() ) )
{
mLayer2Box->addItem( v1->name() );
}
}
}
else
{
mLayer2Box->setVisible(false);
}
{
mLayer2Box->setVisible( false );
}


if(topologyRule.useTolerance)
{
mToleranceBox->setVisible( true );
mToleranceLabel->setVisible( true );
}
if ( topologyRule.useTolerance )
{
mToleranceBox->setVisible( true );
mToleranceLabel->setVisible( true );
}
else
{
mToleranceBox->setVisible( false );
mToleranceLabel->setVisible( false );
}
{
mToleranceBox->setVisible( false );
mToleranceLabel->setVisible( false );
}

}

Expand Down Expand Up @@ -250,15 +250,15 @@ void rulesDialog::addTest()
if ( layer2 == "No layer" && mTestConfMap[test].useSecondLayer )
return;

for (int i = 0; i < mTestTable->rowCount(); ++i)
for ( int i = 0; i < mTestTable->rowCount(); ++i )
{
if ( mTestTable->item( i, 0 )->text() == test &&
mTestTable->item( i, 1 )->text() == layer1 &&
mTestTable->item( i, 2 )->text() == layer2 )
{
if( mTestTable->item(i,0)->text() == test &&
mTestTable->item(i,1)->text() == layer1 &&
mTestTable->item(i,2)->text() == layer2 )
{
return;
}
return;
}
}

int row = mTestTable->rowCount();
mTestTable->insertRow( row );
Expand Down Expand Up @@ -323,27 +323,27 @@ void rulesDialog::deleteTest()
mTestTable->removeRow( row );
}

void rulesDialog::updateRuleItems(const QString &layerName)
void rulesDialog::updateRuleItems( const QString &layerName )
{
mTestBox->clear();

if( layerName == "No layer")
{
return;
}
if ( layerName == "No layer" )
{
return;
}

QString layerId = mLayer1Box->itemData(mLayer1Box->currentIndex()).toString();
QString layerId = mLayer1Box->itemData( mLayer1Box->currentIndex() ).toString();

QgsMapLayerRegistry* layerRegistry = QgsMapLayerRegistry::instance();
QgsVectorLayer* vlayer= (QgsVectorLayer*)layerRegistry->mapLayers()[layerId];
QgsVectorLayer* vlayer = ( QgsVectorLayer* )layerRegistry->mapLayers()[layerId];

for (QMap<QString, TopologyRule>::iterator it = mTestConfMap.begin(); it != mTestConfMap.end(); ++it)
for ( QMap<QString, TopologyRule>::iterator it = mTestConfMap.begin(); it != mTestConfMap.end(); ++it )
{
TopologyRule rule = it.value();
if ( rule.layer1AcceptsType( vlayer->geometryType() ) )
{
TopologyRule rule = it.value();
if(rule.layer1AcceptsType(vlayer->geometryType()))
{
mTestBox->addItem(it.key());
}

mTestBox->addItem( it.key() );
}

}
}
2 changes: 1 addition & 1 deletion src/plugins/topology/rulesDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class rulesDialog : public QDialog, public Ui::rulesDialog
* Updates Rule combobox to mach first layer
* @param layerId layer ID
*/
void updateRuleItems( const QString& layerName);
void updateRuleItems( const QString& layerName );

};

Expand Down
6 changes: 6 additions & 0 deletions src/plugins/topology/topol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ QGISEXTERN int type()
return sPluginType;
}

// Return the category
QGISEXTERN QString category()
{
return sCategory;
}

// Return the version number for the plugin
QGISEXTERN QString version()
{
Expand Down
100 changes: 50 additions & 50 deletions src/plugins/topology/topol.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/***************************************************************************
topol.h
topol.h
-------------------
begin : Jan 21, 2004
copyright : (C) 2004 by Tim Sutton
email : tim@linfiniti.com
***************************************************************************/

/***************************************************************************
Expand All @@ -15,10 +15,10 @@
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id: plugin.h 7796 2007-12-16 22:11:38Z homann $ */
/* $Id: plugin.h 7796 2007-12-16 22:11:38Z homann $ */
/***************************************************************************
* QGIS Programming conventions:
*
*
* mVariableName - a class level member variable
* sVariableName - a static class level member variable
* variableName() - accessor for a class member (no 'get' in front of name)
Expand All @@ -28,7 +28,7 @@
*
* theVariableName - a method parameter (prefix with 'the')
* myVariableName - a locally declared variable within a method ('my' prefix)
*
*
* DO: Use mixed case variable names - myVariableName
* DON'T: separate variable names using underscores: my_variable_name (NO!)
*
Expand All @@ -54,58 +54,58 @@ class checkDock;
* \brief [name] plugin for QGIS
* [description]
*/
class Topol:public QObject, public QgisPlugin
class Topol: public QObject, public QgisPlugin
{
Q_OBJECT;
Q_OBJECT;
public:

//////////////////////////////////////////////////////////////////////
//
// MANDATORY PLUGIN METHODS FOLLOW
//
//////////////////////////////////////////////////////////////////////

/**
* Constructor for a plugin. The QgisInterface pointer is passed by
* QGIS when it attempts to instantiate the plugin.
* @param theInterface Pointer to the QgisInterface object.
*/
Topol(QgisInterface * theInterface);
//! Destructor
virtual ~Topol();
//////////////////////////////////////////////////////////////////////
//
// MANDATORY PLUGIN METHODS FOLLOW
//
//////////////////////////////////////////////////////////////////////

/**
* Constructor for a plugin. The QgisInterface pointer is passed by
* QGIS when it attempts to instantiate the plugin.
* @param theInterface Pointer to the QgisInterface object.
*/
Topol( QgisInterface * theInterface );
//! Destructor
virtual ~Topol();

public slots:
//! init the gui
virtual void initGui();
//! Create and show the dialog box
void run();
//! Show/hide the dialog box
void showOrHide();
//! unload the plugin
void unload();
//! show the help document
void help();

public slots:
//! init the gui
virtual void initGui();
//! Create and show the dialog box
void run();
//! Show/hide the dialog box
void showOrHide();
//! unload the plugin
void unload();
//! show the help document
void help();
private:

private:
////////////////////////////////////////////////////////////////////
//
// MANDATORY PLUGIN PROPERTY DECLARATIONS .....
//
////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////
//
// MANDATORY PLUGIN PROPERTY DECLARATIONS .....
//
////////////////////////////////////////////////////////////////////

int mPluginType;
//! Pointer to the QGIS interface object
QgisInterface *mQGisIface;
//!pointer to the qaction for this plugin
QAction * mQActionPointer;
checkDock* mDock;
int mPluginType;
//! Pointer to the QGIS interface object
QgisInterface *mQGisIface;
//!pointer to the qaction for this plugin
QAction * mQActionPointer;
checkDock* mDock;

////////////////////////////////////////////////////////////////////
//
// ADD YOUR OWN PROPERTY DECLARATIONS AFTER THIS POINT.....
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//
// ADD YOUR OWN PROPERTY DECLARATIONS AFTER THIS POINT.....
//
////////////////////////////////////////////////////////////////////
};

#endif //Topol_H
72 changes: 36 additions & 36 deletions src/plugins/topology/topolError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
***************************************************************************/

#include "topolError.h"
#include <qgsmessagelog.h>

//TODO: tell dock to parse errorlist when feature is deleted
bool TopolError::fix( QString fixName )
{
std::cout << "fix: \"" << fixName.toStdString() << "\"\n";
( this->*mFixMap[fixName] )();
QgsMessageLog::logMessage( QObject::tr( "Using fix %1." ).arg( fixName ), QObject::tr( "Topology plugin" ), QgsMessageLog::INFO );
return ( this->*mFixMap[fixName] )();
}

bool TopolError::fixMove( FeatureLayer fl1, FeatureLayer fl2 )
Expand All @@ -36,7 +37,6 @@ bool TopolError::fixMove( FeatureLayer fl1, FeatureLayer fl2 )
return false;


QgsGeometry* g2, *g1 = f1.geometry();
// 0 means success
if ( !f1.geometry()->makeDifference( f2.geometry() ) )
return fl1.layer->changeGeometry( f1.id(), f1.geometry() );
Expand Down Expand Up @@ -121,109 +121,109 @@ bool TopolError::fixDeleteSecond()
return fl.layer->deleteFeature( fl.feature.id() );
}

TopolError::TopolError( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ):
mFeaturePairs( theFeaturePairs ),
mBoundingBox( theBoundingBox ),
mConflict( theConflict )
TopolError::TopolError( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs )
: mBoundingBox( theBoundingBox )
, mConflict( theConflict )
, mFeaturePairs( theFeaturePairs )
{
mFixMap["Select automatic fix"] = &TopolError::fixDummy;
mFixMap[ QObject::tr( "Select automatic fix" )] = &TopolError::fixDummy;
}

TopolErrorIntersection::TopolErrorIntersection( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "intersecting geometries";
mName = QObject::tr( "intersecting geometries" );

mFixMap["Move blue feature"] = &TopolErrorIntersection::fixMoveFirst;
mFixMap["Move red feature"] = &TopolErrorIntersection::fixMoveSecond;
mFixMap["Delete blue feature"] = &TopolErrorIntersection::fixDeleteFirst;
mFixMap["Delete red feature"] = &TopolErrorIntersection::fixDeleteSecond;
mFixMap[QObject::tr( "Move blue feature" )] = &TopolErrorIntersection::fixMoveFirst;
mFixMap[QObject::tr( "Move red feature" )] = &TopolErrorIntersection::fixMoveSecond;
mFixMap[QObject::tr( "Delete blue feature" )] = &TopolErrorIntersection::fixDeleteFirst;
mFixMap[QObject::tr( "Delete red feature" )] = &TopolErrorIntersection::fixDeleteSecond;

// allow union only when both features have the same geometry type
if ( theFeaturePairs.first().feature.geometry()->type() == theFeaturePairs[1].feature.geometry()->type() )
{
mFixMap["Union to blue feature"] = &TopolErrorIntersection::fixUnionFirst;
mFixMap["Union to red feature"] = &TopolErrorIntersection::fixUnionSecond;
mFixMap[QObject::tr( "Union to blue feature" )] = &TopolErrorIntersection::fixUnionFirst;
mFixMap[QObject::tr( "Union to red feature" )] = &TopolErrorIntersection::fixUnionSecond;
}
}

TopolErrorClose::TopolErrorClose( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "features too close";
mName = QObject::tr( "features too close" );

mFixMap["Move blue feature"] = &TopolErrorClose::fixMoveFirst;
mFixMap["Move red feature"] = &TopolErrorClose::fixMoveSecond;
mFixMap["Snap to segment"] = &TopolErrorClose::fixSnap;
mFixMap[QObject::tr( "Move blue feature" )] = &TopolErrorClose::fixMoveFirst;
mFixMap[QObject::tr( "Move red feature" )] = &TopolErrorClose::fixMoveSecond;
mFixMap[QObject::tr( "Snap to segment" )] = &TopolErrorClose::fixSnap;
}

TopolErrorCovered::TopolErrorCovered( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "point not covered by segment";
mFixMap["Delete point"] = &TopolErrorCovered::fixDeleteFirst;
mName = QObject::tr( "point not covered by segment" );
mFixMap[QObject::tr( "Delete point" )] = &TopolErrorCovered::fixDeleteFirst;
}

TopolErrorShort::TopolErrorShort( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "segment too short";
mFixMap["Delete feature"] = &TopolErrorShort::fixDeleteFirst;
mName = QObject::tr( "segment too short" );
mFixMap[QObject::tr( "Delete feature" )] = &TopolErrorShort::fixDeleteFirst;
}

TopolErrorValid::TopolErrorValid( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "invalid geometry";
mFixMap["Delete feature"] = &TopolErrorValid::fixDeleteFirst;
mName = QObject::tr( "invalid geometry" );
mFixMap[QObject::tr( "Delete feature" )] = &TopolErrorValid::fixDeleteFirst;
}

TopolErrorDangle::TopolErrorDangle( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "dangling end";
mFixMap["Delete feature"] = &TopolErrorDangle::fixDeleteFirst;
mName = QObject::tr( "dangling end" );
mFixMap[QObject::tr( "Delete feature" )] = &TopolErrorDangle::fixDeleteFirst;
}

TopolErrorDuplicates::TopolErrorDuplicates( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "duplicate geometry";
mName = QObject::tr( "duplicate geometry" );
//mFixMap["Delete feature"] = &TopolErrorDuplicates::fixDeleteFirst;
}

TopolErrorPseudos::TopolErrorPseudos( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "pseudo node";
mName = QObject::tr( "pseudo node" );
//mFixMap["Delete feature"] = &TopolErrorDuplicates::fixDeleteFirst;
}

TopolErrorOverlaps::TopolErrorOverlaps( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "overlaps";
mName = QObject::tr( "overlaps" );
//mFixMap["Delete feature"] = &TopolErrorDuplicates::fixDeleteFirst;
}

TopolErrorGaps::TopolErrorGaps( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "gaps";
mName = QObject::tr( "gaps" );
//mFixMap["Delete feature"] = &TopolErrorDuplicates::fixDeleteFirst;
}

TopolErrorPointNotCoveredByLineEnds::TopolErrorPointNotCoveredByLineEnds( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "point not covered";
mName = QObject::tr( "point not covered" );
}

TopolErrorLineEndsNotCoveredByPoints::TopolErrorLineEndsNotCoveredByPoints( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "line ends not covered by point";
mName = QObject::tr( "line ends not covered by point" );
}

TopolErrorPointNotInPolygon::TopolErrorPointNotInPolygon( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "point not in polygon";
mName = QObject::tr( "point not in polygon" );
}

TopolErrorPolygonContainsPoint::TopolErrorPolygonContainsPoint( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "polygon does not contain point";
mName = QObject::tr( "polygon does not contain point" );
}

TopolErroMultiPart::TopolErroMultiPart( QgsRectangle theBoundingBox, QgsGeometry* theConflict, QList<FeatureLayer> theFeaturePairs ) : TopolError( theBoundingBox, theConflict, theFeaturePairs )
{
mName = "multipart feature";
mName = QObject::tr( "multipart feature" );
}
4 changes: 2 additions & 2 deletions src/plugins/topology/topolError.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class FeatureLayer
{
public:
FeatureLayer() :
layer( 0 ), feature( QgsFeature() ) {};
layer( 0 ), feature( QgsFeature() ) {}
/**
* Constructor
* @param theLayer layer pointer
* @param theFeature QgsFeature
*/
FeatureLayer( QgsVectorLayer* theLayer, QgsFeature theFeature ) :
layer( theLayer ), feature( theFeature ) {};
layer( theLayer ), feature( theFeature ) {}

QgsVectorLayer* layer;
QgsFeature feature;
Expand Down
565 changes: 284 additions & 281 deletions src/plugins/topology/topolTest.cpp

Large diffs are not rendered by default.

59 changes: 19 additions & 40 deletions src/plugins/topology/topolTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class WKTReader;

enum ValidateType { ValidateAll, ValidateExtent, ValidateSelected };

typedef ErrorList( topolTest::*testFunction )( double, QgsVectorLayer*, QgsVectorLayer*,bool );
typedef ErrorList( topolTest::*testFunction )( double, QgsVectorLayer*, QgsVectorLayer*, bool );

class TopologyRule
{
Expand All @@ -42,36 +42,18 @@ class TopologyRule
bool useSpatialIndex;
QList<QGis::GeometryType> layer1SupportedTypes;
QList<QGis::GeometryType> layer2SupportedTypes;
testFunction f;

bool layer1AcceptsType(QGis::GeometryType type )
bool layer1AcceptsType( QGis::GeometryType type )
{
if (layer1SupportedTypes.contains(type))
{

return true;
}
else
{
return false;
}

return layer1SupportedTypes.contains( type );
}

bool layer2AcceptsType(QGis::GeometryType type )
bool layer2AcceptsType( QGis::GeometryType type )
{
if (layer2SupportedTypes.contains(type))
{

return true;
}
else
{
return false;
}

return layer2SupportedTypes.contains( type );
}

testFunction f;

/**
* Constructor
Expand Down Expand Up @@ -99,12 +81,9 @@ class PointComparer
return true;
}

if ( p1.x() == p2.x() )
if ( p1.x() == p2.x() && p1.y() < p2.y() )
{
if ( p1.y() < p2.y() )
{
return true;
}
return true;
}

return false;
Expand Down Expand Up @@ -140,7 +119,7 @@ class topolTest: public QObject
* @param layer1 pointer to the first layer
* @param layer2 pointer to the second layer
*/
ErrorList checkOverlapWithLayer( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2 , bool isExtent);
ErrorList checkOverlapWithLayer( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2 , bool isExtent );
/**
* Checks for self-intersections in the layer
* @param tolerance not used
Expand All @@ -155,20 +134,20 @@ class topolTest: public QObject
* @param layer2 pointer to the second layer
*/
ErrorList checkCloseFeature( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2, bool isExtent );
/**
* Checks for short segments
* @param tolerance tolerance - not used
* @param layer1 pointer to the first layer
* @param layer2 pointer to the second layer
*/
/**
* Checks for short segments
* @param tolerance tolerance - not used
* @param layer1 pointer to the first layer
* @param layer2 pointer to the second layer
*/
ErrorList checkSegmentLength( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2, bool isExtent );
/**
* Checks for dangling lines
* @param tolerance allowed tolerance
* @param layer1 pointer to the first layer
* @param layer2 not used
*/
ErrorList checkDanglingLines( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2 , bool isExtent);
ErrorList checkDanglingLines( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2 , bool isExtent );
/**
* Checks for points not covered by any segment
* @param tolerance not used
Expand Down Expand Up @@ -238,23 +217,23 @@ class topolTest: public QObject
* @param layer1 pointer to the first polygon layer
* @param layer2 pointer to the second point layer
*/
ErrorList checkPolygonContainsPoint( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2,bool isExtent );
ErrorList checkPolygonContainsPoint( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2, bool isExtent );

/**
* Checks for multipart features
* @param tolerance not used
* @param layer1 pointer to the first layer
* @param layer2 not used
*/
ErrorList checkMultipart( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2,bool isExtent );
ErrorList checkMultipart( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2, bool isExtent );

/**
* Checks for line features that do not have both ends covered by points from another layer
* @param tolerance not used
* @param layer1 pointer to the first linelayer
* @param layer2 pointer to the second point layer
*/
ErrorList checkyLineEndsCoveredByPoints( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2,bool isExtent );
ErrorList checkyLineEndsCoveredByPoints( double tolerance, QgsVectorLayer* layer1, QgsVectorLayer* layer2, bool isExtent );


public slots:
Expand Down