Skip to content
Permalink
Browse files

disable transparency for QgsInterpolatedLineRenderer

  • Loading branch information
vcloarec authored and nyalldawson committed May 2, 2020
1 parent 9ae70e3 commit aa6d23d5404a1e38a027ec2cc3a7d53211420aaa
@@ -207,11 +207,6 @@ Sets the unit of the stroke width
void setInterpolatedColor( const QgsInterpolatedLineColor &strokeColoring );
%Docstring
Sets the stroke color used to plot
%End

void setOpacity( double opacity );
%Docstring
Sets the opacity used to plot
%End

void render( double value1, double value2, QgsPointXY point1, QgsPointXY point2, QgsRenderContext &context ) const;
@@ -137,6 +137,8 @@ void QgsMeshRendererScalarSettingsWidget::syncToLayer( )
whileBlocking( mScalarEdgeStrokeWidthSpinBox )->setValue( edgeStrokeWidth.fixedStrokeWidth() );
whileBlocking( mScalarEdgeStrokeWidthVariableRadioButton )->setChecked( edgeStrokeWidth.isVariableWidth() );
whileBlocking( mScalarEdgeStrokeWidthUnitSelectionWidget )->setUnit( settings.edgeStrokeWidthUnit() );
if ( !hasFaces )
mOpacityContainerWidget->setVisible( false );

const QgsMeshDatasetGroupMetadata metadata = mMeshLayer->dataProvider()->datasetGroupMetadata( mActiveDatasetGroup );
double min = metadata.minimum();
@@ -466,7 +466,6 @@ void QgsMeshLayerRenderer::renderScalarDatasetOnEdges( const QgsMeshRendererScal
edgePlotter.setInterpolatedColor( QgsInterpolatedLineColor( scalarSettings.colorRampShader() ) );
edgePlotter.setInterpolatedWidth( QgsInterpolatedLineWidth( scalarSettings.edgeStrokeWidth() ) );
edgePlotter.setWidthUnit( scalarSettings.edgeStrokeWidthUnit() );
edgePlotter.setOpacity( scalarSettings.opacity() );

for ( const int i : egdesInExtent )
{
@@ -39,7 +39,6 @@ void QgsInterpolatedLineRenderer::render( double value1, double value2, QgsPoint
painter->save();
if ( context.flags() & QgsRenderContext::Antialiasing )
painter->setRenderHint( QPainter::Antialiasing, true );
painter->setOpacity( mOpacity );

const QgsMapToPixel &mapToPixel = context.mapToPixel();

@@ -227,12 +226,6 @@ void QgsInterpolatedLineRenderer::adjustLine( const double &value, const double
}
}


void QgsInterpolatedLineRenderer::setOpacity( double opacity )
{
mOpacity = opacity;
}

double QgsInterpolatedLineWidth::minimumValue() const
{
return mMinimumValue;
@@ -186,9 +186,6 @@ class CORE_EXPORT QgsInterpolatedLineRenderer
//! Sets the stroke color used to plot
void setInterpolatedColor( const QgsInterpolatedLineColor &strokeColoring );

//! Sets the opacity used to plot
void setOpacity( double opacity );

/**
* Render a line in the \a context between \a point1 and \a point2
* with color and width that vary depending on \a value1 and \a value2
@@ -199,7 +196,6 @@ class CORE_EXPORT QgsInterpolatedLineRenderer
QgsInterpolatedLineWidth mStrokeWidth;
QgsInterpolatedLineColor mStrokeColoring;
QgsUnitTypes::RenderUnit mStrokeWidthUnit = QgsUnitTypes::RenderMillimeters;
double mOpacity;

QPolygonF varyingWidthLine( double value1, double value2, QPointF point1, QPointF point2, QgsRenderContext &context ) const;
void adjustLine( const double &value, const double &value1, const double &value2, double &width, double &adjusting ) const;
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>378</width>
<height>237</height>
<height>206</height>
</rect>
</property>
<property name="windowTitle">
@@ -27,22 +27,42 @@
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="mOpacityLabel">
<property name="text">
<string>Opacity</string>
</property>
</widget>
</item>
<item>
<widget class="QgsOpacityWidget" name="mOpacityWidget" native="true">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
</layout>
<widget class="QWidget" name="mOpacityContainerWidget" native="true">
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="mOpacityLabel">
<property name="text">
<string>Opacity</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsOpacityWidget" name="mOpacityWidget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>14</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="mEdgeWidthGroupBox">

0 comments on commit aa6d23d

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