OpenWalnut 1.2.5
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 #include "../../common/WExportCommon.h"
00032 
00033 
00034 /**
00035  * This class stores coordinates on the unit sphere.
00036  */
00037 class OWCOMMON_EXPORT WUnitSphereCoordinates // NOLINT
00038 {
00039 // TODO(all): implement test
00040 // friend class WUnitSphereCoordinatesTest;
00041 public:
00042     /**
00043      * Default constructor.
00044      */
00045     WUnitSphereCoordinates();
00046 
00047     /**
00048      * Constructor for unit sphere angles.
00049      * \param theta coordinate
00050      * \param phi coordinate
00051      */
00052     WUnitSphereCoordinates( double theta, double phi );
00053 
00054     /**
00055      * Constructor for Euclidean coordinates.
00056      * \param vector Euclidean coordinates
00057      */
00058     explicit WUnitSphereCoordinates( WVector3d vector );
00059 
00060     /**
00061      * Destructor.
00062      */
00063     virtual ~WUnitSphereCoordinates();
00064 
00065     /**
00066      * Return the theta angle.
00067      *
00068      * \return theta angle
00069      */
00070     double getTheta() const;
00071 
00072     /**
00073      * Return the phi angle.
00074      *
00075      * \return phi angle
00076      */
00077     double getPhi() const;
00078 
00079     /**
00080      * Set theta angle.
00081      * \param theta Value for theta.
00082      */
00083     void setTheta( double theta );
00084 
00085     /**
00086      * Set phi angle.
00087      * \param phi Value for phi.
00088      */
00089     void setPhi( double phi );
00090 
00091     /**
00092      * Returns the stored sphere coordinates as Euclidean coordinates.
00093      *
00094      * \return sphere coordinates in euclidean space
00095      */
00096     WVector3d getEuclidean() const;
00097 
00098 protected:
00099 
00100 private:
00101     /** coordinate */
00102     double m_theta;
00103     /** coordinate */
00104     double m_phi;
00105 };
00106 
00107 #endif  // WUNITSPHERECOORDINATES_H
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends