mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-19 00:07:15 -04:00
Use QVariantMap instead of QMap<QString, QVariant>
This commit is contained in:
parent
28dc2a7625
commit
8f63af56a9
@ -125,7 +125,7 @@ Constructor for QgsPointCloudClassifiedRenderer.
|
|||||||
|
|
||||||
virtual void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context );
|
virtual void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context );
|
||||||
|
|
||||||
virtual bool willRenderPoint( const QMap<QString, QVariant> &pointAttributes );
|
virtual bool willRenderPoint( const QVariantMap &pointAttributes );
|
||||||
|
|
||||||
virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const;
|
virtual QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const;
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ void QgsPointCloudClassifiedRenderer::renderBlock( const QgsPointCloudBlock *blo
|
|||||||
context.incrementPointsRendered( rendered );
|
context.incrementPointsRendered( rendered );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsPointCloudClassifiedRenderer::willRenderPoint( const QMap<QString, QVariant> &pointAttributes )
|
bool QgsPointCloudClassifiedRenderer::willRenderPoint( const QVariantMap &pointAttributes )
|
||||||
{
|
{
|
||||||
if ( !pointAttributes.contains( mAttribute ) )
|
if ( !pointAttributes.contains( mAttribute ) )
|
||||||
return false;
|
return false;
|
||||||
|
@ -128,7 +128,7 @@ class CORE_EXPORT QgsPointCloudClassifiedRenderer : public QgsPointCloudRenderer
|
|||||||
QString type() const override;
|
QString type() const override;
|
||||||
QgsPointCloudRenderer *clone() const override;
|
QgsPointCloudRenderer *clone() const override;
|
||||||
void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
|
void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
|
||||||
bool willRenderPoint( const QMap<QString, QVariant> &pointAttributes ) override;
|
bool willRenderPoint( const QVariantMap &pointAttributes ) override;
|
||||||
QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
|
QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
|
||||||
QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
|
QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
|
||||||
QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) override SIP_FACTORY;
|
QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) override SIP_FACTORY;
|
||||||
|
@ -204,10 +204,11 @@ static double _pointZ( const char *ptr, int i, int pointRecordSize, int zOffset,
|
|||||||
/**
|
/**
|
||||||
* Retrieves all the attributes of a point
|
* Retrieves all the attributes of a point
|
||||||
*/
|
*/
|
||||||
QMap<QString, QVariant> _attributeMap( const char *data, std::size_t recordOffset, const QgsPointCloudAttributeCollection &attributeCollection )
|
QVariantMap _attributeMap( const char *data, std::size_t recordOffset, const QgsPointCloudAttributeCollection &attributeCollection )
|
||||||
{
|
{
|
||||||
QMap<QString, QVariant> map;
|
QVariantMap map;
|
||||||
for ( QgsPointCloudAttribute attr : attributeCollection.attributes() )
|
const QVector<QgsPointCloudAttribute> attributes = attributeCollection.attributes();
|
||||||
|
for ( const QgsPointCloudAttribute &attr : attributes )
|
||||||
{
|
{
|
||||||
QString attributeName = attr.name();
|
QString attributeName = attr.name();
|
||||||
int attributeOffset;
|
int attributeOffset;
|
||||||
@ -269,9 +270,9 @@ struct MapIndexedPointCloudNode
|
|||||||
: mRequest( request ), mIndexScale( indexScale ), mIndexOffset( indexOffset ), mExtentGeometry( extentGeometry ), mZRange( zRange ), mIndex( index ), mPointsLimit( pointsLimit )
|
: mRequest( request ), mIndexScale( indexScale ), mIndexOffset( indexOffset ), mExtentGeometry( extentGeometry ), mZRange( zRange ), mIndex( index ), mPointsLimit( pointsLimit )
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
QVector<QMap<QString, QVariant>> operator()( const IndexedPointCloudNode &n )
|
QVector<QVariantMap> operator()( IndexedPointCloudNode n )
|
||||||
{
|
{
|
||||||
QVector<QMap<QString, QVariant>> acceptedPoints;
|
QVector<QVariantMap> acceptedPoints;
|
||||||
std::unique_ptr<QgsPointCloudBlock> block( mIndex->nodeData( n, mRequest ) );
|
std::unique_ptr<QgsPointCloudBlock> block( mIndex->nodeData( n, mRequest ) );
|
||||||
|
|
||||||
if ( !block || pointsCount == mPointsLimit )
|
if ( !block || pointsCount == mPointsLimit )
|
||||||
@ -295,7 +296,7 @@ struct MapIndexedPointCloudNode
|
|||||||
|
|
||||||
if ( mZRange.contains( z ) && extentEngine->contains( &pointXY ) )
|
if ( mZRange.contains( z ) && extentEngine->contains( &pointXY ) )
|
||||||
{
|
{
|
||||||
QMap<QString, QVariant> pointAttr = _attributeMap( ptr, i * recordSize, blockAttributes );
|
QVariantMap pointAttr = _attributeMap( ptr, i * recordSize, blockAttributes );
|
||||||
pointAttr[ QStringLiteral( "X" ) ] = x;
|
pointAttr[ QStringLiteral( "X" ) ] = x;
|
||||||
pointAttr[ QStringLiteral( "Y" ) ] = y;
|
pointAttr[ QStringLiteral( "Y" ) ] = y;
|
||||||
pointAttr[ QStringLiteral( "Z" ) ] = z;
|
pointAttr[ QStringLiteral( "Z" ) ] = z;
|
||||||
@ -316,12 +317,12 @@ struct MapIndexedPointCloudNode
|
|||||||
int pointsCount = 0;
|
int pointsCount = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
QVector<QMap<QString, QVariant>> QgsPointCloudDataProvider::identify(
|
QVector<QVariantMap> QgsPointCloudDataProvider::identify(
|
||||||
float maxErrorInMapCoords,
|
double maxErrorInMapCoords,
|
||||||
const QgsGeometry &extentGeometry,
|
const QgsGeometry &extentGeometry,
|
||||||
const QgsDoubleRange extentZRange, int pointsLimit )
|
const QgsDoubleRange &extentZRange, int pointsLimit )
|
||||||
{
|
{
|
||||||
QVector<QMap<QString, QVariant>> acceptedPoints;
|
QVector<QVariantMap> acceptedPoints;
|
||||||
|
|
||||||
QgsPointCloudIndex *index = this->index();
|
QgsPointCloudIndex *index = this->index();
|
||||||
const IndexedPointCloudNode root = index->root();
|
const IndexedPointCloudNode root = index->root();
|
||||||
|
@ -87,7 +87,7 @@ class CORE_EXPORT QgsPointCloudDataProvider: public QgsDataProvider
|
|||||||
* \note this function does not handle elevation properties and you need to
|
* \note this function does not handle elevation properties and you need to
|
||||||
* change elevation coordinates yourself after returning from the function
|
* change elevation coordinates yourself after returning from the function
|
||||||
*/
|
*/
|
||||||
QVector<QMap<QString, QVariant>> identify( float maxErrorInMapCoords, const QgsGeometry &extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
|
QVector<QVariantMap> identify( double maxErrorInMapCoords, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -195,9 +195,9 @@ void QgsPointCloudRenderer::setPointSymbol( PointSymbol symbol )
|
|||||||
mPointSymbol = symbol;
|
mPointSymbol = symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QMap<QString, QVariant>> QgsPointCloudRenderer::identify( QgsPointCloudLayer *layer, QgsRenderContext renderContext, const QgsGeometry &geometry )
|
QVector<QVariantMap> QgsPointCloudRenderer::identify( QgsPointCloudLayer *layer, const QgsRenderContext &renderContext, const QgsGeometry &geometry )
|
||||||
{
|
{
|
||||||
QVector<QMap<QString, QVariant>> selectedPoints;
|
QVector<QVariantMap> selectedPoints;
|
||||||
|
|
||||||
QgsPointCloudIndex *index = layer->dataProvider()->index();
|
QgsPointCloudIndex *index = layer->dataProvider()->index();
|
||||||
const IndexedPointCloudNode root = index->root();
|
const IndexedPointCloudNode root = index->root();
|
||||||
|
@ -285,7 +285,7 @@ class CORE_EXPORT QgsPointCloudRenderer
|
|||||||
* Returns the list of visible points of the point cloud layer \a layer and an extent defined by
|
* Returns the list of visible points of the point cloud layer \a layer and an extent defined by
|
||||||
* a geometry in the 2D plane \a geometry.
|
* a geometry in the 2D plane \a geometry.
|
||||||
*/
|
*/
|
||||||
QVector<QMap<QString, QVariant>> identify( QgsPointCloudLayer *layer, QgsRenderContext context, const QgsGeometry &geometry ) SIP_SKIP;
|
QVector<QVariantMap> identify( QgsPointCloudLayer *layer, const QgsRenderContext &context, const QgsGeometry &geometry ) SIP_SKIP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the point holding \a pointAttributes attributes will be rendered
|
* Checks whether the point holding \a pointAttributes attributes will be rendered
|
||||||
|
Loading…
x
Reference in New Issue
Block a user