15c82487 |
1 | // Copyright (C) 2006 Erik Dahlberg |
2 | // |
d105c6a7 |
3 | // This file is part of LSystem3D. |
15c82487 |
4 | // |
5 | // LSystem3D is free software; you can redistribute it and/or |
6 | // modify it under the terms of the GNU General Public License |
7 | // as published by the Free Software Foundation; either version 2 |
8 | // of the License, or (at your option) any later version. |
9 | // |
10 | // LSystem3D is distributed in the hope that it will be useful, |
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | // GNU General Public License for more details. |
14 | // |
15 | // You should have received a copy of the GNU General Public License |
16 | // along with LSystem3D; if not, write to the Free Software |
17 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | |
19 | |
20 | |
21 | |
22 | #include "coordinate.h" |
23 | |
24 | |
25 | |
26 | /** |
27 | * Constructor |
28 | */ |
29 | Coordinate::Coordinate() |
30 | { |
31 | setXYZ(0.0, 0.0, 0.0); |
32 | } |
33 | |
34 | |
35 | |
36 | /** |
37 | * Destructor |
38 | */ |
39 | Coordinate::~Coordinate() |
40 | { |
41 | } |
42 | |
43 | |
44 | |
526db675 |
45 | /** |
46 | * Set coordinate |
47 | * @param x the x-coordinate |
48 | * @param y the y-coordinate |
49 | * @param z the z-coordinate |
50 | */ |
51 | void Coordinate::setXYZ(double x, double y, double z) |
52 | { |
53 | _x = x; |
54 | _y = y; |
55 | _z = z; |
56 | } |
57 | |
58 | |
59 | |
15c82487 |
60 | /** |
61 | * Get x-coordinate |
62 | * @return the x-coordinate |
63 | */ |
64 | double Coordinate::getX() |
65 | { |
66 | return _x; |
67 | } |
68 | |
69 | |
70 | |
71 | /** |
72 | * Get y-coordinate |
73 | * @return the y-coordinate |
74 | */ |
75 | double Coordinate::getY() |
76 | { |
77 | return _y; |
78 | } |
79 | |
80 | |
81 | |
82 | /** |
83 | * Get z-coordinate |
84 | * @return the z-coordinate |
85 | */ |
86 | double Coordinate::getZ() |
87 | { |
88 | return _z; |
89 | } |