1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
5 * Tecorrec is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * Tecorrec is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with Tecorrec. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _tcSrtmModel_h_
21 #define _tcSrtmModel_h_
25 * @brief SRTM elevation model.
37 /// SRTM elevation model.
38 class tcSrtmModel
: public QObject
53 /// Number of longitudenal samples in the tile.
56 /// Number of latitudenal samples in the tile.
59 /// Is there more detail available longitudely.
60 bool moreAvailableLon
;
62 /// Is there more detail available latitudely
63 bool moreAvailableLat
;
66 friend class tcSrtmModel
;
68 /// South west corner of tile.
71 /// North east corner of tile.
74 /// Coordinate of most south westly sample inside tile.
77 /// Diagonal angles between samples.
82 * Constructors + destructor
85 /// Default constructor.
89 virtual ~tcSrtmModel();
95 /** Get information to allow alignment with actual samples.
96 * @param swCorner South West corner of tile.
97 * @param neCorner North East corner of tile.
98 * @param state[out] Gets various information put into it to allow optimized rendering.
99 * @param maxSamples Maximum number of inner samples.
101 void sampleAlign(const tcGeo
& swCorner
, const tcGeo
& neCorner
, RenderState
* state
, int maxSamples
= 0);
103 /// Get the altitude at a sample in a render state.
104 double altitudeAt(const RenderState
& state
, int x
, int y
, tcGeo
* outCoord
, bool corrected
= false, bool* accurate
= 0);
106 /// Get the altitude at a coordinate.
107 double altitudeAt(const tcGeo
& coord
, bool corrected
= false, bool* accurate
= 0);
109 /// Get the normal at a coordinate.
110 maths::Vector
<3,float> normalAt(const tcGeo
& coord
, bool corrected
= false, bool* accurate
= 0);
112 /// Use raytracing to find whether a point is lit.
113 bool isLitAt(const tcGeo
& coord
, const maths::Vector
<3,float>& light
, bool corrected
= false, bool* accurate
= 0);
115 /// Use raytracing to find how lit a point is.
116 float litAt(const tcGeo
& coord
, const maths::Vector
<3,float>& light
, float angularRadius
= 0.0f
, bool corrected
= false, bool* accurate
= 0);
118 /// Set the data set to use.
119 void setDataSet(const QString
& name
);
127 /// Emitted when the dataset is changed.
128 void dataSetChanged();
130 /// Progress notifier.
131 void progressing(const QString
& progress
);
140 tcSrtmCache
* m_cache
;