QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgsrasteridentifyresult.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasteridentifyresult.h
3  --------------------------------------
4  Date : Apr 8, 2013
5  Copyright : (C) 2013 by Radim Blazek
6  email : radim dot blazek at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSRASTERIDENTIFYRESULT_H
19 #define QGSRASTERIDENTIFYRESULT_H
20 
21 #include "qgis_core.h"
22 #include "qgis_sip.h"
23 #include "qgsraster.h"
24 #include "qgserror.h"
25 
30 class CORE_EXPORT QgsRasterIdentifyResult
31 {
32  public:
33 
38 
44  QgsRasterIdentifyResult( QgsRaster::IdentifyFormat format, const QMap<int, QVariant> &results );
45 
50  QgsRasterIdentifyResult( const QgsError &error );
51 
52  virtual ~QgsRasterIdentifyResult() = default;
53 
55  bool isValid() const { return mValid; }
56 
58  QgsRaster::IdentifyFormat format() const { return mFormat; }
59 
67  QMap<int, QVariant> results() const { return mResults; }
68 
70  void setParams( const QMap<QString, QVariant> &params ) { mParams = params; }
71 
73  QMap<QString, QVariant> params() const { return mParams; }
74 
76  QgsError error() const { return mError; }
77 
79  void setError( const QgsError &error ) { mError = error;}
80 
81  private:
83  bool mValid = false;
84 
87 
88  // TODO: better hierarchy (sublayer multiple feature sets)?
89  // TODO?: results are not consistent for different formats (per band x per sublayer)
90 
92  QMap<int, QVariant> mResults;
93 
95  QMap<QString, QVariant> mParams;
96 
98  QgsError mError;
99 };
100 
101 #endif
102 
103 
QgsError is container for error messages (report).
Definition: qgserror.h:81
Raster identify results container.
void setError(const QgsError &error)
Sets the last error.
void setParams(const QMap< QString, QVariant > &params)
Sets map of optional parameters.
QgsRaster::IdentifyFormat format() const
Returns the results format.
QgsError error() const
Returns the last error.
bool isValid() const
Returns true if valid.
QMap< int, QVariant > results() const
Returns the identify results.
QMap< QString, QVariant > params() const
Gets map of optional parameters.
virtual ~QgsRasterIdentifyResult()=default
QgsRasterIdentifyResult()=default
Constructor for QgsRasterIdentifyResult.
IdentifyFormat
Definition: qgsraster.h:58
@ IdentifyFormatUndefined
Definition: qgsraster.h:59