Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Address review
  • Loading branch information
uclaros authored and nyalldawson committed Jan 18, 2022
1 parent be99a16 commit a28cd2c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Expand Up @@ -199,7 +199,7 @@ Abstract base class for 2d point cloud renderers.

enum DrawOrder
{
Unchanged,
Default,
BottomToTop,
TopToBottom,
};
Expand Down Expand Up @@ -378,13 +378,17 @@ Returns the map unit scale used for the point size.
Returns the drawing order used by the renderer for drawing points.

.. seealso:: :py:func:`setDrawOrder2d`

.. versionadded:: 3.24
%End

void setDrawOrder2d( DrawOrder order );
%Docstring
Sets the drawing ``order`` used by the renderer for drawing points.

.. seealso:: :py:func:`drawOrder2d`

.. versionadded:: 3.24
%End

PointSymbol pointSymbol() const;
Expand Down
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgspointcloudlayerrenderer.cpp
Expand Up @@ -190,7 +190,7 @@ bool QgsPointCloudLayerRenderer::render()
nodesDrawn += renderNodesSorted( nodes, pc, context, request, canceled, mRenderer->drawOrder2d() );
break;
}
case QgsPointCloudRenderer::DrawOrder::Unchanged:
case QgsPointCloudRenderer::DrawOrder::Default:
{
if ( pc->accessType() == QgsPointCloudIndex::AccessType::Local )
{
Expand Down
7 changes: 5 additions & 2 deletions src/core/pointcloud/qgspointcloudrenderer.h
Expand Up @@ -274,10 +274,11 @@ class CORE_EXPORT QgsPointCloudRenderer

/**
* Pointcloud rendering order for 2d views
* /since QGIS 3.24
*/
enum DrawOrder
{
Unchanged, //!< Draw points in the order they are stored
Default, //!< Draw points in the order they are stored
BottomToTop, //!< Draw points with larger Z values last
TopToBottom, //!< Draw points with larger Z values first
};
Expand Down Expand Up @@ -450,13 +451,15 @@ class CORE_EXPORT QgsPointCloudRenderer
* Returns the drawing order used by the renderer for drawing points.
*
* \see setDrawOrder2d()
* \since QGIS 3.24
*/
DrawOrder drawOrder2d() const;

/**
* Sets the drawing \a order used by the renderer for drawing points.
*
* \see drawOrder2d()
* \since QGIS 3.24
*/
void setDrawOrder2d( DrawOrder order );

Expand Down Expand Up @@ -616,7 +619,7 @@ class CORE_EXPORT QgsPointCloudRenderer

PointSymbol mPointSymbol = Square;
int mPainterPenWidth = 1;
DrawOrder mDrawOrder2d = Unchanged;
DrawOrder mDrawOrder2d = DrawOrder::Default;
};

#endif // QGSPOINTCLOUDRENDERER_H
Expand Up @@ -101,7 +101,7 @@ QgsPointCloudRendererPropertiesWidget::QgsPointCloudRendererPropertiesWidget( Qg
connect( mPointSizeSpinBox, qOverload<double>( &QgsDoubleSpinBox::valueChanged ), this, &QgsPointCloudRendererPropertiesWidget::emitWidgetChanged );
connect( mPointSizeUnitWidget, &QgsUnitSelectionWidget::changed, this, &QgsPointCloudRendererPropertiesWidget::emitWidgetChanged );

mDrawOrderComboBox->addItem( tr( "Default" ), QgsPointCloudRenderer::DrawOrder::Unchanged );
mDrawOrderComboBox->addItem( tr( "Default" ), QgsPointCloudRenderer::DrawOrder::Default );
mDrawOrderComboBox->addItem( tr( "Bottom to top" ), QgsPointCloudRenderer::DrawOrder::BottomToTop );
mDrawOrderComboBox->addItem( tr( "Top to bottom" ), QgsPointCloudRenderer::DrawOrder::TopToBottom );

Expand Down

0 comments on commit a28cd2c

Please sign in to comment.