-
-
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
Mesh point add elevation #58877
base: master
Are you sure you want to change the base?
Mesh point add elevation #58877
Conversation
{ | ||
if ( mZValueWidget->getZFromProjectElevationEnabled() ) | ||
{ | ||
const QgsAbstractTerrainProvider *terrainProvider = QgsProject::instance()->elevationProperties()->terrainProvider(); | ||
const QgsCoordinateTransform transformation = QgsCoordinateTransform( mCurrentLayer->crs(), terrainProvider->crs(), QgsProject::instance() ); | ||
|
||
try | ||
{ | ||
const QgsPointXY point = transformation.transform( effectivePoint.x(), effectivePoint.y() ); | ||
zValue = terrainProvider->heightAt( point.x(), point.y() ); | ||
} | ||
catch ( const QgsCsException & ) | ||
{ | ||
zValue = std::numeric_limits<double>::quiet_NaN(); | ||
} |
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.
@uclaros unlike what we discussed last week, this cannot be moved up in the hierarchy of those if else
statements.
I believe that this settings should only affect newly added vertices that are isolated. We probably do not want to affect behavior when adding vertices on edges and in faces (those have Z interpolated from the MESH vertices itself) and that is what the previous if else
statements do. We only what to affect the else
branch which are the isolated vertices. So I believe that this should be correct.
@uclaros This should be ready, all the review comments are addressed. Only need to solve the comment above ;-) |
🪟 Windows buildsDownload Windows builds of this PR for testing. |
…currentZValue() would set up last added Z value (from previous point for example)
Fixed one issue with Z value assignment and added bunch of tests as required |
Description
This PR make some changes when adding new vertices to the MeshLayer.
ZValuesWidget
QgsAbstractTerrainProvider
to currently selected verticesQgsAbstractTerrainProvider
, when the point is createdThe placement of the new button and checkbox is up for discussion, so far it is added into
ZValuesWidget
for convenience