QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 
66  QMap<int, QVariant> results() const { return mResults; }
67 
69  void setParams( const QMap<QString, QVariant> &params ) { mParams = params; }
70 
72  QMap<QString, QVariant> params() const { return mParams; }
73 
75  QgsError error() const { return mError; }
76 
78  void setError( const QgsError &error ) { mError = error;}
79 
80  private:
82  bool mValid = false;
83 
86 
87  // TODO: better hierarchy (sublayer multiple feature sets)?
88  // TODO?: results are not consistent for different formats (per band x per sublayer)
89 
91  QMap<int, QVariant> mResults;
92 
94  QMap<QString, QVariant> mParams;
95 
97  QgsError mError;
98 };
99 
100 #endif
101 
102 
QgsRasterIdentifyResult::QgsRasterIdentifyResult
QgsRasterIdentifyResult()=default
Constructor for QgsRasterIdentifyResult.
QgsError
QgsError is container for error messages (report).
Definition: qgserror.h:81
QgsRasterIdentifyResult::isValid
bool isValid() const
Returns true if valid.
Definition: qgsrasteridentifyresult.h:55
QgsRasterIdentifyResult::params
QMap< QString, QVariant > params() const
Gets map of optional parameters.
Definition: qgsrasteridentifyresult.h:72
qgsraster.h
qgserror.h
QgsRasterIdentifyResult::results
QMap< int, QVariant > results() const
Returns the identify results.
Definition: qgsrasteridentifyresult.h:66
QgsRasterIdentifyResult
Raster identify results container.
Definition: qgsrasteridentifyresult.h:31
QgsRasterIdentifyResult::error
QgsError error() const
Returns the last error.
Definition: qgsrasteridentifyresult.h:75
qgis_sip.h
QgsRasterIdentifyResult::~QgsRasterIdentifyResult
virtual ~QgsRasterIdentifyResult()=default
QgsRasterIdentifyResult::setParams
void setParams(const QMap< QString, QVariant > &params)
Sets map of optional parameters.
Definition: qgsrasteridentifyresult.h:69
QgsRasterIdentifyResult::format
QgsRaster::IdentifyFormat format() const
Returns the results format.
Definition: qgsrasteridentifyresult.h:58
QgsRaster::IdentifyFormat
IdentifyFormat
Definition: qgsraster.h:58
QgsRasterIdentifyResult::setError
void setError(const QgsError &error)
Sets the last error.
Definition: qgsrasteridentifyresult.h:78
QgsRaster::IdentifyFormatUndefined
@ IdentifyFormatUndefined
Definition: qgsraster.h:59