Skip to content
Permalink
Browse files

Add a hacky configuration page for point cloud 2d renderer

  • Loading branch information
nyalldawson committed Oct 27, 2020
1 parent c958562 commit 2826d917427fdff537639c51d91a87395d1d9299
@@ -102,6 +102,12 @@ QgsPointCloudLayerProperties::QgsPointCloudLayerProperties( QgsPointCloudLayer *
void QgsPointCloudLayerProperties::apply()
{
mMetadataWidget->acceptMetadata();

// TODO -- move to proper widget classes!
mLayer->setCustomProperty( QStringLiteral( "pcMin" ), mMinZSpin->value() );
mLayer->setCustomProperty( QStringLiteral( "pcMax" ), mMaxZSpin->value() );
mLayer->setCustomProperty( QStringLiteral( "pcRamp" ), mBtnColorRamp->colorRampName().isEmpty() ? QStringLiteral( "Viridis" ) : mBtnColorRamp->colorRampName() );
mLayer->triggerRepaint();
}

void QgsPointCloudLayerProperties::onCancel()
@@ -131,6 +137,11 @@ void QgsPointCloudLayerProperties::syncToLayer()
mInformationTextBrowser->setOpenLinks( false );
connect( mInformationTextBrowser, &QTextBrowser::anchorClicked, this, &QgsPointCloudLayerProperties::urlClicked );

// TODO -- move to proper widget classes!
mMinZSpin->setValue( mLayer->customProperty( QStringLiteral( "pcMin" ), 400 ).toInt() );
mMaxZSpin->setValue( mLayer->customProperty( QStringLiteral( "pcMax" ), 600 ).toInt() );
mBtnColorRamp->setColorRampFromName( mLayer->customProperty( QStringLiteral( "pcRamp" ), QStringLiteral( "Viridis" ) ).toString() );
mBtnColorRamp->setColorRampName( mLayer->customProperty( QStringLiteral( "pcRamp" ), QStringLiteral( "Viridis" ) ).toString() );
}


@@ -110,6 +110,18 @@
<normaloff>:/images/themes/default/propertyicons/metadata.svg</normaloff>:/images/themes/default/propertyicons/metadata.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>Symbology</string>
</property>
<property name="toolTip">
<string>Symbology</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/symbology.svg</normaloff>:/images/themes/default/propertyicons/symbology.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>Metadata</string>
@@ -164,7 +176,7 @@
<enum>QFrame::Plain</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="mOptsPage_Information">
<layout class="QVBoxLayout" name="verticalLayout_4">
@@ -185,6 +197,99 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Ramp</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Min z</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max z</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QgsColorRampButton" name="mBtnColorRamp">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QgsSpinBox" name="mMinZSpin">
<property name="minimum">
<number>-999999999</number>
</property>
<property name="maximum">
<number>999999999</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QgsSpinBox" name="mMaxZSpin">
<property name="minimum">
<number>-999999999</number>
</property>
<property name="maximum">
<number>999999999</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="mOptsPage_Metadata">
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="leftMargin">
@@ -265,6 +370,17 @@
<extends>QLineEdit</extends>
<header>qgsfilterlineedit.h</header>
</customwidget>
<customwidget>
<class>QgsColorRampButton</class>
<extends>QToolButton</extends>
<header>qgscolorrampbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsSpinBox</class>
<extends>QSpinBox</extends>
<header>qgsspinbox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mSearchLineEdit</tabstop>
@@ -564,6 +564,11 @@
<zorder>mOffsetDDBtn</zorder>
</widget>
<customwidgets>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
@@ -575,11 +580,6 @@
<extends>QToolButton</extends>
<header>qgspropertyoverridebutton.h</header>
</customwidget>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsUnitSelectionWidget</class>
<extends>QWidget</extends>

0 comments on commit 2826d91

Please sign in to comment.
You can’t perform that action at this time.