diff --git a/src/app/3d/qgs3dmapcanvaswidget.cpp b/src/app/3d/qgs3dmapcanvaswidget.cpp index c46b58f53308..a56d239ae11d 100644 --- a/src/app/3d/qgs3dmapcanvaswidget.cpp +++ b/src/app/3d/qgs3dmapcanvaswidget.cpp @@ -84,11 +84,11 @@ Qgs3DMapCanvasWidget::Qgs3DMapCanvasWidget( const QString &name, bool isDocked ) QAction *actionPointCloudChangeAttributeTool = mEditingToolBar->addAction( QIcon( QgsApplication::iconPath( "mActionSelectPolygon.svg" ) ), tr( "Change Point Cloud Attribute" ), this, &Qgs3DMapCanvasWidget::changePointCloudAttribute ); actionPointCloudChangeAttributeTool->setCheckable( true ); - mEditingToolBar->addWidget( new QLabel( tr( "Attribute:" ) ) ); + mEditingToolBar->addWidget( new QLabel( tr( "Attribute" ) ) ); mCboChangeAttribute = new QComboBox(); mEditingToolBar->addWidget( mCboChangeAttribute ); mSpinChangeAttributeValue = new QgsDoubleSpinBox(); - mEditingToolBar->addWidget( new QLabel( tr( "Value:" ) ) ); + mEditingToolBar->addWidget( new QLabel( tr( "Value" ) ) ); mEditingToolBar->addWidget( mSpinChangeAttributeValue ); QAction *actionEditingToolbar = toolBar->addAction( QIcon( QgsApplication::iconPath( "mIconPointCloudLayer.svg" ) ), tr( "Show Editing Toolbar" ), this, [this] { mEditingToolBar->setVisible( !mEditingToolBar->isVisible() ); } ); actionEditingToolbar->setCheckable( true ); diff --git a/src/app/3d/qgs3dmaptoolpointcloudchangeattribute.cpp b/src/app/3d/qgs3dmaptoolpointcloudchangeattribute.cpp index b3f208365f24..660ce16968c0 100644 --- a/src/app/3d/qgs3dmaptoolpointcloudchangeattribute.cpp +++ b/src/app/3d/qgs3dmaptoolpointcloudchangeattribute.cpp @@ -79,7 +79,7 @@ void Qgs3DMapToolPointCloudChangeAttribute::mouseReleaseEvent( QMouseEvent *even if ( ( event->pos() - mClickPoint ).manhattanLength() > QApplication::startDragDistance() ) return; - QgsPoint newPoint = screenPointToMap( event->pos() ); + const QgsPoint newPoint = screenPointToMap( event->pos() ); if ( event->button() == Qt::LeftButton ) { @@ -89,7 +89,7 @@ void Qgs3DMapToolPointCloudChangeAttribute::mouseReleaseEvent( QMouseEvent *even mCanvas->cameraController()->setInputHandlersEnabled( false ); } mPolygonRubberBand->addPoint( newPoint ); - mScreenPoints.append( QgsPoint( event->x(), event->y() ) ); + mScreenPoints.append( QgsPointXY( event->x(), event->y() ) ); } else if ( event->button() == Qt::RightButton ) { @@ -160,11 +160,11 @@ QgsPoint Qgs3DMapToolPointCloudChangeAttribute::screenPointToMap( const QPoint & // pick an arbitrary point mid-way between near and far plane const float pointDistance = ( mCanvas->cameraController()->camera()->farPlane() + mCanvas->cameraController()->camera()->nearPlane() ) / 2; - const QVector3D aa = ray.origin() + pointDistance * ray.direction().normalized(); + const QVector3D pointWorld = ray.origin() + pointDistance * ray.direction().normalized(); const QgsVector3D origin = mCanvas->mapSettings()->origin(); - const QgsPoint newPoint( aa.x() + origin.x(), aa.y() + origin.y(), aa.z() + origin.z() ); - return newPoint; + const QgsPoint pointMap( pointWorld.x() + origin.x(), pointWorld.y() + origin.y(), pointWorld.z() + origin.z() ); + return pointMap; } QgsGeometry Qgs3DMapToolPointCloudChangeAttribute::box3DToPolygonInScreenSpace( QgsBox3D box, const MapToPixel3D &mapToPixel3D )