OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
WUnitSphereCoordinates.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WUNITSPHERECOORDINATES_H
26 #define WUNITSPHERECOORDINATES_H
27 
28 #include <vector>
29 
30 #include "../../common/math/linearAlgebra/WLinearAlgebra.h"
31 #include "../../common/WExportCommon.h"
32 
33 
34 /**
35  * This class stores coordinates on the unit sphere.
36  */
37 class OWCOMMON_EXPORT WUnitSphereCoordinates // NOLINT
38 {
39 // TODO(all): implement test
40 // friend class WUnitSphereCoordinatesTest;
41 public:
42  /**
43  * Default constructor.
44  */
46 
47  /**
48  * Constructor for unit sphere angles.
49  * \param theta coordinate
50  * \param phi coordinate
51  */
52  WUnitSphereCoordinates( double theta, double phi );
53 
54  /**
55  * Constructor for Euclidean coordinates.
56  * \param vector Euclidean coordinates
57  */
58  explicit WUnitSphereCoordinates( WVector3d vector );
59 
60  /**
61  * Destructor.
62  */
63  virtual ~WUnitSphereCoordinates();
64 
65  /**
66  * Return the theta angle.
67  *
68  * \return theta angle
69  */
70  double getTheta() const;
71 
72  /**
73  * Return the phi angle.
74  *
75  * \return phi angle
76  */
77  double getPhi() const;
78 
79  /**
80  * Set theta angle.
81  * \param theta Value for theta.
82  */
83  void setTheta( double theta );
84 
85  /**
86  * Set phi angle.
87  * \param phi Value for phi.
88  */
89  void setPhi( double phi );
90 
91  /**
92  * Returns the stored sphere coordinates as Euclidean coordinates.
93  *
94  * \return sphere coordinates in euclidean space
95  */
96  WVector3d getEuclidean() const;
97 
98 protected:
99 
100 private:
101  /** coordinate */
102  double m_theta;
103  /** coordinate */
104  double m_phi;
105 };
106 
107 #endif // WUNITSPHERECOORDINATES_H