2D Cartesian Domain

Specification

The 2D Cartesian domain (tracktable::domain::cartesian2d) concerns points in a flat 2D space. These points are located with respect to the origin. Unlike the terrestrial domain, there are no discontinuities or distinguished points apart from the origin.

Units

Position in 2D Cartesian space is denoted (x, y). You, the user, can decide what those axes mean. Without a tie to some underlying physical domain they are purely abstract. Distances in this space are measured in dimensionless units. Speed is measured in units per second.

Module Contents

class CartesianPoint2D : public tracktable::PointCartesian<2>

Bare point in flat 2D space

This class defines a point in 2D Euclidean space using Cartesian coordinates. Units have no real-world interpretation and (unlike the surface of the globe) space is isotropic.

Use this class instead of instantiating the PointCartesian template yourself.

Public Types

typedef PointCartesian<2> Superclass

Public Functions

inline CartesianPoint2D()

Create an uninitialized point

Assume that the coordinates will be initialized to garbage values when you use this constructor.

inline CartesianPoint2D(double x, double y)

Initialize a point with x, y coordinates

The coordinates will be initialized to whatever values you specify.

Parameters:
  • x[in] Lon value to use for the point

  • y[in] Lat value to use for the point

inline CartesianPoint2D(CartesianPoint2D const &other)

Copy constructor: make this point like another

Parameters:

other[in] Point to make a copy of

inline CartesianPoint2D(Superclass const &other)

Initialize this point from its superclass

If you happen to have PointCartesian<2> instances sitting around, this lets you use them as if they were CartesianPoint2D instances. This is more for the compiler’s benefit than the user’s.

Parameters:

other[in] Superclass to use as if it were a CartesianPoint2D

inline virtual ~CartesianPoint2D()

Empty destructor

All of our resources are on the stack. We don’t have any real work to do here.

inline CartesianPoint2D &operator=(CartesianPoint2D const &other)

Assignment operator

We delegate this explicitly to the superclass so that the compiler won’t try to do anything clever like copying pointers.

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

Serialize the point to an archive

Parameters:
  • ar[in] Archive to serialize to

  • version[in] Version of the archive

class CartesianTrajectoryPoint2D : public tracktable::TrajectoryPoint<CartesianPoint2D>

Trajectory point in flat 2D space

This class defines a point in 2D Euclidean space along with an object ID, timestamp and named properties. Units have no real-world interpretation and (unlike the surface of the globe) space is isotropic.

Use this class instead of instantiating the TrajectoryPoint template yourself. That way the library can present you with a consistent set of units. Also remember that you inherit all the methods of TrajectoryPoint.

Public Types

typedef TrajectoryPoint<CartesianPoint2D> Superclass

Public Functions

inline CartesianTrajectoryPoint2D()

Create an uninitialized point

Assume that the coordinates will be initialized to garbage values when you use this constructor. The object ID, timestamp and properties will all be empty.

inline CartesianTrajectoryPoint2D(double x, double y)

Initialize a point with x, y coordinates

The coordinates will be initialized to whatever values you specify.

Parameters:
  • x[in] Lon value to use for the point

  • y[in] Lat value to use for the point

inline CartesianTrajectoryPoint2D(CartesianTrajectoryPoint2D const &other)

Copy constructor: make this point like another

Parameters:

other[in] Point to make a copy of

inline CartesianTrajectoryPoint2D(Superclass const &other)

Initialize this point from its superclass

If you happen to have TrajectoryPoint<PointCartesian<2>> instances sitting around, this lets you use them as if they were CartesianTrajectoryPoint2D objects. This is more for the compiler’s benefit than the user’s.

Parameters:

other[in] Superclass to use as if it were a CartesianTrajectoryPoint2D

inline virtual ~CartesianTrajectoryPoint2D()

Empty destructor

All of our resources are on the stack. We don’t have any real work to do here.

inline CartesianTrajectoryPoint2D &operator=(CartesianTrajectoryPoint2D const &other)

Assignment operator

We delegate this explicitly to the superclass so that the compiler won’t try to do anything clever like copying pointers.

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

Serialize the points to an archive

Parameters:
  • ar[in] Archive to serialize to

  • version[in] Version of the archive