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::geometry so 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< 3 >, tracktable::PointCartesian< 2 >, tracktable::PointCartesian< dim >, tracktable::PointCartesian< 5 >, tracktable::PointCartesian< Dimension >

Public Types

typedef tracktable::settings::point_coordinate_type coordinate_type
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

inline bool operator!=(PointBase const &other) const

Check two points for inequality

Parameters:

other[in] PointBase for comparison

Returns:

Boolean indicating equivalency

inline PointBase &operator=(PointBase const &other)

Make this point a copy of a different one

Parameters:

other[in] PointBase to assign value of

Returns:

PointBase with the new assigned value

Public Static Functions

static inline std::size_t size()
Returns:

The number of dimensions in this point

Protected Functions

template<class Archive>
inline void serialize(Archive &ar, const unsigned int)

Serialize the coordinates to an archive

Parameters:
  • ar[in] Archive to serialize to

  • version[in] Version of the archive

Protected Attributes

coordinate_type Coordinates[Dimension]

Storage for the coordinate values.

Friends

friend class boost::serialization::access