Skip to content
Permalink
Browse files

add point cloud elevation calibration button

  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Feb 16, 2021
1 parent 9eea594 commit 2337520a57b5828fd90966de4cc81c6dda01b313
@@ -33,6 +33,7 @@ QgsPointCloudElevationPropertiesWidget::QgsPointCloudElevationPropertiesWidget(

connect( mOffsetZSpinBox, qgis::overload<double >::of( &QDoubleSpinBox::valueChanged ), this, &QgsPointCloudElevationPropertiesWidget::onChanged );
connect( mScaleZSpinBox, qgis::overload<double >::of( &QDoubleSpinBox::valueChanged ), this, &QgsPointCloudElevationPropertiesWidget::onChanged );
connect( mShifPointCloudZAxisButton, &QPushButton::clicked, this, &QgsPointCloudElevationPropertiesWidget::shiftPointCloudZAxis );
}

void QgsPointCloudElevationPropertiesWidget::syncToLayer( QgsMapLayer *layer )
@@ -63,6 +64,15 @@ void QgsPointCloudElevationPropertiesWidget::onChanged()
emit widgetChanged();
}

void QgsPointCloudElevationPropertiesWidget::shiftPointCloudZAxis()
{
QgsDoubleRange range = mLayer->elevationProperties()->calculateZRange( mLayer );
if ( !range.isEmpty() )
{
mOffsetZSpinBox->setValue( -range.lower() + mOffsetZSpinBox->value() );
}
}

//
// QgsPointCloudElevationPropertiesWidgetFactory
//
@@ -38,7 +38,7 @@ class QgsPointCloudElevationPropertiesWidget : public QgsMapLayerConfigWidget, p
private slots:

void onChanged();

void shiftPointCloudZAxis();
private:

QgsPointCloudLayer *mLayer = nullptr;
@@ -57,6 +57,16 @@
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Elevation scaling and offset can be used to manually correct elevation values in the point cloud at render time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The scale is applied to the point cloud elevation values before adding the offset.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@@ -84,20 +94,20 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Elevation scaling and offset can be used to manually correct elevation values in the point cloud at render time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The scale is applied to the point cloud elevation values before adding the offset.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="mShifPointCloudZAxisButton">
<property name="toolTip">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
<property name="text">
<string>Shift point cloud Z axis</string>
</property>
</widget>
</item>
@@ -120,17 +130,17 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>

0 comments on commit 2337520

Please sign in to comment.