Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbProj4Projection.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : G.TALLEC (May 2007)
22**=======================================================================*/
23
24#ifndef _SB_PROJ4PROJECTION_
25#define _SB_PROJ4PROJECTION_
26
28#include <Inventor/SbLinear.h>
29
30// WARNING: dumb workaround for symbol conflict with winreg.h on Win32
31#define PVALUE PROJ_PVALUE
32
33#define PROJECTION_PARAM_ID 0
34#define ELLIPSOID_PARAM_ID 1
35#define UTM_ZONE 2
36#define UTM_SOUTH 3
37
38class SoProjection;
39
98{
99
100public:
101
111
116 {
117 SPHERE = 0, // Normal Sphere (r=6370997)
118 AIRY , // Airy 183
119 AIRYM , // Modified Airy
120 ANDRAE , // Andrae 1876 (Den., Iclnd.)
121 APL , // Appl. Physics. 1965
122 AUST_SA , // Australian Natl & S. Amer. 1969
123 BESSEL , // Bessel 1841
124 BESS_NAM , // Bessel 1841 (Namibia)
125 CLRK66 , // Clarke 1866
126 CLRK80 , // Clarke 1880
127 CPM , // Comm. des Poids et Mesures 1799
128 DELMBR , // Delambre 1810 (Belgium)
129 ENGELIS , // Engelis 1985
130 EVRST30 , // Everest 1830
131 EVRST48 , // Everest 1948
132 EVRST56 , // Everest 1956
133 EVRST69 , // Everest 1969
134 EVRSTSS , // Everest (Sabah & Sarawak)
135 FSCHR60 , // Fischer (Mercury Datum) 1960
136 FSCHR60M , // Modified Fischer 1960
137 FSCHR68 , // Fischer 1968
138 GRS67 , // GRS 67(IUGG 1967)
139 GRS80 , // GRS 1980(IUGG, 1980
140 HELMERT , // Helmert 1906
141 HOUGH , // Hough
142 IAU76 , // IAU 1976
143 INTL , // International 1909 (Hayford)
144 KAULA , // Kaula 1961
145 KRASS , // Krassovsky, 1942
146 LERCH , // Lerch 1979
147 MERIT , // MERIT 1983
148 MPRTS , // Maupertius 1738
149 NEW_INTL , // New International 1967
150 NWL9D , // Naval Weapons Lab., 1965
151 PLESSIS , // Plessis 1817 (France)
152 SE_ASIA , // Southeast Asia
153 SGS85 , // Soviet Geodetic System 85
154 WALBECK , // Walbeck
155 WGS60 , // WGS 60
156 WGS66 , // WGS 66
157 WGS72 , // WGS 72
158 WGS84 , // WGS 84
160 };
161
166 {
167 CASSINI, // Cassini
168 EQUAL_AREA_CYLINDRICAL, //Equal Area Cylindrical
169 COLLIGNON, //Collignon
170 CRASTER_PARABOLIC, //Craster Parabolic (Putnins P4)
171 ECKERT_I, //Eckert I
172 ECKERT_II, //Eckert II
173 ECKERT_III, //Eckert III
174 ECKERT_IV, //Eckert IV
175 ECKERT_V, //Eckert V
176 ECKERT_VI, //Eckert VI
177 EQUIDISTANT_CYLINDRICAL, //Equidistant Cylindrical (Plate Caree)
178 FAHEY, //Fahey
179 FOUCAUT_SINUSOIDAL, //Foucaut Sinusoidal
180 GALL, //Gall (Gall Stereographic)
181 GEOCENTRIC_PROJ, //Geocentric
182 HATANO_ASYMMETRICAL_EQUAL_AREA, //Hatano Asymmetrical Equal Area
183 KAVRAISKY_VII, //Kavraisky VII
184 KROVAK, //Krovak
185 LAMBERT_AZIMUTHAL_EQUAL_AREA, //Lambert Azimuthal Equal Area
186 LAT_LONG , //Lat/long (Geodetic)
187 LONG_LAT , //Long/lat (Geodetic)
188 LAMBERT_EQUAL_AREA_CONIC, //Lambert Equal Area Conic
189 LOXIMUTHAL, //Loximuthal
190 MCBRYDE_THOMAS_FLAT_POLE_SINE, //McBryde-Thomas Flat-Pole Sine (No. 2)
191 MCBRYDE_THOMAS_FLAT_POLAR_PARABOLIC, //McBride-Thomas Flat-Polar Parabolic
192 MCBRYDE_THOMAS_FLAT_POLAR_QUARTIC, //McBryde-Thomas Flat-Polar Quartic
193 MCBRYDE_THOMAS_FLAT_POLAR_SINUSOIDAL, //McBryde-Thomas Flat-Polar Sinusoidal
194 MERCATOR, //Mercator
195 MILLER_CYLINDRICAL, //Miller Cylindrical
196 MOLLWEIDE, //Mollweide
197 NELL, //Nell
198 NELL_HAMMER, //Nell-Hammer
199 OBLIQUE_CYLINDRICAL_EQUAL_AREA, //Oblique Cylindrical Equal Area
200 POLYCONIC, //Polyconic (American)
201 PUTNINS_P1, //Putnins P1
202 PUTNINS_P2, //Putnins P2
203 PUTNINS_P3_2, //Putnins P3'
204 PUTNINS_P4_2, //Putnins P4'
205 PUTNINS_P5, //Putnins P5
206 PUTNINS_P5_2, //Putnins P5'
207 PUTNINS_P6, //Putnins P6
208 PUTNINS_P6_2, //Putnins P6'
209 ROBINSON, //Robinson
210 SINUSOIDAL, //Sinusoidal (Sanson-Flamsteed)
211 SWISS_OBL_MERCATOR, //Swiss. Obl. Mercator
212 OBLIQUE_STEREOGRAPHIC_ALTERNATIVE, //Oblique Stereographic Alternative
213 TRANSVERSE_CYLINDRICAL_EQUAL_AREA, //Transverse Cylindrical Equal Area
214 TRANSVERSE_MERCATOR, //Transverse Mercator
215 UNIVERSAL_POLAR_STEREOGRAPHIC, //Universal Polar Stereographic
216 UNIVERSAL_TRANSVERSE_MERCATOR, //Universal Transverse Mercator (UTM)
217 VAN_DER_GRINTEN_I, //van der Grinten (I)
218 WAGNER_I, //Wagner I (Kavraisky VI)
219 WAGNER_II, //Wagner II
220 WAGNER_III, //Wagner III
221 WAGNER_IV, //Wagner IV
222 WAGNER_V, //Wagner V
223 WAGNER_VI, //Wagner VI
224 WERENSKIOLD_I, //Werenskiold I
225 WINKEL_I, //Winkel I
226 WINKEL_TRIPEL, //Winkel Tripel
228 };
229
234
239
244
249
254
259
264
269
274
279
284
289
294
299
304
308 void setUTMZone( int zone );
309
314
318 void setUTMSouth( bool south );
319
324
328 void setRevertCoord( bool revertCoordNeeded ) { m_revertCoordNeeded = revertCoordNeeded; };
329
333 bool isRevertCoordNeeded() { return m_revertCoordNeeded; };
334
339
344
348 virtual void init();
349
353 virtual void exit();
354
358 virtual void inverse( SbVec3f &point );
359
363 void toGeodetic( SbVec3f &point );
364
368 void toGeocentric( SbVec3f &point );
369
374 virtual void apply( SbVec3f &point );
375
376 private:
377
378 //Special case for lon_0 parameter
379 virtual void internalSetParameter( int parameterId, const SbString &parameterString, SbBool notifyNode = TRUE, SbBool callInit = TRUE);
380
381 // just here to avoid warning on SUN
382 virtual void internalSetParameter( int parameterId, const float &parameterString, SbBool notifyNode = TRUE, SbBool callInit = TRUE)
383 { SbProjection::internalSetParameter( parameterId, parameterString, notifyNode , callInit ); }
384
385private:
386
387 void internalInit();
388
392 void initProj4Params();
393
394 // ellipsoid
396
397 // ellipsoid
399
400 // CoordinateSystem
401 SbProj4Projection::CoordinateSystem m_coordinateSystem;
402
403 // hint about first initialisation
404 bool m_firstInit;
405
406 // lon_0 if set to workaround linux Proj4 crash
407 // lon_0 is not sent to Proj4, but auto computed in project() function
408 double m_lon0;
409
410 // zone (UTM)
411 int m_zone;
412
413 // south hemisphere (UTM)
414 bool m_south;
415
416 bool m_revertCoordNeeded;
417
418 // number of internal projection
419 int m_numProjections;
420
421 //Current proj id
422 int m_projID;
423
424 //Current proj in id
425 int m_projInID;
426
427 // type of projection
428 void *m_projType;
429
430 // type of projection
431 void *m_projTypeIn;
432};
433
434#endif /* _SB_PROJ4PROJECTION_ */
435
#define SoEXTENDER_Documented
#define TRUE
Possible value of SbBool.
Definition SbBase.h:77
Cartographic (PROJ4) projection class.
bool isUTMSouth()
Get m_south (UTM)
SbProj4Projection::PredefinedEllipsoid getEllipsoidIn()
Get current input ellipsoid.
SbProj4Projection::CoordinateSystem getCoordinateSystem()
Get current coordinate system.
void toGeocentric(SbVec3f &point)
Transform the given coordinates from Geodetic coordinate system to Geocentric coordinate system .
CoordinateSystem
Available coordinate systems.
void setUTMZone(int zone)
Set current UTM zone.
PredefinedEllipsoid
Available ellipsoids.
virtual void exit()
Exit function.
SbProj4Projection(const SbProj4Projection &proj)
Copy constructor.
SbProj4Projection::Projection getProjection()
Get current projection .
SbProj4Projection(SoProjection *node)
Constructor.
void setProjection(SbProj4Projection::Projection proj)
Set current projection.
void setEllipsoid(SbProj4Projection::PredefinedEllipsoid ellipsoid)
Set current ellipsoid.
void setCoordinateSystem(SbProj4Projection::CoordinateSystem coordinateSystem)
Set current coordinate system.
void setRevertCoord(bool revertCoordNeeded)
Set revertCoordNeeded.
SbProj4Projection::Projection getProjectionIn()
Get current input projection .
static SbString getProjectionName(SbProj4Projection::Projection proj)
Get projection name description.
void setUTMSouth(bool south)
Set m_south (UTM)
bool isRevertCoordNeeded()
Get revertCoordNeeded.
void setProjectionIn(SbProj4Projection::Projection proj)
Set current input projection.
virtual void inverse(SbVec3f &point)
Inverse projection of one point.
Projection
Available projections.
virtual ~SbProj4Projection()
Destructor.
int getUTMZone()
Get current UTM zone.
SbProj4Projection()
Constructor.
SbProj4Projection::PredefinedEllipsoid getEllipsoid()
Get current ellipsoid.
static SbString getProjectionString(SbProj4Projection::Projection proj)
Get internal PROJ.4 projection string.
void setEllipsoidIn(SbProj4Projection::PredefinedEllipsoid ellipsoid)
Set current input ellipsoid.
static SbString getEllipsoidString(SbProj4Projection::PredefinedEllipsoid ellipsoid)
Get PROJ.4 ellipsoid string.
void toGeodetic(SbVec3f &point)
Transform the given coordinates from Geocentric coordinate system to Geodetic coordinate system .
virtual void init()
Initialisation.
Base class for coordinate projection classes.
Class for smart character strings.
Definition SbString.h:202
3D vector class.
Definition SbVec.h:932
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Coordinate proje...
int SbBool
Boolean type.
Definition SbBase.h:87