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

Change how "Get Z value from project terrain" tool is presented in Mesh Editing #60709

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

Conversation

JanCaha
Copy link
Contributor

@JanCaha JanCaha commented Feb 21, 2025

Description

Changed the way how Get Z value from project terrain is presented to the user according to #60512 (comment).

The Z Value and Get Z value from project terrain checkboxes are mutually exclusive, so user can either select one or the other.

Works with both Preview Transform and Apply Transform.

Clipboard 1

@github-actions github-actions bot added this to the 3.44.0 milestone Feb 21, 2025
Copy link

github-actions bot commented Feb 21, 2025

🪟 Windows builds

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

🪟 Windows Qt6 builds

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

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 change, the tool now blends nicely with the Transform Mesh Vertices panel!


connect( mCheckBoxZ, &QCheckBox::toggled, this, [=]( const bool checked ) {
if ( checked )
mCheckBoxZFromProjectTerrain->setChecked( !checked );
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mCheckBoxZFromProjectTerrain->setChecked( !checked );
mCheckBoxZFromProjectTerrain->setChecked( false );

} );
connect( mCheckBoxZFromProjectTerrain, &QCheckBox::toggled, this, [=]( const bool checked ) {
if ( checked )
mCheckBoxZ->setChecked( !checked );
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mCheckBoxZ->setChecked( !checked );
mCheckBoxZ->setChecked( false );

*
* \since QGIS 3.44
*/
void setZFromTerrain( bool enable );
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably worth adding a note that when enable is TRUE, the optional project parameter needs to be also used in calculate() method

Comment on lines +131 to +134
if ( mCheckBoxZFromProjectTerrain->isChecked() )
{
mTransformVertices.setZFromTerrain( mCheckBoxZFromProjectTerrain->isChecked() );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Either

Suggested change
if ( mCheckBoxZFromProjectTerrain->isChecked() )
{
mTransformVertices.setZFromTerrain( mCheckBoxZFromProjectTerrain->isChecked() );
}
if ( mCheckBoxZFromProjectTerrain->isChecked() )
{
mTransformVertices.setZFromTerrain( true );
}

or

Suggested change
if ( mCheckBoxZFromProjectTerrain->isChecked() )
{
mTransformVertices.setZFromTerrain( mCheckBoxZFromProjectTerrain->isChecked() );
}
mTransformVertices.setZFromTerrain( mCheckBoxZFromProjectTerrain->isChecked() );

?

Comment on lines +673 to +676
if ( mZFromTerrain )
{
if ( project )
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ( mZFromTerrain )
{
if ( project )
{
if ( mZFromTerrain && project )
{

<item row="4" column="0">
<widget class="QCheckBox" name="mCheckBoxZFromProjectTerrain">
<property name="text">
<string>Get Z value from project terrain</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be more proper to say:

Suggested change
<string>Get Z value from project terrain</string>
<string>Get Z value from the project terrain</string>

Any native speaker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants