Skip to content
Permalink
Browse files

Rename faceIsActive() to isFaceActive()

  • Loading branch information
wonder-sk committed Aug 20, 2018
1 parent 419ec1f commit 26631b3d443ab5e60c7ae54fff691f2970a526b4
@@ -361,7 +361,7 @@ Returns vector/scalar value associated with the index from the dataset
See QgsMeshDatasetMetadata.isVector() to check if the returned value is vector or scalar
%End

virtual bool faceIsActive( QgsMeshDatasetIndex index, int faceIndex ) const = 0;
virtual bool isFaceActive( QgsMeshDatasetIndex index, int faceIndex ) const = 0;
%Docstring
Returns whether the face is active for particular dataset

@@ -348,7 +348,7 @@ class CORE_EXPORT QgsMeshDatasetSourceInterface SIP_ABSTRACT
* | F1 | F2 | F3 |
* V3 ---- V4 ---- V6-----V8
*/
virtual bool faceIsActive( QgsMeshDatasetIndex index, int faceIndex ) const = 0;
virtual bool isFaceActive( QgsMeshDatasetIndex index, int faceIndex ) const = 0;
};


@@ -128,7 +128,7 @@ QgsMeshDatasetValue QgsMeshLayer::datasetValue( const QgsMeshDatasetIndex &index
if ( faceIndex >= 0 )
{
int nativeFaceIndex = mTriangularMesh->trianglesToNativeFaces().at( faceIndex );
if ( dataProvider()->faceIsActive( index, nativeFaceIndex ) )
if ( dataProvider()->isFaceActive( index, nativeFaceIndex ) )
{

if ( dataProvider()->datasetGroupMetadata( index ).dataType() == QgsMeshDatasetGroupMetadata::DataOnFaces )
@@ -114,7 +114,7 @@ void QgsMeshLayerRenderer::copyScalarDatasetValues( QgsMeshLayer *layer )
mScalarActiveFaceFlagValues.resize( mNativeMesh.faces.count() );
for ( int i = 0; i < mNativeMesh.faces.count(); ++i )
{
bool active = layer->dataProvider()->faceIsActive( datasetIndex, i );
bool active = layer->dataProvider()->isFaceActive( datasetIndex, i );
mScalarActiveFaceFlagValues[i] = active;
}

@@ -407,7 +407,7 @@ QgsMeshDatasetValue QgsMeshMemoryDataProvider::datasetValue( QgsMeshDatasetIndex
}
}

bool QgsMeshMemoryDataProvider::faceIsActive( QgsMeshDatasetIndex index, int faceIndex ) const
bool QgsMeshMemoryDataProvider::isFaceActive( QgsMeshDatasetIndex index, int faceIndex ) const
{
Q_UNUSED( index );
Q_UNUSED( faceIndex );
@@ -128,7 +128,7 @@ class QgsMeshMemoryDataProvider: public QgsMeshDataProvider
QgsMeshDatasetGroupMetadata datasetGroupMetadata( int groupIndex ) const override;
QgsMeshDatasetMetadata datasetMetadata( QgsMeshDatasetIndex index ) const override;
QgsMeshDatasetValue datasetValue( QgsMeshDatasetIndex index, int valueIndex ) const override;
bool faceIsActive( QgsMeshDatasetIndex index, int faceIndex ) const override;
bool isFaceActive( QgsMeshDatasetIndex index, int faceIndex ) const override;

//! Returns the memory provider key
static QString providerKey();
@@ -216,7 +216,7 @@ QgsMeshDatasetValue QgsMdalProvider::datasetValue( QgsMeshDatasetIndex index, in
return val;
}

bool QgsMdalProvider::faceIsActive( QgsMeshDatasetIndex index, int faceIndex ) const
bool QgsMdalProvider::isFaceActive( QgsMeshDatasetIndex index, int faceIndex ) const
{
DatasetGroupH group = MDAL_M_datasetGroup( mMeshH, index.group() );
if ( !group )
@@ -64,7 +64,7 @@ class QgsMdalProvider : public QgsMeshDataProvider
QgsMeshDatasetGroupMetadata datasetGroupMetadata( int groupIndex ) const override;
QgsMeshDatasetMetadata datasetMetadata( QgsMeshDatasetIndex index ) const override;
QgsMeshDatasetValue datasetValue( QgsMeshDatasetIndex index, int valueIndex ) const override;
bool faceIsActive( QgsMeshDatasetIndex index, int faceIndex ) const override;
bool isFaceActive( QgsMeshDatasetIndex index, int faceIndex ) const override;

private:
MeshH mMeshH;
@@ -180,7 +180,7 @@ void TestQgsMeshLayer::test_read_vertex_scalar_dataset()
QCOMPARE( QgsMeshDatasetValue( 2.0 + i ), dp->datasetValue( ds, 3 ) );
QCOMPARE( QgsMeshDatasetValue( 1.0 + i ), dp->datasetValue( ds, 4 ) );

QVERIFY( dp->faceIsActive( ds, 0 ) );
QVERIFY( dp->isFaceActive( ds, 0 ) );
}
}
}
@@ -220,7 +220,7 @@ void TestQgsMeshLayer::test_read_vertex_vector_dataset()
QCOMPARE( QgsMeshDatasetValue( 2 + i, 2 + i ), dp->datasetValue( ds, 3 ) );
QCOMPARE( QgsMeshDatasetValue( 1 + i, -2 + i ), dp->datasetValue( ds, 4 ) );

QVERIFY( dp->faceIsActive( ds, 0 ) );
QVERIFY( dp->isFaceActive( ds, 0 ) );
}
}
}
@@ -257,7 +257,7 @@ void TestQgsMeshLayer::test_read_face_scalar_dataset()
QCOMPARE( QgsMeshDatasetValue( 1 + i ), dp->datasetValue( ds, 0 ) );
QCOMPARE( QgsMeshDatasetValue( 2 + i ), dp->datasetValue( ds, 1 ) );

QVERIFY( dp->faceIsActive( ds, 0 ) );
QVERIFY( dp->isFaceActive( ds, 0 ) );
}
}
}
@@ -295,7 +295,7 @@ void TestQgsMeshLayer::test_read_face_vector_dataset()
QCOMPARE( QgsMeshDatasetValue( 1 + i, 1 + i ), dp->datasetValue( ds, 0 ) );
QCOMPARE( QgsMeshDatasetValue( 2 + i, 2 + i ), dp->datasetValue( ds, 1 ) );

QVERIFY( dp->faceIsActive( ds, 0 ) );
QVERIFY( dp->isFaceActive( ds, 0 ) );
}
}
}
@@ -331,8 +331,8 @@ void TestQgsMeshLayer::test_read_vertex_scalar_dataset_with_inactive_face()
QCOMPARE( QgsMeshDatasetValue( 1.0 + i ), dp->datasetValue( ds, 4 ) );

// We have 2 faces
QVERIFY( !dp->faceIsActive( ds, 0 ) );
QVERIFY( dp->faceIsActive( ds, 1 ) );
QVERIFY( !dp->isFaceActive( ds, 0 ) );
QVERIFY( dp->isFaceActive( ds, 1 ) );
}
}

0 comments on commit 26631b3

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