OpenWalnut 1.3.1
WUnitSphereCoordinates.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WUNITSPHERECOORDINATES_H
00026 #define WUNITSPHERECOORDINATES_H
00027 
00028 #include <vector>
00029 
00030 #include "../../common/math/linearAlgebra/WLinearAlgebra.h"
00031 
00032 /**
00033  * This class stores coordinates on the unit sphere.
00034  */
00035 class WUnitSphereCoordinates // NOLINT
00036 {
00037 // TODO(all): implement test
00038 // friend class WUnitSphereCoordinatesTest;
00039 public:
00040     /**
00041      * Default constructor.
00042      */
00043     WUnitSphereCoordinates();
00044 
00045     /**
00046      * Constructor for unit sphere angles.
00047      * \param theta coordinate
00048      * \param phi coordinate
00049      */
00050     WUnitSphereCoordinates( double theta, double phi );
00051 
00052     /**
00053      * Constructor for Euclidean coordinates.
00054      * \param vector Euclidean coordinates
00055      */
00056     explicit WUnitSphereCoordinates( WVector3d vector );
00057 
00058     /**
00059      * Destructor.
00060      */
00061     virtual ~WUnitSphereCoordinates();
00062 
00063     /**
00064      * Return the theta angle.
00065      *
00066      * \return theta angle
00067      */
00068     double getTheta() const;
00069 
00070     /**
00071      * Return the phi angle.
00072      *
00073      * \return phi angle
00074      */
00075     double getPhi() const;
00076 
00077     /**
00078      * Set theta angle.
00079      * \param theta Value for theta.
00080      */
00081     void setTheta( double theta );
00082 
00083     /**
00084      * Set phi angle.
00085      * \param phi Value for phi.
00086      */
00087     void setPhi( double phi );
00088 
00089     /**
00090      * Returns the stored sphere coordinates as Euclidean coordinates.
00091      *
00092      * \return sphere coordinates in euclidean space
00093      */
00094     WVector3d getEuclidean() const;
00095 
00096 protected:
00097 private:
00098     /** coordinate */
00099     double m_theta;
00100     /** coordinate */
00101     double m_phi;
00102 };
00103 
00104 #endif  // WUNITSPHERECOORDINATES_H