Skip to content

Commit

Permalink
change to getting filtered out values set
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Dec 7, 2020
1 parent 752c42c commit d898dcd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions src/3d/qgspointcloudlayer3drenderer.cpp
Expand Up @@ -50,14 +50,12 @@ void QgsPointCloud3DRenderContext::setFilteredOutCategories( const QgsPointCloud
mFilteredOutCategories = categories;
}

bool QgsPointCloud3DRenderContext::isFilteredOut( int value ) const
QSet<int> QgsPointCloud3DRenderContext::getFilteredOutValues() const
{
QSet<int> filteredOut;
for ( QgsPointCloudCategory category : mFilteredOutCategories )
{
if ( category.value() == value )
return true;
}
return false;
filteredOut.insert( category.value() );
return filteredOut;
}

QgsPointCloudLayer3DRendererMetadata::QgsPointCloudLayer3DRendererMetadata()
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgspointcloudlayer3drenderer.h
Expand Up @@ -90,7 +90,7 @@ class _3D_NO_EXPORT QgsPointCloud3DRenderContext : public Qgs3DRenderContext
* Checks whether \a value shouldn't be rendered and is filtered out
* \see setFilteredOutCategories()
*/
bool isFilteredOut( int value ) const;
QSet<int> getFilteredOutValues() const;

/**
* Retrieves the attribute \a value from \a data at the specified \a offset, where
Expand Down
4 changes: 2 additions & 2 deletions src/3d/symbols/qgspointcloud3dsymbol_p.cpp
Expand Up @@ -595,7 +595,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex

const QgsVector3D scale = pc->scale();
const QgsVector3D offset = pc->offset();

QSet<int> filteredOutValues = context.getFilteredOutValues();
for ( int i = 0; i < count; ++i )
{
qint32 ix = *( qint32 * )( ptr + i * recordSize + xOffset );
Expand All @@ -618,7 +618,7 @@ void QgsClassificationPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex
else
context.getAttribute( ptr, i * recordSize + attributeOffset, attributeType, iParam );

if ( context.isFilteredOut( ( int ) iParam ) )
if ( filteredOutValues.contains( ( int ) iParam ) )
continue;
outNormal.positions.push_back( QVector3D( p.x(), p.y(), p.z() ) );
outNormal.parameter.push_back( iParam );
Expand Down

0 comments on commit d898dcd

Please sign in to comment.