UNCLASSIFIED
GeographicTranslator
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Friends
Macros
master
geotrans3.7
CCS
src
dtcc
CoordinateTuples
CartesianCoordinates.cpp
Go to the documentation of this file.
1
// CLASSIFICATION: UNCLASSIFIED
2
3
#include <string.h>
4
#include "
CartesianCoordinates.h
"
5
6
7
using namespace
MSP::CCS;
8
9
10
CartesianCoordinates::CartesianCoordinates
() :
11
CoordinateTuple
(
CoordinateType
::geocentric ),
12
_x( 0 ),
13
_y( 0 ),
14
_z( 0 )
15
{
16
}
17
18
19
CartesianCoordinates::CartesianCoordinates
(
CoordinateType::Enum
_coordinateType ) :
20
CoordinateTuple
( _coordinateType ),
21
_x( 0 ),
22
_y( 0 ),
23
_z( 0 )
24
{
25
}
26
27
28
CartesianCoordinates::CartesianCoordinates
(
CoordinateType::Enum
_coordinateType,
double
__x,
double
__y,
double
__z ) :
29
CoordinateTuple
( _coordinateType ),
30
_x( __x ),
31
_y( __y ),
32
_z( __z )
33
{
34
}
35
36
37
CartesianCoordinates::CartesianCoordinates
(
CoordinateType::Enum
_coordinateType,
const
char
* __warningMessage,
double
__x,
double
__y,
double
__z ) :
38
CoordinateTuple
( _coordinateType ),
39
_x( __x ),
40
_y( __y ),
41
_z( __z )
42
{
43
int
length = strlen( __warningMessage );
44
strncpy(
_warningMessage
, __warningMessage, length );
45
_warningMessage
[ length ] =
'\0'
;
46
}
47
48
49
CartesianCoordinates::CartesianCoordinates
(
const
CartesianCoordinates
&c )
50
{
51
_coordinateType
= c.
_coordinateType
;
52
53
_x = c._x;
54
_y = c._y;
55
_z = c._z;
56
57
int
length = strlen( c.
_warningMessage
);
58
strncpy(
_warningMessage
, c.
_warningMessage
, length );
59
_warningMessage
[ length ] =
'\0'
;
60
}
61
62
63
CartesianCoordinates::~CartesianCoordinates
()
64
{
65
_x = 0;
66
_y = 0;
67
_z = 0;
68
}
69
70
71
CartesianCoordinates
&
CartesianCoordinates::operator=
(
const
CartesianCoordinates
&c )
72
{
73
if
(
this
!= &c )
74
{
75
_coordinateType
= c.
_coordinateType
;
76
77
_x = c._x;
78
_y = c._y;
79
_z = c._z;
80
81
int
length = strlen( c.
_warningMessage
);
82
strncpy(
_warningMessage
, c.
_warningMessage
, length );
83
_warningMessage
[ length ] =
'\0'
;
84
}
85
86
return
*
this
;
87
}
88
89
90
void
CartesianCoordinates::set
(
double
__x,
double
__y,
double
__z )
91
{
92
_x = __x;
93
_y = __y;
94
_z = __z;
95
}
96
97
98
void
CartesianCoordinates::setX
(
double
__x )
99
{
100
_x = __x;
101
}
102
103
104
void
CartesianCoordinates::setY
(
double
__y )
105
{
106
_y = __y;
107
}
108
109
110
void
CartesianCoordinates::setZ
(
double
__z )
111
{
112
_z = __z;
113
}
114
115
116
double
CartesianCoordinates::x
()
const
117
{
118
return
_x;
119
}
120
121
122
double
CartesianCoordinates::y
()
const
123
{
124
return
_y;
125
}
126
127
128
double
CartesianCoordinates::z
()
const
129
{
130
return
_z;
131
}
132
133
// CLASSIFICATION: UNCLASSIFIED
Generated on Tue Feb 16 2016 14:54:02 for GeographicTranslator by doxygen 1.8.2