- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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

Go to the documentation of this file.

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