mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
fix active faces not supported
This commit is contained in:
parent
0675c0b697
commit
78bd73eb87
@ -144,7 +144,7 @@ static QByteArray createDatasetIndexData( const QgsTriangularMesh &mesh, const Q
|
||||
for ( int i = 0; i < trianglesCount; ++i )
|
||||
{
|
||||
int nativeFaceIndex = mesh.trianglesToNativeFaces()[i];
|
||||
const bool isActive = mActiveFaceFlagValues.active( nativeFaceIndex );
|
||||
const bool isActive = mActiveFaceFlagValues.active().isEmpty() || mActiveFaceFlagValues.active( nativeFaceIndex );
|
||||
if ( !isActive )
|
||||
continue;
|
||||
const QgsMeshFace &face = mesh.triangles().at( i );
|
||||
@ -425,12 +425,15 @@ int QgsMeshDataset3dGeometry::extractDataset( QVector<double> &verticalMagnitude
|
||||
|
||||
//count active faces
|
||||
int activeTriangularCount = 0;
|
||||
for ( int i = 0; i < triangularMesh.triangles().count(); ++i )
|
||||
{
|
||||
int nativeIndex = triangularMesh.trianglesToNativeFaces()[i];
|
||||
if ( activeFaceFlagValues.active( nativeIndex ) )
|
||||
activeTriangularCount++;
|
||||
}
|
||||
if ( activeFaceFlagValues.active().isEmpty() )
|
||||
activeTriangularCount = triangularMesh.triangles().count();
|
||||
else
|
||||
for ( int i = 0; i < triangularMesh.triangles().count(); ++i )
|
||||
{
|
||||
int nativeIndex = triangularMesh.trianglesToNativeFaces()[i];
|
||||
if ( activeFaceFlagValues.active( nativeIndex ) )
|
||||
activeTriangularCount++;
|
||||
}
|
||||
|
||||
//extract the scalar dataset used to render color shading
|
||||
QgsMeshDataBlock scalarActiveFaceFlagValues =
|
||||
|
@ -306,8 +306,6 @@ QVector<double> QgsMeshLayerUtils::calculateMagnitudeOnVertices( const QgsMeshLa
|
||||
if ( vals.isValid() )
|
||||
{
|
||||
ret = QgsMeshLayerUtils::calculateMagnitudes( vals );
|
||||
QgsMeshDataBlock scalarActiveFaceFlagValues =
|
||||
meshLayer->dataProvider()->areFacesActive( index, 0, nativeMesh->faces.count() );
|
||||
|
||||
if ( !scalarDataOnVertices )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user