Skip to content
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 overview in 2D #59854

Merged
merged 8 commits into from
Jan 8, 2025
Merged

Conversation

Withalion
Copy link
Contributor

Description

This PR changes the default behaviour of VPC rendering. We switch from rendering extents when zoomed out to rendering overview when it's present. This change adds seamless transition between overview into specific point clouds. Furthermore the user is able to switch between just extents, just overview and extents rendered over overview, by using combo box in layer styling side panel.

Screencast_20241212_142233.mp4

The label settings were also moved together with zoom out behaviour settings into new Virtual point cloud options QgsCollapsibleGroupBox. Which is visible only when dealing with virtual point clouds styling.

Note: When I dealt with setting the default Qgis::PointCloudZoomOutBehavior for layer renderer I noticed that the renderer is actually created multiple times!

  • First time the renderer gets created in QgsPointCloudLayer::setDataSourcePrivate, which is called by constructor
    if ( loadDefaultStyleFlag && isSpatial() && mDataProvider->capabilities() & QgsPointCloudDataProvider::CreateRenderer )
    {
    // first try to create a renderer directly from the data provider
    std::unique_ptr< QgsPointCloudRenderer > defaultRenderer( mDataProvider->createRenderer() );
    if ( defaultRenderer )
    {
    defaultLoadedFlag = true;
    setRenderer( defaultRenderer.release() );
    }
    }
    if ( !defaultLoadedFlag && loadDefaultStyleFlag )
    {
    loadDefaultStyle( defaultLoadedFlag );
    }
    if ( !defaultLoadedFlag )
    {
    // all else failed, create default renderer
    setRenderer( QgsPointCloudRendererRegistry::defaultRenderer( this ) );
    }
  • Second time the renderer is created by QgsAppLayerHandling::postProcessAddedLayer
    layer->loadDefaultStyle( ok );

Note 2: The layer has to be readded into the project for qgis to apply the default behaviour.

Funded by: Klimadatastyrelsen

@github-actions github-actions bot added this to the 3.42.0 milestone Dec 12, 2024
Copy link

github-actions bot commented Dec 12, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 08380e2)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 08380e2)

Copy link
Contributor

@uclaros uclaros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
I have an objection on the need for those averageSubIndexWidth and averageSubIndexHeight methods, though.

src/core/pointcloud/qgspointcloudlayer.cpp Outdated Show resolved Hide resolved
src/core/pointcloud/qgspointcloudlayerrenderer.cpp Outdated Show resolved Hide resolved
src/core/pointcloud/qgspointcloudlayerrenderer.cpp Outdated Show resolved Hide resolved
src/core/pointcloud/qgspointcloudlayerrenderer.cpp Outdated Show resolved Hide resolved
src/core/providers/vpc/qgsvirtualpointcloudprovider.cpp Outdated Show resolved Hide resolved
src/core/qgis.h Outdated Show resolved Hide resolved
@nyalldawson nyalldawson added the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Dec 14, 2024
@nyalldawson
Copy link
Collaborator

This will need some unit tests added too 👍

@DelazJ DelazJ added Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Dec 16, 2024
@qgis-bot
Copy link
Collaborator

@Withalion

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

@qgis-bot
Copy link
Collaborator

@Withalion
This pull request has been tagged as requiring documentation.

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.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@Withalion Withalion force-pushed the vpc-overview branch 2 times, most recently from 77c1191 to c28b8de Compare December 18, 2024 01:10
@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 2, 2025
@wonder-sk wonder-sk removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 7, 2025
@qgis qgis deleted a comment from github-actions bot Jan 7, 2025
Copy link
Member

@wonder-sk wonder-sk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 👏

@wonder-sk wonder-sk merged commit 2a8cd53 into qgis:master Jan 8, 2025
31 checks passed
@qgis-bot
Copy link
Collaborator

qgis-bot commented Jan 8, 2025

@Withalion
A documentation ticket has been opened at qgis/QGIS-Documentation#9532
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog Items that are queued to appear in the visual changelog - remove after harvesting Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Requires Tests! Waiting on the submitter to add unit tests before eligible for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants