25 : mGroupIndex( group ), mDatasetIndex( dataset )
88 if ( std::isnan( mY ) )
92 else if ( std::isnan( mX ) )
94 return std::numeric_limits<double>::quiet_NaN();
98 return std::sqrt( ( mX ) * ( mX ) + ( mY ) * ( mY ) );
129 bool equal = std::isnan( mX ) == std::isnan( other.
x() );
130 equal &= std::isnan( mY ) == std::isnan( other.
y() );
134 if ( std::isnan( mY ) )
151 const QMap<QString, QString> &extraOptions )
153 , mIsScalar( isScalar )
154 , mIsOnVertices( isOnVertices )
155 , mExtraOptions( extraOptions )
161 return mExtraOptions;
183 return ( mIsOnVertices ) ? DataType::DataOnVertices : DataType::DataOnFaces;
188 return datasetCount( index.
group() );
193 return datasetGroupMetadata( index.
group() );
199 , mIsValid( isValid )
A rectangle specified with double values.
void setMinimal()
Set a rectangle so that min corner is at max and max corner is at min.
void set(double scalar)
Sets scalar value.
QgsMeshDatasetValue()=default
Default Ctor, initialize to NaN.
void setXMaximum(double x)
Set the maximum x value.
double yMaximum() const
Returns the y maximum value (top side of rectangle).
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
bool isValid() const
Returns whether index is valid, ie at least groups is set.
virtual int datasetCount(int groupIndex) const =0
Returns number of datasets loaded in the group.
QgsMeshDatasetIndex(int group=-1, int dataset=-1)
Creates an index. -1 represents invalid group/dataset.
virtual int vertexCount() const =0
Returns number of vertices in the native mesh.
int dataset() const
Returns a dataset index within group()
Abstract base class for spatial data provider implementations.
void setY(double y)
Sets Y value.
QgsMeshDataProvider(const QString &uri, const QgsDataProvider::ProviderOptions &options)
Ctor.
QgsRectangle extent() const override
Returns the extent of the layer.
double yMinimum() const
Returns the y minimum value (bottom side of rectangle).
double xMaximum() const
Returns the x maximum value (right side of rectangle).
void setYMinimum(double y)
Set the minimum y value.
double y() const
Returns y value.
Point geometry type, with support for z-dimension and m-values.
double scalar() const
Returns magnitude of vector for vector data or scalar value for scalar data.
virtual QgsMeshVertex vertex(int index) const =0
Returns the mesh vertex at index.
bool operator==(const QgsMeshDatasetValue &other) const
Setting options for creating vector data providers.
void setYMaximum(double y)
Set the maximum y value.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
int group() const
Returns a group index.
QgsMeshDatasetValue represents single dataset value.
bool operator==(const QgsMeshDatasetIndex &other) const
Equality operator.
double x() const
Returns x value.
bool operator!=(const QgsMeshDatasetIndex &other) const
Inequality operator.
void setX(double x)
Sets X value.
double xMinimum() const
Returns the x minimum value (left side of rectangle).
void setXMinimum(double x)
Set the minimum x value.
virtual QgsMeshDatasetGroupMetadata datasetGroupMetadata(int groupIndex) const =0
Returns dataset group metadata.