-
-
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
Add support for point cloud expressions to Processing expression parameter #52730
Add support for point cloud expressions to Processing expression parameter #52730
Conversation
@alexbruy A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
python/core/auto_generated/processing/qgsprocessingparameters.sip.in
Outdated
Show resolved
Hide resolved
* | ||
* \since QGIS 3.32 | ||
*/ | ||
QString asPdalExpression() 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.
I think this needs some bool& ok SIP_OUT, QString& error SIP_OUT
arguments so that callers can get feedback if an expression can't be converted to PDAL format
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.
Not sure about it. Conversion is done similar to how the dump()
method works, with occasional substring replacement (e.g. "and" is replaced with "&&").
void QgsProcessingPointCloudExpressionLineEdit::editExpression() | ||
{ | ||
const QString currentExpression = expression(); | ||
QgsProcessingPointCloudExpressionDialog dlg( mLayer ); |
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.
it would be SUPER nice to make this open as a QgsPanelWidget. Then we could avoid an unwanted modal dialog blocking things.
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.
Would you mind if I do it in a follow up pull-request?
distinguish between native QGIS expressions and point cloud filter expressions
parameter definition widget
@alexbruy |
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
Description
With addition of filtering capabilities to point cloud algorithms, we need a userfriedly way to build point cloud expressions similarly to the QGIS native expressions.
To make it possible this pull-request adds a
Type
enum toQgsProcessingParameterExpression
parameter with two optionsQgis
andPointCloud
. If parameter has aPointCloud
type, it will use new widget wrapper with GUI point cloud expression builder.To maintain backward compatibility, by default expression parameter uses
Qgis
expression type.The
QgsPointCloudExpression
class was extented with the new method to convert QGIS point cloud expressions to PDAL expressions.All PDAL algorithms using expression filter were updated to use expression parameter instead of strings.