Class FrameContainer#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Class Documentation#

class FrameContainer : public Karana::Core::LockingBase#

A container class for managing frames and their relationships.

This class provides functionality to create, register, and manage frames, as well as establish relationships between frames.

See The frames layer for more discussion on the frames layer.

Public Functions

FrameContainer()#

Constructs a FrameContainer with a root frame.

virtual ~FrameContainer()#

FrameContainer destructor.

virtual const std::string &typeString() const noexcept override#

Returns the type string of the FrameContainer.

Returns:

The type string.

std::string dumpString(const std::string &prefix = "", const Base::dumpOptions *options = nullptr) const override#
const kc::ks_ptr<Frame> &root() const#

Returns the root frame of the tree.

Returns:

The root frame.

std::vector<kc::ks_ptr<Frame>> lookupFrame(const std::string &name)#

Return a vector of all Frames with the given name.

Parameters:

name – name of the Frame instances to look up

Returns:

A vector of all the Frames with the given name.

bool isAncestorOf(const Frame &oframe, const Frame &pframe, bool strict)#

Checks if one frame is an ancestor of another.

Parameters:
  • oframe – The potential ancestor frame.

  • pframe – The potential descendant frame.

  • strict – If false, a frame can be its own ancestor

Returns:

True if oframe is an ancestor of pframe, false otherwise.

const kc::ks_ptr<Frame> &getAncestor(const Frame &frame1, const Frame &frame2)#

Gets the common ancestor of two frames.

Parameters:
  • frame1 – The first frame.

  • frame2 – The second frame.

Returns:

The common ancestor frame.

void trackUsageFrame(const kc::ks_ptr<Frame> &frame)#

Method to track usage of a Frame instance.

These methods need to be public to allow specialized classes (eg. multibody) ones to call them

Parameters:

frame – the new Frame to track

void trackUsageEdgeFrame2Frame(const kc::ks_ptr<EdgeFrame2Frame> &f2f)#

Method to track usage of an EdgeFrame2Frame instance.

These methods need to be public to allow specialized classes (eg. multibody) ones to call them

Parameters:

f2f – the new EdgeFrame2Frame to track

void trackUsageOrientedChainedFrame2Frame(const kc::ks_ptr<OrientedChainedFrame2Frame> &of2f)#

Method to track usage of an OrientedChainedFrame2Frame instance.

These methods need to be public to allow specialized classes (eg. multibody) ones to call them

Parameters:

of2f – the new Frame to track

void trackUsageChainedFrame2Frame(const kc::ks_ptr<ChainedFrame2Frame> &cf2f)#

Method to track usage of an ChainedFrame2Frame instance.

These methods need to be public to allow specialized classes (eg. multibody) ones to call them

Parameters:

cf2f – the new Frame to track

void freezeUpstream(const kc::ks_ptr<Frame> &frame)#

Freeze the OrientedChainedFrame2Frame that connects this frame to the root. This will effectively freeze all edges in the path.

Parameters:

frame – the downstream terminal frame

void unfreezeUpstream(const kc::ks_ptr<Frame> &frame)#

Unfreeze the OrientedChainedFrame2Frame that connects this frame to the root. This will effectively unfreeze all edges in the path.

Parameters:

frame – the downstream terminal frame

std::vector<kc::ks_ptr<Frame>> frames()#

Return a vector of all the frames in the FrameContainer.

Returns:

List of all the frame elements.

std::vector<kc::ks_ptr<EdgeFrame2Frame>> edgeFrame2Frames()#

Return a vector of all the EdgeFrame2Frames in the FrameContainer.

Returns:

List of all the edge elements.

std::vector<kc::ks_ptr<ChainedFrame2Frame>> chainedFrame2Frames()#

Return a vector of all the ChainedFrame2Frames in the FrameContainer.

Returns:

List of all the chain elements.

void setEphemerisTime(double ephemeris_time)#

Set the ephemeris time.

The ephemeris time is needed by Spice frames

Parameters:

ephemeris_time – the ephemeris time

double getEphemerisTime()#

Return the current ephemeris time.

The ephemeris time is needed by Spice frames

Returns:

the current ephemeris time

bool isUsingSpice()#

Return true if this FrameContainer is using spice frames, false otherwise.

Returns:

true if this FrameContainer is using spice frames, false otherwise.

void dumpFrameTree(const std::string &prefix, const Frame &f, const std::function<std::string(const Frame&)> &callback) const#

Display the frame tree hierarchy starting from a specific frame.

Parameters:
  • prefix – the string prefix for each line of the displayed output

  • f – the root Frame for the start of the tree disply

  • callback – the function to generate each frame’s display string

inline const std::unique_ptr<const kc::Tree<kc::id_t>> &tree()#

Public Static Functions

static kc::ks_ptr<FrameContainer> create(const std::string &root_frame_name)#

Create a FrameContainer.

Parameters:

root_frame_name – Name for the root frame

Returns:

The frame container.

Protected Functions

void _discard(kc::ks_ptr<Base> &base) override#

Parameters:

base – - Pointer to the FrameContainer.

virtual void _makeStale() override#

Derived classes override this to define how to mark themselves as stale.

virtual void _makeCurrent() override#

Derived classes override this to define how to make themselves current.

std::optional<bool> _subchainOrientation(const Frame2Frame &f2f, const Frame2Frame &sub_f2f) const#

Return true if the sub_f2f path is contained within the f2f’s oframe/pframe path and oriented with the path, false if it has opposed orientation, and nullopt if it is not full contained on the path at all.

Protected Attributes

kc::RegistryList<Frame2Frame> _spice_f2fs_list#

List of all SpiceFrame2Frame instances

struct dumpOptions : public LockingBase::dumpOptions#

options struct for dumpString

Public Functions

inline dumpOptions &operator=(const dumpOptions &p)#

copy method

Public Members

bool frames = false#

frames usage map

bool edges = false#

edge usage map

bool oriented = false#

oriented f2fs usage map

bool chains = false#

regular chains usage map