WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Domain.h
1#ifndef _WINC_DOMAIN
2#define _WINC_DOMAIN
3
4#include <WXP/Const.h>
5#include <WXP/DomainVal.h>
6#include <WXP/EarthPoint.h>
7#include <WXP/EarthPoints.h>
8#include <WXP/GridPoint.h>
9#include <WXP/GridPoints.h>
10#include <WXP/Point.h>
11#include <WXP/Points.h>
12#include <WXP/Rect.h>
13#include <WXP/String.h>
14
15namespace WXP {
16 /*
17 Structure for domain location
18 */
19 class Domain : private DomainVal {
20 Rect limits;
21 Rect view;
22
23 double sat_rad;
24 double sat_rad2;
25 double sat_rad4;
26 double sat2_earth2;
27 double earth_sat_ratio;
28 double earth_ratio;
29 double earth_ratio2;
30 float tlat1;
31 float tlat2;
32 float cx, cy;
33 double xfactor;
34 double mult;
35 double yfactor;
36 double scale;
37
38 public:
39 static double earth_rad;
40 static double earth_maj;
41 static double earth_min;
43 Domain();
44 Domain( const char *str );
45 Domain( DomainVal &val );
46 int init();
47 int set( DomainVal &val );
48 int set( const char *str );
49 int set( EarthPoint &ul, EarthPoint &lr, int rnx, int rny );
50 int set( int rnx, int rny );
51 DomainVal get();
53 inline bool isSet(){ return proj != Const::MISS? true: false; };
54 int setParam();
55 int setLimits();
56 int getLimits( Rect &rect );
58 int setView( Rect &rect );
60 inline int getProj(){ return proj; };
62 inline float getPLat(){ return plat; };
64 inline float getPLon(){ return plon; };
66 inline float getCLat(){ return clat; };
68 inline float getCLon(){ return clon; };
70 inline int getNx(){ return nx; };
72 inline int getNy(){ return ny; };
74 inline float getDx(){ return dx; };
76 inline float getDy(){ return dy; };
78 inline float getParam( int i ){ return i >= 0 && i < 5 ? param[i]: Const::MISS; };
79 int tranCenter( Point &pt );
80 float getAspect();
81 int tran( EarthPoint &ept, Point &pt );
82 int tran( Point &pt, EarthPoint &ept );
83 int tran( GridPoint &gpt, Point &pt );
84 int tran( Point &pt, GridPoint &gpt );
85 int tran( EarthPoint &ept, GridPoint &gpt );
86 int tran( GridPoint &gpt, EarthPoint &ept );
87 int tran( EarthPoints &epts, Points &pts );
88 int tran( EarthPoints &epts, GridPoints &gpts );
89
91 enum TranLocate {
96 CENTER
97 };
98 int tran( int w, EarthPoint &ept );
99 int tran( int w, GridPoint &gpt );
100 int tran( int w, Point &pt );
101
102 bool within( Point &pt );
103 bool within( EarthPoint &ept );
104 bool withinExt( Point &pt, int ext );
105 bool withinExt( EarthPoint &ept, int ext );
106 int where( Point &pt );
107 int where( EarthPoint &ept );
108 int scaleSize( int width, int height );
109 int scaleGrid( float scale );
110 int zoom( Point &pt, float zfac );
111 int pan( Point &pt );
112 int adjust( Point &pt );
113 int adjust( Points &pts );
114 float adjustDir( float dir, Point &pt );
115 float adjustDir( float dir, EarthPoint &ept );
116 float unadjustDir( float dir, Point &pt );
117 float unadjustDir( float dir, EarthPoint &ept );
118 int offset( Point &pt, float dir, float rad, Point &opt );
119 float direct( Point &pt1, Point &pt2 );
120 float getVert();
121 float getMapFactor( EarthPoint &ept );
122 int wrapLine( Point &pt1, Point &pt2 );
123 int wrapLine( Points &pts );
124 int offsetLine( Point &pt1, Point &pt2, int flag );
125 int offsetLine( Points &pts, int flag );
126 int toString( String &string );
127 int print();
128 int printLimits();
129
131 inline int isProj( int p ){ return p == proj; };
133 inline int isMap(){ return isMap( proj ); };
135 inline int isTherm(){ return isTherm( proj ); };
137 inline int isCoord(){ return isCoord( proj ); };
139 inline int isPolar(){ return isPolar( proj ); };
140
141 static int getProj( const char *proj );
142 static bool compare( Domain &dom1, Domain &dom2 );
143 static bool compareProj( Domain &dom1, Domain &dom2 );
144 static int translate( Domain &dom1, Domain &dom2, Point &pt1, Point &pt2 );
145 static int translate( Domain &dom1, Domain &dom2, GridPoint &gpt1, GridPoint &gpt2 );
146 static float calcEarthDist( EarthPoint &ept1, EarthPoint &ept2 );
147 static int offsetLatLon( EarthPoint &ept, float dir, float rad, EarthPoint &opt );
148
149 static const int PSTEREO = DomainVal::PSTEREO;
150 static const int LATLON = DomainVal::LATLON;
151 static const int MERC = DomainVal::MERC;
152 static const int LAMB = DomainVal::LAMB;
153 static const int ORTHO = DomainVal::ORTHO;
154 static const int GNOM = DomainVal::GNOM;
155 static const int MOLL = DomainVal::MOLL;
156 static const int LAMBAZ = DomainVal::LAMBAZ;
157 static const int ALBERS = DomainVal::ALBERS;
158 static const int SAT = DomainVal::SAT;
159 static const int RADIAL = DomainVal::RADIAL;
160 static const int PIXEL = DomainVal::PIXEL;
161 static const int XY = DomainVal::XY;
162 static const int XZ = DomainVal::XZ;
163 static const int XP = DomainVal::XP;
164 static const int XLOGP = DomainVal::XLOGP;
165 static const int POLAR = DomainVal::POLAR;
166 static const int CAT = DomainVal::CAT;
167 static const int SKEWT = DomainVal::SKEWT;
168 static const int STUVE = DomainVal::STUVE;
169 static const int EMA = DomainVal::EMA;
170 static const int TEPH = DomainVal::TEPH;
171 static const int RTEPH = DomainVal::RTEPH;
172 static const int ZOOM = DomainVal::ZOOM;
173 static const int SIZE = DomainVal::SIZE;
176 static inline bool isMap( int a ){ return (a >= PSTEREO && a <= SAT);}
178 static inline bool isTherm( int a ){ return (a >= SKEWT && a <= RTEPH);}
180 static inline bool isCoord( int a ){ return (a >= PIXEL && a <= CAT);}
182 static inline bool isPolar( int a ){ return (a == POLAR);}
183
184 static float OFFSET_LL;
185 static float OFFSET_MERC;
186 };
187}
188#endif
static const int MISS
Definition Const.h:7
This class stores and manipulates domain data.
Definition Domain.h:19
int print()
Definition Domain.cc:2035
int isTherm()
Definition Domain.h:135
static bool isCoord(int a)
Definition Domain.h:180
int offsetLine(Point &pt1, Point &pt2, int flag)
Definition Domain.cc:1932
static bool compare(Domain &dom1, Domain &dom2)
Definition Domain.cc:305
int getNy()
Definition Domain.h:72
int tran(EarthPoint &ept, Point &pt)
Definition Domain.cc:440
int zoom(Point &pt, float zfac)
Definition Domain.cc:1736
static const int RTEPH
Definition Domain.h:171
int tranCenter(Point &pt)
Definition Domain.cc:422
Rect getLimits()
Definition Domain.cc:409
float getPLon()
Definition Domain.h:64
static float calcEarthDist(EarthPoint &ept1, EarthPoint &ept2)
Definition Domain.cc:1849
int offset(Point &pt, float dir, float rad, Point &opt)
Definition Domain.cc:1768
int isCoord()
Definition Domain.h:137
static const int STUVE
Definition Domain.h:168
static double earth_min
Definition Domain.h:41
int pan(Point &pt)
Definition Domain.cc:1752
bool withinExt(Point &pt, int ext)
Definition Domain.cc:1407
static const int XP
Definition Domain.h:163
static bool isTherm(int a)
Definition Domain.h:178
static const int POLAR
Definition Domain.h:165
int set(DomainVal &val)
Definition Domain.cc:83
int init()
Definition Domain.cc:34
int getProj()
Definition Domain.h:60
static bool isPolar(int a)
Definition Domain.h:182
float getVert()
Definition Domain.cc:1798
int wrapLine(Point &pt1, Point &pt2)
Definition Domain.cc:1861
static const int XZ
Definition Domain.h:162
static bool isMap(int a)
Definition Domain.h:176
static const int LAMB
Definition Domain.h:152
float getCLat()
Definition Domain.h:66
static const int ORTHO
Definition Domain.h:153
static const int SAT
Definition Domain.h:158
int scaleSize(int width, int height)
Definition Domain.cc:1684
Domain()
Definition Domain.cc:57
int setParam()
Definition Domain.cc:322
int scaleGrid(float scale)
Definition Domain.cc:1713
float getParam(int i)
Definition Domain.h:78
static const int ZOOM
Definition Domain.h:172
int getNx()
Definition Domain.h:70
DomainVal get()
Definition Domain.cc:277
float getMapFactor(EarthPoint &ept)
Definition Domain.cc:1830
bool isSet()
Definition Domain.h:53
static const int ALBERS
Definition Domain.h:157
static const int RADIAL
Definition Domain.h:159
float adjustDir(float dir, Point &pt)
Definition Domain.cc:1562
int printLimits()
Definition Domain.cc:2087
static const int MOLL
Definition Domain.h:155
static double earth_maj
Definition Domain.h:40
int isMap()
Definition Domain.h:133
static double earth_rad
Definition Domain.h:39
static float OFFSET_MERC
Definition Domain.h:185
static const int SIZE
Definition Domain.h:173
float getAspect()
Definition Domain.cc:431
static int translate(Domain &dom1, Domain &dom2, Point &pt1, Point &pt2)
Definition Domain.cc:1466
int setLimits()
Definition Domain.cc:374
static const int XY
Definition Domain.h:161
static const int LAMBAZ
Definition Domain.h:156
static const int TEPH
Definition Domain.h:170
static int offsetLatLon(EarthPoint &ept, float dir, float rad, EarthPoint &opt)
Definition Domain.cc:1784
int adjust(Point &pt)
Definition Domain.cc:1511
static const int GNOM
Definition Domain.h:154
float getPLat()
Definition Domain.h:62
static const int CAT
Definition Domain.h:166
static const int XLOGP
Definition Domain.h:164
int isProj(int p)
Definition Domain.h:131
float getDx()
Definition Domain.h:74
float getDy()
Definition Domain.h:76
static float OFFSET_LL
Definition Domain.h:184
float direct(Point &pt1, Point &pt2)
Definition Domain.cc:1809
TranLocate
Definition Domain.h:91
@ LL
Definition Domain.h:94
@ UL
Definition Domain.h:92
@ LR
Definition Domain.h:95
@ UR
Definition Domain.h:93
@ CENTER
Definition Domain.h:96
float getCLon()
Definition Domain.h:68
float unadjustDir(float dir, Point &pt)
Definition Domain.cc:1632
static const int MERC
Definition Domain.h:151
static const int PIXEL
Definition Domain.h:160
int isPolar()
Definition Domain.h:139
static const int SKEWT
Definition Domain.h:167
int where(Point &pt)
Definition Domain.cc:1435
static bool compareProj(Domain &dom1, Domain &dom2)
Definition Domain.cc:315
static const int LATLON
Definition Domain.h:150
static const int EMA
Definition Domain.h:169
int toString(String &string)
Definition Domain.cc:1983
static const int PSTEREO
Definition Domain.h:149
bool within(Point &pt)
Definition Domain.cc:1381
This class creates an array a earth points (lat, lon)
Definition EarthPoints.h:9
This class creates an array a 2D points (x, y)
Definition GridPoints.h:9
This class creates an array a 2D points (x, y)
Definition Points.h:8
This is a variable length string class.
Definition String.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct defines basic domain parameters.
Definition DomainVal.h:5
static const int ZOOM
Definition DomainVal.h:50
float dy
Definition DomainVal.h:13
float clat
Definition DomainVal.h:10
static const int SKEWT
Definition DomainVal.h:45
static const int RADIAL
Definition DomainVal.h:37
float param[5]
Definition DomainVal.h:9
static const int CAT
Definition DomainVal.h:44
static const int XY
Definition DomainVal.h:39
static const int PSTEREO
Definition DomainVal.h:27
static const int XZ
Definition DomainVal.h:40
static const int XP
Definition DomainVal.h:41
static const int LATLON
Definition DomainVal.h:28
static const int SAT
Definition DomainVal.h:36
float clon
Definition DomainVal.h:11
float dx
Definition DomainVal.h:12
int proj
Definition DomainVal.h:6
float plon
Definition DomainVal.h:8
static const int XLOGP
Definition DomainVal.h:42
static const int MOLL
Definition DomainVal.h:33
static const int SIZE
Definition DomainVal.h:51
int ny
Definition DomainVal.h:15
static const int LAMB
Definition DomainVal.h:30
static const int STUVE
Definition DomainVal.h:46
float plat
Definition DomainVal.h:7
int nx
Definition DomainVal.h:14
static const int ORTHO
Definition DomainVal.h:31
static const int RTEPH
Definition DomainVal.h:49
static const int ALBERS
Definition DomainVal.h:35
static const int MERC
Definition DomainVal.h:29
static const int PIXEL
Definition DomainVal.h:38
static const int TEPH
Definition DomainVal.h:48
static const int LAMBAZ
Definition DomainVal.h:34
static const int EMA
Definition DomainVal.h:47
static const int GNOM
Definition DomainVal.h:32
static const int POLAR
Definition DomainVal.h:43
This struct defines earth point values (lat, lon, elev)
Definition EarthPoint.h:5
This struct defines basic gridpoint values.
Definition GridPoint.h:5
This struct sets a 3D point (x, y, z)
Definition Point.h:5
This structure defines rectangle coordinates.
Definition Rect.h:5