-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual point clouds - Tile Labels #59726
base: master
Are you sure you want to change the base?
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
6245123
to
6b7b611
Compare
/** | ||
* Renders the file name label inside extent rectangle | ||
* \param extent QRectF in screen CRS inside which the label will be | ||
* rendered | ||
* \param text QString - file name without suffix | ||
* \param context point cloud rendering context | ||
* \since QGIS 3.42 | ||
*/ | ||
void renderLabels( const QRectF &extent, const QString &text, QgsPointCloudRenderContext &context ) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be "renderLabel", since it renders a single label only?
/** | |
* Renders the file name label inside extent rectangle | |
* \param extent QRectF in screen CRS inside which the label will be | |
* rendered | |
* \param text QString - file name without suffix | |
* \param context point cloud rendering context | |
* \since QGIS 3.42 | |
*/ | |
void renderLabels( const QRectF &extent, const QString &text, QgsPointCloudRenderContext &context ) const; | |
/** | |
* Renders a label inside the specified extent rectangle. | |
* | |
* The label will be rendered centered horizontally and vertically inside \a extent. If the label is too large to fit | |
* inside this rectangle, it will not be rendered. | |
* | |
* \param extent rectangle (in painter coordinates) inside which the label will be | |
* rendered | |
* \param text label text to render | |
* \param context point cloud rendering context | |
* \since QGIS 3.42 | |
*/ | |
void renderLabel( const QRectF &extent, const QString &text, QgsPointCloudRenderContext &context ) const; |
QStringList labelText; | ||
const QgsTextDocument doc = QgsTextDocument::fromTextAndFormat( labelText << text, labelTextFormat() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QStringList labelText; | |
const QgsTextDocument doc = QgsTextDocument::fromTextAndFormat( labelText << text, labelTextFormat() ); | |
const QgsTextDocument doc = QgsTextDocument::fromTextAndFormat( { text }, labelTextFormat() ); |
// set some better defaults for label format | ||
QgsTextFormat textFormat = mLayer->renderer()->labelTextFormat(); | ||
QgsTextBufferSettings settings; | ||
settings.setEnabled( true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean it's impossible to remove the buffer?
I think instead this should be done in the QgsPointCloudLayerRenderer constructor, so that users CAN manually remove the buffer if they don't want it.
Also the format should default to QgsStyle::defaultStyle()->defaultTextFormat()
(again, in QgsPointCloudLayerRenderer constructor)
Description
In this PR we add the option to show labels when working with virtual point clouds. The labels even if set are only shown when the bounding boxes of point clouds are visible and if they fit inside. Users can also modify the format of the label text via
QgsTextFormatButton
next to it.Funded by: Klimadatastyrelsen