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 ***************************************************************************/
25 * @brief Manages data for a globe.
28 #include "tcSrtmModel.h"
36 /** Manages data for a globe.
37 * Holds terrain elevation and imagery data.
58 ElevationSampleAlignment
62 * Constructors + destructor
65 /// Primary constructor.
66 tcGlobe(double meanRadius
);
75 /// Add a dataset to the globe.
76 void addDataSet(tcGeoImageData
* data
);
82 /// Render from the POV of an observer.
83 void render(tcObserver
* const observer
= 0, bool adaptive
= true, const tcGeo
* extent
= 0);
85 /// Set the elevation mode to render in.
86 void setElevationMode(ElevationMode mode
);
88 /// Set the level of correction to show.
89 void setElevationCorrection(float correction
);
91 /// Set the elevation data set name.
92 void setElevationDataSet(const QString
& name
);
94 /// Set colour coding method.
95 void setColourCoding(ColourCoding colourCoding
);
101 /// Get the mean radius.
102 double meanRadius() const;
104 /// Get the altitude above sea level at a sample in a render state.
105 double altitudeAt(const tcSrtmModel::RenderState
& state
, int x
, int y
, tcGeo
* outCoord
, bool* isAccurate
= 0) const;
107 /// Get the altitude above sea level at a coordinate.
108 double altitudeAt(const tcGeo
& coord
, bool* isAccurate
= 0) const;
110 /// Get the radius at a coordinate.
111 double radiusAt(const tcGeo
& coord
) const;
119 /// Draw a line of latitude.
120 void drawLineOfLatitude(double latitude
) const;
123 void renderCell(tcObserver
* const observer
, const tcGeo
& swCorner
, const tcGeo
& neCorner
, int samples
,
124 bool northEdge
= false, bool eastEdge
= false, bool southEdge
= false, bool westEdge
= false) const;
132 /// Mean radius in metres.
136 tcSrtmModel
* m_elevation
;
138 /// List of geo data sets.
139 QList
<tcGeoImageData
*> m_data
;
145 /// Current elevation mode.
146 ElevationMode m_elevationMode
;
148 /// Current level of elevation correction.
149 float m_elevationCorrection
;
151 /// Colour coding method.
152 ColourCoding m_colourCoding
;