mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
adjust screen space error from UI
This commit is contained in:
parent
b915c7a5a5
commit
85e0e7652f
@ -62,6 +62,24 @@ Returns 3D symbol associated with the renderer
|
||||
virtual void resolveReferences( const QgsProject &project );
|
||||
|
||||
|
||||
double maximumScreenError() const;
|
||||
%Docstring
|
||||
Returns the maximum screen error allowed when rendering the point cloud.
|
||||
|
||||
Larger values result in a faster render with less points rendered.
|
||||
|
||||
.. seealso:: :py:func:`setMaximumScreenError`
|
||||
%End
|
||||
|
||||
void setMaximumScreenError( double error );
|
||||
%Docstring
|
||||
Sets the maximum screen ``error`` allowed when rendering the point cloud.
|
||||
|
||||
Larger values result in a faster render with less points rendered.
|
||||
|
||||
.. seealso:: :py:func:`maximumScreenError`
|
||||
%End
|
||||
|
||||
private:
|
||||
QgsPointCloudLayer3DRenderer( const QgsPointCloudLayer3DRenderer & );
|
||||
QgsPointCloudLayer3DRenderer &operator=( const QgsPointCloudLayer3DRenderer & );
|
||||
|
@ -99,7 +99,7 @@ Qt3DCore::QEntity *QgsPointCloudLayer3DRenderer::createEntity( const Qgs3DMapSet
|
||||
if ( !mSymbol )
|
||||
return nullptr;
|
||||
|
||||
return new QgsPointCloudLayerChunkedEntity( pcl->dataProvider()->index(), map, dynamic_cast<QgsPointCloud3DSymbol *>( mSymbol->clone() ) );
|
||||
return new QgsPointCloudLayerChunkedEntity( pcl->dataProvider()->index(), map, dynamic_cast<QgsPointCloud3DSymbol *>( mSymbol->clone() ), maximumScreenError() );
|
||||
}
|
||||
|
||||
void QgsPointCloudLayer3DRenderer::setSymbol( QgsPointCloud3DSymbol *symbol )
|
||||
@ -148,3 +148,13 @@ void QgsPointCloudLayer3DRenderer::resolveReferences( const QgsProject &project
|
||||
{
|
||||
mLayerRef.setLayer( project.mapLayer( mLayerRef.layerId ) );
|
||||
}
|
||||
|
||||
double QgsPointCloudLayer3DRenderer::maximumScreenError() const
|
||||
{
|
||||
return mMaximumScreenError;
|
||||
}
|
||||
|
||||
void QgsPointCloudLayer3DRenderer::setMaximumScreenError( double error )
|
||||
{
|
||||
mMaximumScreenError = error;
|
||||
}
|
||||
|
@ -178,9 +178,28 @@ class _3D_EXPORT QgsPointCloudLayer3DRenderer : public QgsAbstract3DRenderer
|
||||
void readXml( const QDomElement &elem, const QgsReadWriteContext &context ) override;
|
||||
void resolveReferences( const QgsProject &project ) override;
|
||||
|
||||
/**
|
||||
* Returns the maximum screen error allowed when rendering the point cloud.
|
||||
*
|
||||
* Larger values result in a faster render with less points rendered.
|
||||
*
|
||||
* \see setMaximumScreenError()
|
||||
*/
|
||||
double maximumScreenError() const;
|
||||
|
||||
/**
|
||||
* Sets the maximum screen \a error allowed when rendering the point cloud.
|
||||
*
|
||||
* Larger values result in a faster render with less points rendered.
|
||||
*
|
||||
* \see maximumScreenError()
|
||||
*/
|
||||
void setMaximumScreenError( double error );
|
||||
|
||||
private:
|
||||
QgsMapLayerRef mLayerRef; //!< Layer used to extract mesh data from
|
||||
std::unique_ptr< QgsPointCloud3DSymbol > mSymbol;
|
||||
double mMaximumScreenError = 1.0;
|
||||
|
||||
private:
|
||||
#ifdef SIP_RUN
|
||||
|
@ -190,8 +190,8 @@ QgsAABB nodeBoundsToAABB( QgsPointCloudDataBounds nodeBounds, QgsVector3D offset
|
||||
}
|
||||
|
||||
|
||||
QgsPointCloudLayerChunkedEntity::QgsPointCloudLayerChunkedEntity( QgsPointCloudIndex *pc, const Qgs3DMapSettings &map, QgsPointCloud3DSymbol *symbol )
|
||||
: QgsChunkedEntity( 5, // max. allowed screen error (in pixels) -- // TODO
|
||||
QgsPointCloudLayerChunkedEntity::QgsPointCloudLayerChunkedEntity( QgsPointCloudIndex *pc, const Qgs3DMapSettings &map, QgsPointCloud3DSymbol *symbol, float maxScreenError )
|
||||
: QgsChunkedEntity( maxScreenError,
|
||||
new QgsPointCloudLayerChunkLoaderFactory( map, pc, symbol ), true )
|
||||
{
|
||||
setUsingAdditiveStrategy( true );
|
||||
|
@ -115,7 +115,7 @@ class QgsPointCloudLayerChunkedEntity : public QgsChunkedEntity
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QgsPointCloudLayerChunkedEntity( QgsPointCloudIndex *pc, const Qgs3DMapSettings &map, QgsPointCloud3DSymbol *symbol );
|
||||
explicit QgsPointCloudLayerChunkedEntity( QgsPointCloudIndex *pc, const Qgs3DMapSettings &map, QgsPointCloud3DSymbol *symbol, float maxScreenError );
|
||||
|
||||
~QgsPointCloudLayerChunkedEntity();
|
||||
};
|
||||
|
@ -527,3 +527,8 @@ void QgsPointCloud3DSymbolWidget::blueAttributeChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double QgsPointCloud3DSymbolWidget::maximumScreenError() const
|
||||
{
|
||||
return mMaxScreenErrorSpinBox->value();
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ class QgsPointCloud3DSymbolWidget : public QWidget, private Ui::QgsPointCloud3DS
|
||||
void setSymbol( QgsPointCloud3DSymbol *symbol );
|
||||
|
||||
QgsPointCloud3DSymbol *symbol() const;
|
||||
double maximumScreenError() const;
|
||||
|
||||
private slots:
|
||||
void reloadColorRampShaderMinMax();
|
||||
|
@ -50,6 +50,7 @@ QgsPointCloudLayer3DRenderer *QgsPointCloudLayer3DRendererWidget::renderer()
|
||||
QgsPointCloud3DSymbol *sym = mWidgetPointCloudSymbol->symbol();
|
||||
renderer->setSymbol( sym );
|
||||
renderer->setLayer( qobject_cast<QgsPointCloudLayer *>( mLayer ) );
|
||||
renderer->setMaximumScreenError( mWidgetPointCloudSymbol->maximumScreenError() );
|
||||
return renderer;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="mMaxScreenErrorSpinBox">
|
||||
<property name="maximum">
|
||||
<double>100000.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Maximum screen space error</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user