00001
00002
00003 #include <string.h>
00004 #include "UTMCoordinates.h"
00005
00006
00007 using namespace MSP::CCS;
00008
00009
00010 UTMCoordinates::UTMCoordinates() :
00011 CoordinateTuple( CoordinateType::universalTransverseMercator ),
00012 _zone( 32 ),
00013 _hemisphere( 'N' ),
00014 _easting( 0 ),
00015 _northing( 0 )
00016 {
00017 }
00018
00019
00020 UTMCoordinates::UTMCoordinates( CoordinateType::Enum _coordinateType ) :
00021 CoordinateTuple( _coordinateType ),
00022 _zone( 32 ),
00023 _hemisphere( 'N' ),
00024 _easting( 0 ),
00025 _northing( 0 )
00026 {
00027 }
00028
00029
00030 UTMCoordinates::UTMCoordinates( CoordinateType::Enum _coordinateType, long __zone, char __hemisphere, double __easting, double __northing ) :
00031 CoordinateTuple( _coordinateType ),
00032 _zone( __zone ),
00033 _hemisphere( __hemisphere ),
00034 _easting( __easting ),
00035 _northing( __northing )
00036 {
00037 }
00038
00039
00040 UTMCoordinates::UTMCoordinates( CoordinateType::Enum _coordinateType, const char* __warningMessage, long __zone, char __hemisphere, double __easting, double __northing ) :
00041 CoordinateTuple( _coordinateType ),
00042 _zone( __zone ),
00043 _hemisphere( __hemisphere ),
00044 _easting( __easting ),
00045 _northing( __northing )
00046 {
00047 int length = strlen( __warningMessage );
00048 strncpy( _warningMessage, __warningMessage, length );
00049 _warningMessage[ length ] = '\0';
00050 }
00051
00052
00053 UTMCoordinates::UTMCoordinates( const UTMCoordinates &c )
00054 {
00055 _coordinateType = c._coordinateType;
00056
00057 _zone = c._zone;
00058 _hemisphere = c._hemisphere;
00059 _easting = c._easting;
00060 _northing = c._northing;
00061
00062 int length = strlen( c._warningMessage );
00063 strncpy( _warningMessage, c._warningMessage, length );
00064 _warningMessage[ length ] = '\0';
00065 }
00066
00067
00068 UTMCoordinates::~UTMCoordinates()
00069 {
00070 }
00071
00072
00073 UTMCoordinates& UTMCoordinates::operator=( const UTMCoordinates &c )
00074 {
00075 if( this != &c )
00076 {
00077 _coordinateType = c._coordinateType;
00078
00079 _zone = c._zone;
00080 _hemisphere = c._hemisphere;
00081 _easting = c._easting;
00082 _northing = c._northing;
00083
00084 int length = strlen( c._warningMessage );
00085 strncpy( _warningMessage, c._warningMessage, length );
00086 _warningMessage[ length ] = '\0';
00087 }
00088
00089 return *this;
00090 }
00091
00092
00093 void UTMCoordinates::set( long __zone, char __hemisphere, double __easting, double __northing )
00094 {
00095 _zone = __zone;
00096 _hemisphere = __hemisphere;
00097 _easting = __easting;
00098 _northing = __northing;
00099 }
00100
00101
00102 void UTMCoordinates::setZone( long __zone )
00103 {
00104 _zone = __zone;
00105 }
00106
00107
00108 long UTMCoordinates::zone() const
00109 {
00110 return _zone;
00111 }
00112
00113
00114 void UTMCoordinates::setHemisphere( char __hemisphere )
00115 {
00116 _hemisphere = __hemisphere;
00117 }
00118
00119
00120 char UTMCoordinates::hemisphere() const
00121 {
00122 return _hemisphere;
00123 }
00124
00125
00126 void UTMCoordinates::setEasting( double __easting )
00127 {
00128 _easting = __easting;
00129 }
00130
00131
00132 double UTMCoordinates::easting() const
00133 {
00134 return _easting;
00135 }
00136
00137
00138 void UTMCoordinates::setNorthing( double __northing )
00139 {
00140 _northing = __northing;
00141 }
00142
00143
00144 double UTMCoordinates::northing() const
00145 {
00146 return _northing;
00147 }
00148
00149