QGIS API Documentation  2.99.0-Master (c558d51)
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.h"
22 #include "qgsraster.h"
23 #include "qgserror.h"
24 
28 class CORE_EXPORT QgsRasterIdentifyResult
29 {
30  public:
32 
37  QgsRasterIdentifyResult( QgsRaster::IdentifyFormat theFormat, const QMap<int, QVariant>& theResults );
38 
42  QgsRasterIdentifyResult( const QgsError& theError );
43 
44  virtual ~QgsRasterIdentifyResult();
45 
47  bool isValid() const { return mValid; }
48 
50  QgsRaster::IdentifyFormat format() const { return mFormat; }
51 
57  QMap<int, QVariant> results() const { return mResults; }
58 
60  void setParams( const QMap<QString, QVariant> & theParams ) { mParams = theParams; }
61 
63  QMap<QString, QVariant> params() const { return mParams; }
64 
66  QgsError error() const { return mError; }
67 
69  void setError( const QgsError & theError ) { mError = theError;}
70 
71  private:
73  bool mValid;
74 
77 
79  // TODO: better hierarchy (sublayer multiple feature sets)?
80  // TODO?: results are not consistent for different formats (per band x per sublayer)
81  QMap<int, QVariant> mResults;
82 
84  QMap<QString, QVariant> mParams;
85 
87  QgsError mError;
88 };
89 
90 #endif
91 
92 
void setError(const QgsError &theError)
Set error.
QMap< QString, QVariant > params() const
Get map of optional parameters.
bool isValid() const
Returns true if valid.
IdentifyFormat
Definition: qgsraster.h:71
QMap< int, QVariant > results() const
Get results.
Raster identify results container.
void setParams(const QMap< QString, QVariant > &theParams)
Set map of optional parameters.
QgsRaster::IdentifyFormat format() const
Get results format.
QgsError is container for error messages (report).
Definition: qgserror.h:80
QgsError error() const
Get error.