-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDF_Abstract_Point.hpp
77 lines (66 loc) · 2.59 KB
/
DF_Abstract_Point.hpp
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef DF_ABSTRACT_POINT_HPP
#define DF_ABSTRACT_POINT_HPP
#include "DFLib_port.h"
#include <vector>
namespace DFLib
{
namespace Abstract
{
/// \brief Abstract base class for generic "point" objects
///
/// The purpose of this extraordinarily simple class is to
/// provide a generic interface for low-level DF classes to
/// obtain the X-Y coordinates of a DF receiver location (or
/// for returning a DF fix point) without regard to how the user
/// actually provides the data or expects to view it.
///
/// The abstract interface works only with the X-Y representations
/// of the coordinates. It is expected that in most cases for
/// DF work this will be Mercator projection coordinates, but
/// it could be any planar representation that is suitable for the
/// user's work.
///
class CPL_DLL Point
{
public:
/// \brief virtual destructor because there should always be one
virtual ~Point() {};
/// \brief Set X-Y coordinates of the point
///
/// \param aPosition a vector containing the X and Y coordinates
///
virtual void setXY(const std::vector<double> &aPosition)=0;
/// \brief Get X-Y coordinates of the point
///
/// Note that this is NOT declared as a const member function,
/// because implementations \e could, for efficiency, store
/// both X-Y coordinates and another system of coordinates.
/// In that case, getXY might trigger a coordinate system
/// transformation, and might need to tinker with internals.
///
/// The reference returned, however, \e is const. One is not
/// allowed to tinker with the internal representation through
/// it.
///
/// \return reference to an STL vector containing the coordinates
///
virtual const std::vector<double> &getXY() = 0;
/// \brief Get coordinates in the user's coordinate system
///
virtual const std::vector<double> &getUserCoords() = 0;
/// \brief Set coordinates in the user's coordinate system
///
virtual void setUserCoords(const std::vector<double> &uPosition) = 0;
/// \brief Clone Self
///
/// Make a copy of yourself, and return a pointer to the copy.
/// This is useful as a prototype: pass a pointer to any concrete
/// implementation to a function, and that function has a way of
/// making other objects of precisely the same type by cloning.
///
/// \return pointer to
virtual Point *Clone() = 0;
};
}
}
#endif // DF_ABSTRACT_POINT_HPP