vcsl_spheroid.h
Go to the documentation of this file.
1 #ifndef vcsl_spheroid_h_
2 #define vcsl_spheroid_h_
3 //:
4 // \file
5 // \brief Reference sphere or ellipse for a geographic coordinate system
6 // \author Francois BERTEL
7 //
8 // \verbatim
9 // Modifications
10 // 2000/06/28 Francois BERTEL Creation. Adapted from IUE
11 // 2001/04/10 Ian Scott (Manchester) Converted perceps header to doxygen
12 // 2004/09/17 Peter Vanroose made a(), b(), e() and f() non-virtual - they just return a member and should not be overloaded
13 // \endverbatim
14 
15 #include <vbl/vbl_ref_count.h>
17 
18 //: Reference sphere or ellipse for a geographic coordinate system
19 // The default value for a reference ellipsoid is the Clarke 1866 model, but
20 // this class contains a constructor that allows reference spheroids to be
21 // constructed with values for several different standard models. See the book
22 // "Map Projections Used by the U.S. Geological Survey" (Snyder, John P.,
23 // "Map Projections Used by the U.S. Geological Survey," Geological Survey
24 // Bulletin 1532, U.S. Government Printing Office, Washington, 1982.) for
25 // further detail on most of these coordinate systems.
27  : public vbl_ref_count
28 {
29  public:
31  {
45  };
46 
47  //***************************************************************************
48  // Constructors/Destructor
49  //***************************************************************************
50 
51  //: Default constructor. Clark_1866 spheroid
53 
54  //: Constructor from a standard spheroid
55  explicit vcsl_spheroid(const vcsl_std_spheroid s) { set_from_std(s); }
56 
57  // Copy constructor
59  : vbl_ref_count(), a_(other.a_), b_(other.b_), e_(other.e_), f_(other.f_) {}
60 
61  // Destructor
62  ~vcsl_spheroid() override = default;
63 
64  //***************************************************************************
65  // Status report
66  //***************************************************************************
67 
68  //: Return the major axis of spheroid
69  double a() const { return a_; }
70 
71  //: Return the minor axis of spheroid
72  double b() const { return b_; }
73 
74  //: Return the eccentricity of spheroid
75  double e() const { return e_; }
76 
77  //: Return the flattening of spheroid
78  double f() const { return f_; }
79 
80  //***************************************************************************
81  // Status setting
82  //***************************************************************************
83 
84  //: Set from a standard spheroid
85  void set_from_std(const vcsl_std_spheroid new_std_spheroid);
86 
87  //: Set the major axis of spheroid
88  void set_a(double new_a) { a_=new_a; }
89 
90  //: Set the minor axis of spheroid
91  void set_b(double new_b) { b_=new_b; }
92 
93  //: Set the eccentricity of spheroid
94  void set_e(double new_e) { e_=new_e; }
95 
96  //: Set the flattening of spheroid
97  void set_f(double new_f) { f_=new_f; }
98 
99  //***************************************************************************
100  // Comparison
101  //***************************************************************************
102 
103  //: Is `this' equal to `other' ?
104  bool operator==(const vcsl_spheroid &other) const;
105 
106  //***************************************************************************
107  // Duplication
108  //***************************************************************************
109 
110  // Assignment
111  vcsl_spheroid &operator=(const vcsl_spheroid &other);
112 
113  protected:
114  //***************************************************************************
115  // Implementation
116  //***************************************************************************
117 
118  //: Major axis of spheroid
119  double a_;
120  //: Minor axis of spheroid
121  double b_;
122  //: Eccentricity of spheroid
123  double e_;
124  //: Flattening of spheroid
125  double f_;
126 };
127 
128 #endif // vcsl_spheroid_h_
bool operator==(const vcsl_spheroid &other) const
Is ‘this’ equal to ‘other’ ?.
vcsl_spheroid & operator=(const vcsl_spheroid &other)
void set_b(double new_b)
Set the minor axis of spheroid.
Definition: vcsl_spheroid.h:91
double a() const
Return the major axis of spheroid.
Definition: vcsl_spheroid.h:69
double e() const
Return the eccentricity of spheroid.
Definition: vcsl_spheroid.h:75
void set_f(double new_f)
Set the flattening of spheroid.
Definition: vcsl_spheroid.h:97
double a_
Major axis of spheroid.
vcsl_spheroid(const vcsl_std_spheroid s)
Constructor from a standard spheroid.
Definition: vcsl_spheroid.h:55
double e_
Eccentricity of spheroid.
double b_
Minor axis of spheroid.
vcsl_spheroid(const vcsl_spheroid &other)
Definition: vcsl_spheroid.h:58
double b() const
Return the minor axis of spheroid.
Definition: vcsl_spheroid.h:72
void set_from_std(const vcsl_std_spheroid new_std_spheroid)
Set from a standard spheroid.
double f_
Flattening of spheroid.
Reference sphere or ellipse for a geographic coordinate system.
Definition: vcsl_spheroid.h:26
void set_e(double new_e)
Set the eccentricity of spheroid.
Definition: vcsl_spheroid.h:94
void set_a(double new_a)
Set the major axis of spheroid.
Definition: vcsl_spheroid.h:88
double f() const
Return the flattening of spheroid.
Definition: vcsl_spheroid.h:78
~vcsl_spheroid() override=default
vcsl_spheroid()
Default constructor. Clark_1866 spheroid.
Definition: vcsl_spheroid.h:52