25 : mGroupIndex( group ), mDatasetIndex( dataset )
71 if ( std::isnan( mY ) )
75 else if ( std::isnan( mX ) )
77 return std::numeric_limits<double>::quiet_NaN();
81 return std::sqrt( ( mX ) * ( mX ) + ( mY ) * ( mY ) );
112 bool equal = std::isnan( mX ) == std::isnan( other.
x() );
113 equal &= std::isnan( mY ) == std::isnan( other.
y() );
117 if ( std::isnan( mY ) )
135 const QMap<QString, QString> &extraOptions )
137 , mIsScalar( isScalar )
138 , mIsOnVertices( isOnVertices )
139 , mMinimumValue( minimum )
140 , mMaximumValue( maximum )
141 , mExtraOptions( extraOptions )
147 return mExtraOptions;
167 return ( mIsOnVertices ) ? DataType::DataOnVertices : DataType::DataOnFaces;
172 return mMinimumValue;
177 return mMaximumValue;
182 return datasetCount( index.
group() );
187 return datasetGroupMetadata( index.
group() );
195 , mIsValid( isValid )
196 , mMinimumValue( minimum )
197 , mMaximumValue( maximum )
213 return mMinimumValue;
218 return mMaximumValue;
222 : mType( ActiveFlagInteger )
232 mIntegerBuffer.resize( count );
235 mDoubleBuffer.resize( count );
238 mDoubleBuffer.resize( 2 * count );
253 return mIntegerBuffer.size();
255 return mDoubleBuffer.size();
257 return static_cast<int>( mDoubleBuffer.size() / 2.0 );
277 mDoubleBuffer[2 * index],
278 mDoubleBuffer[2 * index + 1]
287 return bool( mIntegerBuffer[index] );
296 return mIntegerBuffer.data();
300 return mDoubleBuffer.data();
308 return mIntegerBuffer.constData();
312 return mDoubleBuffer.constData();
318 if ( index < vertices.size() && index >= 0 )
319 return vertices[index];
325 if ( index < faces.size() && index >= 0 )
332 return vertices.size();
bool operator==(const QgsMeshDatasetValue &other) const
void set(double scalar)
Sets scalar value.
QgsMeshDatasetValue()=default
Default Ctor, initialize to NaN.
QgsMeshVertex vertex(int index) const
Returns a vertex at the index.
int dataset() const
Returns a dataset index within group()
Vector double pairs (x1, y1, x2, y2, ... )
const void * constBuffer() const
Returns internal buffer to the array for fast values reading.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
int count() const
Number of items stored in the block.
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.
void * buffer()
Returns internal buffer to the array.
Abstract base class for spatial data provider implementations.
void setY(double y)
Sets Y value.
QgsMeshDataProvider(const QString &uri, const QgsDataProvider::ProviderOptions &options)
Ctor.
DataType type() const
Type of data stored in the block.
int group() const
Returns a group index.
bool operator!=(const QgsMeshDatasetIndex &other) const
Inequality operator.
double y() const
Returns y value.
bool active(int index) const
Returns a value for active flag by the index For scalar and vector 2d the behavior is undefined...
QgsMeshDataBlock()
Constructs an invalid block.
Integer boolean flag whether face is active.
bool operator==(const QgsMeshDatasetIndex &other) const
Equality operator.
double scalar() const
Returns magnitude of vector for vector data or scalar value for scalar data.
Point geometry type, with support for z-dimension and m-values.
DataType
Type of data stored in the block.
Setting options for creating vector data providers.
bool isValid() const
Whether the block is valid.
QVector< int > QgsMeshFace
List of vertex indexes.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
bool isValid() const
Returns whether index is valid, ie at least groups is set.
QgsMeshDatasetValue value(int index) const
Returns a value represented by the index For active flag the behavior is undefined.
QgsMeshFace face(int index) const
Returns a face at the index.
QgsMeshDatasetValue represents single dataset value.
int vertexCount() const
Returns number of vertices.
int faceCount() const
Returns number of faces.
void setX(double x)
Sets X value.
double x() const
Returns x value.
QgsPoint QgsMeshVertex
xyz coords of vertex
virtual QgsMeshDatasetGroupMetadata datasetGroupMetadata(int groupIndex) const =0
Returns dataset group metadata.