Qt Virtual Chart Table (QVCT)
CChartGDALElevation.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 #ifndef QVCT_CCHARTGDALELEVATION_HPP
20 #define QVCT_CCHARTGDALELEVATION_HPP
21 
22 // QT
23 #include <QColor>
24 #include <QPainter>
25 #include <QPixmap>
26 #include <QRect>
27 #include <QString>
28 #include <QVector>
29 
30 // GDAL
31 #include <gdal_priv.h>
32 
33 // QVCT
34 #include "QVCT.hpp"
35 #include "charts/CChartGDAL.hpp"
36 class CDataPosition;
37 
38 
40 
48 {
49 
50  //------------------------------------------------------------------------------
51  // CONSTRUCTORS / DESTRUCTOR
52  //------------------------------------------------------------------------------
53 
54 public:
55  CChartGDALElevation( const QString& _rqsFileName );
56  virtual ~CChartGDALElevation();
57 
58 
59  //------------------------------------------------------------------------------
60  // METHODS: CChartGDAL (implements/override)
61  //------------------------------------------------------------------------------
62 
63 public:
64  CDataPosition toGeoPosition( const QPointF& _rqPointFDatPosition ) const;
65 
66 protected:
67  virtual void rasterBuffer( QImage* _pqImage, const QVector<quint16>& _rqVector ) const;
68  virtual void rasterBuffer( QImage* _pqImage, const QVector<qint16>& _rqVector ) const;
69  virtual void rasterBuffer( QImage* _pqImage, const QVector<quint32>& _rqVector ) const;
70  virtual void rasterBuffer( QImage* _pqImage, const QVector<qint32>& _rqVector ) const;
71  virtual void rasterBuffer( QImage* _pqImage, const QVector<float>& _rqVector ) const;
72  virtual void rasterBuffer( QImage* _pqImage, const QVector<double>& _rqVector ) const;
73 
74 
75  //------------------------------------------------------------------------------
76  // METHODS
77  //------------------------------------------------------------------------------
78 
79  // OTHER
80 public:
82  double getElevation( const QPointF& _rqPointFDatPosition ) const;
84  double getElevation( const CDataPosition& _roGeoPosition ) const;
85 
86 private:
87  uchar rasterValue( double _fdValue ) const;
88  double interpolateValue( double _fdP11, double _fdP21, double _fdP12, double _fdP22, double _fdX, double _fdY ) const;
89 
90 };
91 
92 #endif // QVCT_CCHARTGDALELEVATION_HPP
GDAL-based (elevation) chart.
CChartGDALElevation(const QString &_rqsFileName)
virtual void rasterBuffer(QImage *_pqImage, const QVector< quint16 > &_rqVector) const
Rasterizes UInt16 buffer.
uchar rasterValue(double _fdValue) const
CDataPosition toGeoPosition(const QPointF &_rqPointFDatPosition) const
double interpolateValue(double _fdP11, double _fdP21, double _fdP12, double _fdP22, double _fdX, double _fdY) const
double getElevation(const QPointF &_rqPointFDatPosition) const
Returns the elevation at the given chart pixel position.
Generic GDAL-based dataset.
Definition: CChartGDAL.hpp:53
(Geographical) Position data [long,lat,elev]