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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

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 db141fe)

🪟 Windows Qt6 builds

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

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!

Load overview if it exists either by ref from vpc file or look for
overview file.
Render overview instead of extends by default when zoomed out.
Copy link

github-actions bot commented Jan 2, 2025

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@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
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 stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants