QGIS API Documentation  3.6.0-Noosa (5873452)
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 
37  QgsRasterIdentifyResult() = default;
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 
88  // TODO: better hierarchy (sublayer multiple feature sets)?
89  // TODO?: results are not consistent for different formats (per band x per sublayer)
90  QMap<int, QVariant> mResults;
91 
93  QMap<QString, QVariant> mParams;
94 
96  QgsError mError;
97 };
98 
99 #endif
100 
101 
IdentifyFormat
Definition: qgsraster.h:57
void setParams(const QMap< QString, QVariant > &params)
Sets map of optional parameters.
Raster identify results container.
bool isValid() const
Returns true if valid.
QMap< int, QVariant > results() const
Returns the identify results.
QgsRaster::IdentifyFormat format() const
Returns the results format.
QgsError is container for error messages (report).
Definition: qgserror.h:80
QgsError error() const
Returns the last error.
void setError(const QgsError &error)
Sets the last error.
QMap< QString, QVariant > params() const
Gets map of optional parameters.