00001
00002
00003 #include <string.h>
00004 #include "GeodeticCoordinates.h"
00005
00006
00007 using namespace MSP::CCS;
00008
00009
00010 GeodeticCoordinates::GeodeticCoordinates() :
00011 CoordinateTuple( CoordinateType::geodetic ),
00012 _longitude( 0 ),
00013 _latitude( 0 ),
00014 _height( 0 )
00015 {
00016 }
00017
00018
00019 GeodeticCoordinates::GeodeticCoordinates( CoordinateType::Enum _coordinateType ) :
00020 CoordinateTuple( _coordinateType ),
00021 _longitude( 0 ),
00022 _latitude( 0 ),
00023 _height( 0 )
00024 {
00025 }
00026
00027
00028 GeodeticCoordinates::GeodeticCoordinates( CoordinateType::Enum _coordinateType, double __longitude, double __latitude, double __height ) :
00029 CoordinateTuple( _coordinateType ),
00030 _longitude( __longitude ),
00031 _latitude( __latitude ),
00032 _height( __height )
00033 {
00034 }
00035
00036
00037 GeodeticCoordinates::GeodeticCoordinates( CoordinateType::Enum _coordinateType, const char* __warningMessage, double __longitude, double __latitude, double __height ) :
00038 CoordinateTuple( _coordinateType ),
00039 _longitude( __longitude ),
00040 _latitude( __latitude ),
00041 _height( __height )
00042 {
00043 int length = strlen( __warningMessage );
00044 strncpy( _warningMessage, __warningMessage, length );
00045 _warningMessage[ length ] = '\0';
00046 }
00047
00048
00049 GeodeticCoordinates::GeodeticCoordinates( const GeodeticCoordinates &gc )
00050 {
00051 _coordinateType = gc._coordinateType;
00052
00053 _longitude = gc._longitude;
00054 _latitude = gc._latitude;
00055 _height = gc._height;
00056
00057 int length = strlen( gc._warningMessage );
00058 strncpy( _warningMessage, gc._warningMessage, length );
00059 _warningMessage[ length ] = '\0';
00060 }
00061
00062
00063 GeodeticCoordinates::~GeodeticCoordinates()
00064 {
00065 _longitude = 0;
00066 _latitude = 0;
00067 _height = 0;
00068 }
00069
00070
00071 GeodeticCoordinates& GeodeticCoordinates::operator=( const GeodeticCoordinates &gc )
00072 {
00073 if( this != &gc )
00074 {
00075 _coordinateType = gc._coordinateType;
00076
00077 _longitude = gc._longitude;
00078 _latitude = gc._latitude;
00079 _height = gc._height;
00080
00081 int length = strlen( gc._warningMessage );
00082 strncpy( _warningMessage, gc._warningMessage, length );
00083 _warningMessage[ length ] = '\0';
00084 }
00085
00086 return *this;
00087 }
00088
00089
00090 void GeodeticCoordinates::set( double __longitude, double __latitude, double __height )
00091 {
00092 _longitude = __longitude;
00093 _latitude = __latitude;
00094 _height = __height;
00095 }
00096
00097
00098 void GeodeticCoordinates::setLongitude( double __longitude )
00099 {
00100 _longitude = __longitude;
00101 }
00102
00103
00104 void GeodeticCoordinates::setLatitude( double __latitude )
00105 {
00106 _latitude = __latitude;
00107 }
00108
00109
00110 void GeodeticCoordinates::setHeight( double __height )
00111 {
00112 _height = __height;
00113 }
00114
00115
00116 double GeodeticCoordinates::longitude() const
00117 {
00118 return _longitude;
00119 }
00120
00121
00122 double GeodeticCoordinates::latitude() const
00123 {
00124 return _latitude;
00125 }
00126
00127
00128 double GeodeticCoordinates::height() const
00129 {
00130 return _height;
00131 }
00132
00133