source: subversion/applications/editors/osm-editor/qt3/SRTMDataGrid.h @ 16590

Last change on this file since 16590 was 1158, checked in by nick, 13 years ago

moved current version to qt3 directory in preparation for qt4

File size: 2.1 KB
Line 
1/*
2    Copyright (C) 2005 Nick Whitelegg, Hogweed Software, nick@hogweed.org
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU Lesser General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
17
18 */
19#ifndef SRTMDATAGRID_H
20#define SRTMDATAGRID_H
21
22#include "SRTMGeneral.h"
23
24namespace OpenStreetMap
25{
26
27struct SRTM_SAMPLE_POINT
28{
29        double hgt;
30        ScreenPos screenPos;
31};
32
33class SRTMDataGrid
34{
35private:
36        int samplewidth, sampleheight;
37        SRTM_SAMPLE_POINT *points;
38
39        int pt;
40        int edges[4][2];
41        int f;
42        static void addContour
43                (LINE *lines,LINE line,int edge1,int edge2,int *prevedges,int *go,
44                int *n_lines);
45        static void getHgtFilename(char *filename,EarthPoint&);
46        Colour doGetHeightShading(double ht,double shadingres);
47
48public:
49        SRTMDataGrid(LATLON_TILE **rects,int w, int h, Map& map, int f);
50        ~SRTMDataGrid();
51        void doLoad(LATLON_TILE *rect,Map& map,int index);
52        void setPoint (int row,int col);
53        int getPoint (){return pt; }
54        double startHeight(int interval);
55        double endHeight(int interval);
56        void getLine(LINE *lines,int *n_lines, int ht);
57        int hgtptDistance(vector<int>& prevs);
58        int getHeight() { return sampleheight; }
59        int getWidth() { return samplewidth; }
60        Colour getHeightShading (double shadingres);
61        ScreenPos getTopLeft() { return points[pt].screenPos; }
62        ScreenPos getTopRight() { return points[pt+f].screenPos; }
63        ScreenPos getBottomLeft() { return points[pt+samplewidth*f].screenPos; }
64        ScreenPos getBottomRight() { return points[pt+samplewidth*f+f].screenPos; }
65};
66
67}
68
69#endif
Note: See TracBrowser for help on using the repository browser.