Skip to content
Permalink
Browse files

fix active faces not supported

  • Loading branch information
vcloarec authored and PeterPetrik committed Mar 5, 2020
1 parent 0675c0b commit 78bd73eb875c6b1fd2c34b3ba846cf6d319677cb
Showing with 10 additions and 9 deletions.
  1. +10 −7 src/3d/mesh/qgsmesh3dgeometry_p.cpp
  2. +0 −2 src/core/mesh/qgsmeshlayerutils.cpp
@@ -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 )
{

0 comments on commit 78bd73e

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