Skip to content
Permalink
Browse files

render first datasetgroup instead of mesh frame

  • Loading branch information
PeterPetrik committed Jan 24, 2019
1 parent abda6c4 commit a83a1b29a1bb97f1adaea900a736b0feec5bb446
Showing with 17 additions and 7 deletions.
  1. +16 −7 src/core/mesh/qgsmeshlayer.cpp
  2. +1 −0 src/core/mesh/qgsmeshlayer.h
@@ -49,15 +49,24 @@ QgsMeshLayer::QgsMeshLayer( const QString &meshLayerPath,
}

setLegend( QgsMapLayerLegend::defaultMeshLegend( this ) );

// show at least the mesh by default so we render something
QgsMeshRendererMeshSettings meshSettings;
meshSettings.setEnabled( true );
mRendererSettings.setNativeMeshSettings( meshSettings );

setDefaultRendererSettings();
} // QgsMeshLayer ctor


void QgsMeshLayer::setDefaultRendererSettings()
{
if ( mDataProvider && mDataProvider->datasetGroupCount() > 0 )
{
// show data from the first dataset group
mRendererSettings.setActiveScalarDataset( QgsMeshDatasetIndex( 0, 0 ) );
}
else
{
// show at least the mesh by default
QgsMeshRendererMeshSettings meshSettings;
meshSettings.setEnabled( true );
mRendererSettings.setNativeMeshSettings( meshSettings );
}
}

QgsMeshLayer::~QgsMeshLayer()
{
@@ -232,6 +232,7 @@ class CORE_EXPORT QgsMeshLayer : public QgsMapLayer
private:
void fillNativeMesh();
void assignDefaultStyleToDatasetGroup( int groupIndex );
void setDefaultRendererSettings();

private slots:
void onDatasetGroupsAdded( int count );

0 comments on commit a83a1b2

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