- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# Y:/msp/devkits/temp_geotrans/master/geotrans3.1/CCS/src/dtcc/CoordinateSystemParameters/EllipsoidParameters.cpp

Go to the documentation of this file.

    00001 // CLASSIFICATION: UNCLASSIFIED
    00002
    00003 #include <string.h>
    00004 #include "EllipsoidParameters.h"
    00005
    00006
    00007 using namespace MSP::CCS;
    00008
    00009
    00010 EllipsoidParameters::EllipsoidParameters() :
    00011   _semiMajorAxis( 0 ),
    00012   _flattening( 0 )
    00013 {
    00014   strncpy( _ellipsoidCode, "   ", 3 );
    00015 }
    00016
    00017
    00018 EllipsoidParameters::EllipsoidParameters( double __semiMajorAxis, double __flattening, char* __ellipsoidCode ) :
    00019   _semiMajorAxis( __semiMajorAxis ),
    00020   _flattening( __flattening )
    00021 {
    00022   strncpy( _ellipsoidCode, __ellipsoidCode, 3 );
    00023   _ellipsoidCode[3] = '\0';
    00024 }
    00025
    00026
    00027 EllipsoidParameters::EllipsoidParameters( const EllipsoidParameters &ecp )
    00028 {
    00029   _semiMajorAxis = ecp._semiMajorAxis;
    00030   _flattening = ecp._flattening;
    00031   strncpy( _ellipsoidCode, ecp._ellipsoidCode, 3 );
    00032   _ellipsoidCode[3] = '\0';
    00033 }
    00034
    00035
    00036 EllipsoidParameters::~EllipsoidParameters()
    00037 {
    00038   _semiMajorAxis = 0;
    00039   _flattening = 0;
    00040   strncpy( _ellipsoidCode, "   ", 3 );
    00041 }
    00042
    00043
    00044 EllipsoidParameters& EllipsoidParameters::operator=( const EllipsoidParameters &ecp )
    00045 {
    00046   if( this != &ecp )
    00047   {
    00048     _semiMajorAxis = ecp._semiMajorAxis;
    00049     _flattening = ecp._flattening;
    00050     strncpy( _ellipsoidCode, ecp._ellipsoidCode, 3 );
    00051     _ellipsoidCode[3] = '\0';
    00052   }
    00053
    00054   return *this;
    00055 }
    00056
    00057
    00058 void EllipsoidParameters::setSemiMajorAxis( double __semiMajorAxis )
    00059 {
    00060   _semiMajorAxis = __semiMajorAxis;
    00061 }
    00062
    00063
    00064 void EllipsoidParameters::setFlattening( double __flattening )
    00065 {
    00066   _flattening = __flattening;
    00067 }
    00068
    00069
    00070 void EllipsoidParameters::setEllipsoidCode( char __ellipsoidCode[4] )
    00071 {
    00072   strncpy( _ellipsoidCode, __ellipsoidCode, 3 );
    00073   _ellipsoidCode[3] = '\0';
    00074 }
    00075
    00076
    00077 double EllipsoidParameters::semiMajorAxis() const
    00078 {
    00079   return _semiMajorAxis;
    00080 }
    00081
    00082
    00083 double EllipsoidParameters::flattening() const
    00084 {
    00085   return _flattening;
    00086 }
    00087
    00088
    00089 char* EllipsoidParameters::ellipsoidCode()
    00090 {
    00091   return _ellipsoidCode;
    00092 }
    00093
    00094
    00095
    00096 // CLASSIFICATION: UNCLASSIFIED