coordsys_child

This is the main backended coordsys to produce complex topologies of coordinate systems.

namespace nin {
    template <coordsys_traits CT>
    class coordsys_child_backend : public coordsys_backend<CT>;

    template <derived_from_coordsys_child_backend BE>
    class coordsys_child : public coordsys<typename BE::coordsys_traits>;
}

coordsys_child is the base for building coordinate trees. It represents a coordinate system that is defined relative to a parent, with a fixed transformation to that parent. When the tree is traversed, the child composes its local transformation with its parent’s transformation and continues upward until WCS is reached.

coordsys_child is a class template parameterised on a backend type BE that must derive from coordsys_child_backend. The R2 and R3 namespaces provide concrete child types (e.g. position_coordsys_child) that derive from coordsys_child with specialised backends accepting position and orientation constructors.

coordsys_child_backend

The backend stores the parent coordinate system and the transformation to that parent. Derived backends can add richer constructors (e.g. accepting position + rotation instead of raw tf_data_type), but the core traversal logic lives here.

Member functions

(Constructor)

coordsys_child_backend()

(1)

coordsys_child_backend(coordsys_child_backend const&) = delete

(2)

coordsys_child_backend(coordsys<CT> parent, tf_data_type tf)

(3)

  • (1) Default constructor. No parent (WCS).

  • (2) Copy is deleted — use clone() instead. Copying the backend directly would create a second object with a shared parent reference; clone() handles this correctly.

  • (3) Constructs with a parent coordinate system and the transformation from this coordinate system to that parent. The parent is stored as a linked_copy().

parent

access the parent coordinate system

coordsys<CT> const& parent() const

(1)

Returns the parent coordinate system. This is a linked copy of the coordinate system passed at construction, so it tracks the original.

set_parent

change the parent coordinate system

void set_parent(coordsys<CT> parent)

(1)

Replaces the parent with a linked copy of the argument. The next call to tf_to_WCS() on any coordinate system below this one will reflect the new parent.

tf_to_parent

access the transformation to the parent

tf_data_type const& tf_to_parent() const

(1)

tf_data_type & tf_to_parent()

(2)

  • (1) Returns a const reference to the transformation from this coordinate system to its parent.

  • (2) Returns a mutable reference, allowing the transformation to be updated in place.

coordsys_child

The public-facing class. It derives from coordsys<CT> and provides operator → for direct access to the underlying backend.

Member functions

(Constructor)

coordsys_child()

(1)

coordsys_child(coordsys_child const& copy)

(2)

coordsys_child(coordsys_child && move)

(3)

coordsys_child(coordsys<CT> parent, tf_data_type tf)

(4)

coordsys_child(WCS_t, tf_data_type tf)

(5)

  • (1) Default constructor (at WCS origin).

  • (2) Deep copy. Clones the backend, producing an independent coordinate system with the same parent and transformation. The copy is not a child of copy — it is a sibling.

  • (3) Move constructor.

  • (4) Constructs relative to a parent with the given transformation.

  • (5) Convenience — same as (4) with WCS as parent.

operator →

access the underlying backend

BE * operator →()

(1)

BE const* operator →() const

(2)

Provides pointer-style access to the underlying backend. Use this to call backend-specific members like parent(), set_parent(), and tf_to_parent().