Added gui options for wireframe, and colour coding
[tecorrec.git] / geo / tcSrtmModel.h
blob4c64d9d39cb3b5c1105e8bdfd22a4d58805e5409
1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
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. *
9 * *
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. *
14 * *
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_
23 /**
24 * @file tcSrtmModel.h
25 * @brief SRTM elevation model.
28 #include "tcGeo.h"
30 class tcSrtmCache;
32 class QString;
34 /// SRTM elevation model.
35 class tcSrtmModel
37 public:
40 * Types
43 /// Render state.
44 class RenderState
46 public:
48 /// Number of longitudenal samples in the tile.
49 int samplesLon;
51 /// Number of latitudenal samples in the tile.
52 int samplesLat;
54 /// Is there more detail available longitudely.
55 bool moreAvailableLon;
57 /// Is there more detail available latitudely
58 bool moreAvailableLat;
60 private:
61 friend class tcSrtmModel;
63 /// South west corner of tile.
64 tcGeo swCorner;
66 /// North east corner of tile.
67 tcGeo neCorner;
69 /// Coordinate of most south westly sample inside tile.
70 tcGeo swSample;
72 /// Diagonal angles between samples.
73 tcGeo sampleDelta;
77 * Constructors + destructor
80 /// Default constructor.
81 tcSrtmModel();
83 /// Destructor.
84 virtual ~tcSrtmModel();
87 * Main interface
90 /** Get information to allow alignment with actual samples.
91 * @param swCorner South West corner of tile.
92 * @param neCorner North East corner of tile.
93 * @param state[out] Gets various information put into it to allow optimized rendering.
94 * @param maxSamples Maximum number of inner samples.
96 void sampleAlign(const tcGeo& swCorner, const tcGeo& neCorner, RenderState* state, int maxSamples = 0);
98 /// Get the altitude at a sample in a render state.
99 double altitudeAt(const RenderState& state, int x, int y, tcGeo* outCoord, bool corrected = false, bool* accurate = 0);
101 /// Get the altitude at a coordinate.
102 double altitudeAt(const tcGeo& coord, bool corrected = false, bool* accurate = 0);
104 /// Set the data set to use.
105 void setDataSet(const QString& name);
107 private:
110 * Variables
113 /// SRTM cache.
114 tcSrtmCache* m_cache;
118 #endif