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.

You will not use this directly. Instead, you’ll use one of the coordinate-specific versions like PointBaseCartesian or PointBaseLonLat.

PointBase and all of its subclasses will be registered with boost::geometry so that you can use all of the generic geometry algorithms.

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

PointBase()

Initialize an empty point.

PointBase(PointBase const &other)

Initialize a copy of another point.

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>
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>();

template<std::size_t d>
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);

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;

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;

bool operator==(PointBase const &other) const

Check two points for equality.

This requires that the two points have the same dimension.

bool operator!=(PointBase const &other) const

Check two points for inequality.

PointBase &operator=(PointBase const &other)

Make this point a copy of a different one.

std::size_t size() const

Get the number of dimensions in this point.

Protected Functions

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

Protected Attributes

template<>
coordinate_type Coordinates[Dimension]

Storage for the coordinate values.