1 |
ksteube |
1809 |
|
2 |
|
|
######################################################## |
3 |
|
|
# |
4 |
|
|
# Copyright (c) 2003-2008 by University of Queensland |
5 |
|
|
# Earth Systems Science Computational Center (ESSCC) |
6 |
|
|
# http://www.uq.edu.au/esscc |
7 |
|
|
# |
8 |
|
|
# Primary Business: Queensland, Australia |
9 |
|
|
# Licensed under the Open Software License version 3.0 |
10 |
|
|
# http://www.opensource.org/licenses/osl-3.0.php |
11 |
|
|
# |
12 |
|
|
######################################################## |
13 |
|
|
|
14 |
|
|
__copyright__="""Copyright (c) 2003-2008 by University of Queensland |
15 |
|
|
Earth Systems Science Computational Center (ESSCC) |
16 |
|
|
http://www.uq.edu.au/esscc |
17 |
|
|
Primary Business: Queensland, Australia""" |
18 |
|
|
__license__="""Licensed under the Open Software License version 3.0 |
19 |
|
|
http://www.opensource.org/licenses/osl-3.0.php""" |
20 |
|
|
__url__="http://www.uq.edu.au/esscc/escript-finley" |
21 |
|
|
|
22 |
ksteube |
1147 |
""" |
23 |
jongui |
1197 |
@var __author__: name of author |
24 |
|
|
@var __copyright__: copyrights |
25 |
|
|
@var __license__: licence agreement |
26 |
|
|
@var __url__: url entry point on documentation |
27 |
|
|
@var __version__: version |
28 |
|
|
@var __date__: date of the version |
29 |
ksteube |
1147 |
""" |
30 |
|
|
|
31 |
jongui |
1197 |
__author__="John Ngui, john.ngui@uq.edu.au" |
32 |
|
|
|
33 |
|
|
|
34 |
ksteube |
1147 |
class LocalPosition: |
35 |
|
|
""" |
36 |
jongui |
1199 |
Class that defines the local positioning (X and Y)coordiante system (2D). |
37 |
ksteube |
1147 |
""" |
38 |
|
|
|
39 |
|
|
def __init__(self, x_coor, y_coor): |
40 |
|
|
""" |
41 |
|
|
Initialise the local position. |
42 |
|
|
|
43 |
|
|
@type x_coor: Number |
44 |
|
|
@param x_coor: x coordinate |
45 |
|
|
@type y_coor: Number |
46 |
|
|
@param y_coor: y coordinate |
47 |
|
|
""" |
48 |
|
|
|
49 |
jongui |
1189 |
self.__x_coor = x_coor |
50 |
|
|
self.__y_coor = y_coor |
51 |
ksteube |
1147 |
self.__position = [x_coor, y_coor] |
52 |
|
|
|
53 |
jongui |
1189 |
def _getXCoor(self): |
54 |
|
|
""" |
55 |
|
|
Return the X coordinate. |
56 |
|
|
|
57 |
|
|
@rtype: Number |
58 |
|
|
@return: X coordinate |
59 |
|
|
""" |
60 |
|
|
|
61 |
|
|
return self.__x_coor |
62 |
|
|
|
63 |
|
|
def _getYCoor(self): |
64 |
|
|
""" |
65 |
|
|
Return the Y coordinate. |
66 |
|
|
|
67 |
|
|
@rtype: Number |
68 |
|
|
@return: Y coordinate |
69 |
|
|
""" |
70 |
|
|
|
71 |
|
|
return self.__y_coor |
72 |
|
|
|
73 |
ksteube |
1147 |
def _getLocalPosition(self): |
74 |
|
|
""" |
75 |
|
|
Return the local position. |
76 |
|
|
|
77 |
|
|
@rtype: Two column tuple containing numbers |
78 |
|
|
@return: Tuple with the x and y coordinates |
79 |
|
|
""" |
80 |
|
|
|
81 |
|
|
return self.__position |
82 |
|
|
|
83 |
|
|
|
84 |
|
|
############################################################################### |
85 |
|
|
|
86 |
|
|
|
87 |
|
|
class GlobalPosition: |
88 |
|
|
""" |
89 |
jongui |
1199 |
Class that defines the global positioning (X, Y and Z) coordinate system |
90 |
|
|
(3D) |
91 |
ksteube |
1147 |
""" |
92 |
|
|
|
93 |
|
|
def __init__(self, x_coor, y_coor, z_coor): |
94 |
|
|
""" |
95 |
|
|
Initialise the global position. |
96 |
|
|
|
97 |
|
|
@type x_coor: Number |
98 |
|
|
@param x_coor: x coordinate |
99 |
|
|
@type y_coor: Number |
100 |
|
|
@param y_coor: y coordinate |
101 |
|
|
@type z_coor: Number |
102 |
|
|
@param z_coor: z coordinate |
103 |
|
|
""" |
104 |
|
|
|
105 |
|
|
self.__position = [x_coor, y_coor, z_coor] |
106 |
|
|
|
107 |
|
|
def _getGlobalPosition(self): |
108 |
|
|
""" |
109 |
|
|
Return the global position. |
110 |
|
|
|
111 |
|
|
@rtype: Three column tuple containing numbers |
112 |
|
|
@return: Tuple with the x, y and z coordinates |
113 |
|
|
""" |
114 |
|
|
|
115 |
|
|
return self.__position |