PointBase Module¶
Module Contents¶
-
template<std::size_t Dimension>
class PointBase¶ Base class for all points in Tracktable.
This class defines a point independent of the number of coordinates or the data type.
PointBase and all of its subclasses will be registered with
boost::geometryso that you can use all of the generic geometry algorithms.Note
You will not use this directly. Instead, you’ll use one of the coordinate-specific versions like PointBaseCartesian or PointBaseLonLat.
Subclassed by tracktable::PointCartesian< 2 >, tracktable::PointCartesian< 3 >, tracktable::PointCartesian< dim >, tracktable::PointCartesian< Dimension >
Public Types
-
typedef tracktable::settings::point_coordinate_type element_type¶
Public Functions
-
inline PointBase()¶
Initialize an empty point.
-
inline PointBase(PointBase const &other)¶
Copy contructor, create a PointBase with a copy of another.
- Parameters:
other – [in] PointBase to copy from
-
inline virtual ~PointBase()¶
Destructor for our descendants.
Although PointBase itself only needs a trivial destructor, we know that subclasses are going to extend it one way or another.
-
template<std::size_t d>
inline coordinate_type const &get() const¶ Get the value of a particular coordinate.
Since this is Boost, you set and get coordinates by specifying the coordinate at compile time:
double x = point.get<0>();
- Returns:
The value of a particular coordinate
-
template<std::size_t d>
inline void set(coordinate_type const &new_value)¶ Set the value of a particular coordinate.
Since this is Boost, you set and get coordinates by specifying the coordinate at compile time:
point.set<0>(new_value);
- Parameters:
new_value – [in] The value to assign to the coordinate
-
inline coordinate_type const &operator[](std::size_t d) const¶
Get/set the value of a coordinate.
You can use operator[] whether or not you know the coordinate you want ahead of time.
double x = point[0]; point[0] = x;
- Returns:
The value of the coordinate
-
inline coordinate_type &operator[](std::size_t d)¶
Get/set the value of a coordinate.
You can use operator[] whether or not you know the coordinate you want ahead of time.
double x = point[0]; point[0] = x;
- Returns:
The value of the coordinate
-
inline bool operator==(PointBase const &other) const¶
Check two points for equality.
Note
This requires that the two points have the same dimension.
- Parameters:
other – [in] PointBase for comparison
- Returns:
Boolean indicating equivalency
Public Static Functions
-
static inline std::size_t size()¶
- Returns:
The number of dimensions in this point
Protected Functions
-
typedef tracktable::settings::point_coordinate_type element_type¶