- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# Y:/msp/devkits/temp_geotrans/master/geotrans3.1/CCS/src/dtcc/CoordinateTuples/GEOREFCoordinates.cpp

Go to the documentation of this file.

    00001 // CLASSIFICATION: UNCLASSIFIED
    00002
    00003 #include <string.h>
    00004 #include "GEOREFCoordinates.h"
    00005
    00006
    00007 using namespace MSP::CCS;
    00008
    00009
    00010 GEOREFCoordinates::GEOREFCoordinates() :
    00011   CoordinateTuple( CoordinateType::georef ),
    00012   _precision( Precision::tenthOfSecond )
    00013 {
    00014   strncpy(_GEOREFString, "NGAA0000000000", 20);
    00015 }
    00016
    00017
    00018 GEOREFCoordinates::GEOREFCoordinates( CoordinateType::Enum _coordinateType ) :
    00019   CoordinateTuple( _coordinateType ),
    00020   _precision( Precision::tenthOfSecond )
    00021 {
    00022   strncpy(_GEOREFString, "NGAA0000000000", 20);
    00023 }
    00024
    00025
    00026 GEOREFCoordinates::GEOREFCoordinates( CoordinateType::Enum _coordinateType, const char* __GEOREFString ) :
    00027   CoordinateTuple( _coordinateType ),
    00028   _precision( Precision::tenthOfSecond )
    00029 {
    00030   strncpy(_GEOREFString, __GEOREFString, 20);
    00031   _GEOREFString[20] = '\0';
    00032 }
    00033
    00034
    00035 GEOREFCoordinates::GEOREFCoordinates( CoordinateType::Enum _coordinateType, const char* __GEOREFString, Precision::Enum __precision ) :
    00036   CoordinateTuple( _coordinateType ),
    00037   _precision( __precision )
    00038 {
    00039   strncpy(_GEOREFString, __GEOREFString, 20);
    00040   _GEOREFString[20] = '\0';
    00041 }
    00042
    00043
    00044 GEOREFCoordinates::GEOREFCoordinates( CoordinateType::Enum _coordinateType, const char* __warningMessage, const char* __GEOREFString, Precision::Enum __precision ) :
    00045   CoordinateTuple( _coordinateType ),
    00046   _precision( __precision )
    00047 {
    00048   strncpy(_GEOREFString, __GEOREFString, 20);
    00049   _GEOREFString[20] = '\0';
    00050
    00051   int length = strlen( __warningMessage );
    00052   strncpy( _warningMessage, __warningMessage, length );
    00053   _warningMessage[ length ] = '\0';
    00054 }
    00055
    00056
    00057 GEOREFCoordinates::GEOREFCoordinates( const GEOREFCoordinates &c )
    00058 {
    00059   _coordinateType = c._coordinateType;
    00060
    00061   strncpy(_GEOREFString, c._GEOREFString, 20);
    00062   _GEOREFString[20] = '\0';
    00063
    00064   _precision = c._precision;
    00065
    00066   int length = strlen( c._warningMessage );
    00067   strncpy( _warningMessage, c._warningMessage, length );
    00068   _warningMessage[ length ] = '\0';
    00069 }
    00070
    00071
    00072 GEOREFCoordinates::~GEOREFCoordinates()
    00073 {
    00074 }
    00075
    00076
    00077 GEOREFCoordinates& GEOREFCoordinates::operator=( const GEOREFCoordinates &c )
    00078 {
    00079   if( this != &c )
    00080   {
    00081     _coordinateType = c._coordinateType;
    00082
    00083     strncpy(_GEOREFString, c._GEOREFString, 20);
    00084     _GEOREFString[20] = '\0';
    00085
    00086     _precision = c._precision;
    00087
    00088     int length = strlen( c._warningMessage );
    00089     strncpy( _warningMessage, c._warningMessage, length );
    00090     _warningMessage[ length ] = '\0';
    00091   }
    00092
    00093   return *this;
    00094 }
    00095
    00096
    00097 void GEOREFCoordinates::set( char __GEOREFString[21] )
    00098 {
    00099   strncpy(_GEOREFString, __GEOREFString, 20);
    00100   _GEOREFString[20] = '\0';
    00101 }
    00102
    00103
    00104 char* GEOREFCoordinates::GEOREFString()
    00105 {
    00106   return _GEOREFString;
    00107 }
    00108
    00109
    00110 Precision::Enum GEOREFCoordinates::precision() const
    00111 {
    00112   return _precision;
    00113 }
    00114
    00115 // CLASSIFICATION: UNCLASSIFIED