Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
202 additions
and 643 deletions.
- +2 −4 src/quickgui/CMakeLists.txt
- +2 −4 src/quickgui/plugin/qgsquickplugin.cpp
- +0 −55 src/quickgui/qgsquickfeature.cpp
- +20 −33 src/quickgui/qgsquickfeaturehighlight.cpp
- +18 −15 src/quickgui/qgsquickfeaturehighlight.h
- +68 −0 src/quickgui/qgsquickfeaturelayerpair.cpp
- +28 −28 src/quickgui/{qgsquickfeature.h → qgsquickfeaturelayerpair.h}
- +0 −302 src/quickgui/qgsquickfeaturemodel.cpp
- +0 −124 src/quickgui/qgsquickfeaturemodel.h
- +2 −1 src/quickgui/qgsquickhighlightsgnode.h
- +9 −9 src/quickgui/qgsquickidentifykit.cpp
- +38 −22 src/quickgui/qgsquickidentifykit.h
- +3 −20 src/quickgui/qgsquickutils.cpp
- +2 −8 src/quickgui/qgsquickutils.h
- +2 −9 tests/src/quickgui/app/main.qml
- +7 −8 tests/src/quickgui/testqgsquickidentifykit.cpp
- +1 −1 tests/src/quickgui/testqgsquickutils.cpp
@@ -0,0 +1,68 @@ | ||
/*************************************************************************** | ||
qgsquickfeaturelayerpair.cpp | ||
--------------------- | ||
Date : Nov 2017 | ||
Copyright : (C) 2017 by Peter Petrik | ||
Email : zilolv at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsvectorlayer.h" | ||
#include "qgsfeature.h" | ||
|
||
#include "qgsquickfeaturelayerpair.h" | ||
|
||
QgsQuickFeatureLayerPair::QgsQuickFeatureLayerPair() = default; | ||
|
||
QgsQuickFeatureLayerPair::QgsQuickFeatureLayerPair( const QgsFeature &feature, QgsVectorLayer *layer ) | ||
: mLayer( layer ) | ||
, mFeature( feature ) | ||
{ | ||
} | ||
|
||
QgsVectorLayer *QgsQuickFeatureLayerPair::layer() const | ||
{ | ||
return mLayer; | ||
} | ||
|
||
QgsFeature QgsQuickFeatureLayerPair::feature() const | ||
{ | ||
return mFeature; | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::isValid() const | ||
{ | ||
return ( mLayer && mFeature.isValid() && hasValidGeometry() ); | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::operator==( const QgsQuickFeatureLayerPair &other ) const | ||
{ | ||
return ( mLayer == other.layer() ) && ( mFeature == other.feature() ); | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::operator!=( const QgsQuickFeatureLayerPair &other ) const | ||
{ | ||
return ( mLayer != other.layer() ) || ( mFeature != other.feature() ); | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::hasValidGeometry() const | ||
{ | ||
Q_ASSERT( mLayer ); | ||
|
||
if ( !mFeature.hasGeometry() ) | ||
return false; | ||
|
||
if ( mFeature.geometry().type() != mLayer->geometryType() ) | ||
return false; | ||
|
||
if ( QgsWkbTypes::hasZ( mLayer->wkbType() ) != QgsWkbTypes::hasZ( mFeature.geometry().wkbType() ) ) | ||
return false; | ||
|
||
return true; | ||
} |
Oops, something went wrong.