EMODnet Quantized Mesh Generator for Cesium
ellipsoid.h
1 // Copyright (c) 2018 Coronis Computing S.L. (Spain)
2 // All rights reserved.
3 //
4 // This file is part of EMODnet Quantized Mesh Generator for Cesium.
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <https://www.gnu.org/licenses/>.
18 //
19 // Author: Ricard Campos (ricardcd@gmail.com)
20 
21 #ifndef EMODNET_QMGC_ELLIPSOID_H
22 #define EMODNET_QMGC_ELLIPSOID_H
23 
32 class Ellipsoid
33 {
34 public:
41  Ellipsoid( const double& rx, const double& ry, const double& rz ) : m_rx(rx), m_ry(ry), m_rz(rz) {}
42 
44  Ellipsoid() : m_rx(0.0), m_ry(0.0), m_rz(0.0) {}
45 
50  Ellipsoid( const Ellipsoid& e ) {
51  m_rx = e.getRadiusX() ;
52  m_ry = e.getRadiusY() ;
53  m_rz = e.getRadiusZ() ;
54  }
55 
57  double getRadiusX() const { return m_rx ; }
58 
60  double getRadiusY() const { return m_ry ; }
61 
63  double getRadiusZ() const { return m_rz ; }
64 
66  void setRadiusX(const double& rx) { m_rx = rx ; }
67 
69  void setRadiusY(const double& ry) { m_ry = ry ; }
70 
72  void setRadiusZ(const double& rz) { m_rz = rz ; }
73 
74 protected:
75  double m_rx;
76  double m_ry;
77  double m_rz;
78 };
79 
86 class WGS84Ellipsoid : public Ellipsoid
87 {
88 public:
92  WGS84Ellipsoid() : Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793) {}
93 };
94 
95 #endif //EMODNET_QMGC_ELLIPSOID_H
Ellipsoid(const Ellipsoid &e)
Copy constructor.
Definition: ellipsoid.h:50
double m_ry
Radius of the ellipsoid in Y.
Definition: ellipsoid.h:76
Ellipsoid()
Default constructor (all radius set to 0)
Definition: ellipsoid.h:44
double getRadiusX() const
Get the X radius of the ellipsoid.
Definition: ellipsoid.h:57
Describes an ellipsoid.
Definition: ellipsoid.h:32
double getRadiusZ() const
Get the Z radius of the ellipsoid.
Definition: ellipsoid.h:63
void setRadiusZ(const double &rz)
Set the Z radius of the ellipsoid.
Definition: ellipsoid.h:72
double m_rz
Radius of the ellipsoid in Z.
Definition: ellipsoid.h:77
double getRadiusY() const
Get the Y radius of the ellipsoid.
Definition: ellipsoid.h:60
void setRadiusX(const double &rx)
Set the X radius of the ellipsoid.
Definition: ellipsoid.h:66
WGS84Ellipsoid()
Constructor.
Definition: ellipsoid.h:92
The WGS84 ellipsoid.
Definition: ellipsoid.h:86
double m_rx
Radius of the ellipsoid in X.
Definition: ellipsoid.h:75
Ellipsoid(const double &rx, const double &ry, const double &rz)
Constructor.
Definition: ellipsoid.h:41
void setRadiusY(const double &ry)
Set the Y radius of the ellipsoid.
Definition: ellipsoid.h:69