WUnitSphereCoordinates.h 2.5 KB
Newer Older
Stefan Philips's avatar
Stefan Philips committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------

#ifndef WUNITSPHERECOORDINATES_H
#define WUNITSPHERECOORDINATES_H

#include <vector>

30
#include "../../common/math/linearAlgebra/WLinearAlgebra.h"
31
#include "../../common/WExportCommon.h"
32

Mathias Goldau's avatar
Mathias Goldau committed
33

Stefan Philips's avatar
Stefan Philips committed
34 35 36
/**
 * This class stores coordinates on the unit sphere.
 */
37
class OWCOMMON_EXPORT WUnitSphereCoordinates // NOLINT
Stefan Philips's avatar
Stefan Philips committed
38 39 40 41 42 43 44 45 46 47
{
// TODO(all): implement test
// friend class WUnitSphereCoordinatesTest;
public:
    /**
     * Default constructor.
     */
    WUnitSphereCoordinates();

    /**
48 49 50
     * Constructor for unit sphere angles.
     * \param theta coordinate
     * \param phi coordinate
Stefan Philips's avatar
Stefan Philips committed
51 52 53 54
     */
    WUnitSphereCoordinates( double theta, double phi );

    /**
Alexander Wiebel's avatar
Alexander Wiebel committed
55 56
     * Constructor for Euclidean coordinates.
     * \param vector Euclidean coordinates
Stefan Philips's avatar
Stefan Philips committed
57
     */
58
    explicit WUnitSphereCoordinates( WVector3d vector );
Stefan Philips's avatar
Stefan Philips committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

    /**
     * Destructor.
     */
    virtual ~WUnitSphereCoordinates();

    /**
     * Return the theta angle.
     */
    double getTheta() const;

    /**
     * Return the phi angle.
     */
    double getPhi() const;

    /**
     * Set theta angle.
77
     * \param theta Value for theta.
Stefan Philips's avatar
Stefan Philips committed
78 79 80 81 82 83 84 85 86 87
     */
    void setTheta( double theta );

    /**
     * Set phi angle.
     * \param phi Value for phi.
     */
    void setPhi( double phi );

    /**
Alexander Wiebel's avatar
Alexander Wiebel committed
88
     * Returns the stored sphere coordinates as Euclidean coordinates.
Stefan Philips's avatar
Stefan Philips committed
89
     */
90
    WVector3d getEuclidean() const;
Stefan Philips's avatar
Stefan Philips committed
91 92 93 94

protected:

private:
95
    /** coordinate */
Stefan Philips's avatar
Stefan Philips committed
96
    double m_theta;
97
    /** coordinate */
Stefan Philips's avatar
Stefan Philips committed
98 99 100 101
    double m_phi;
};

#endif  // WUNITSPHERECOORDINATES_H