Class Frame#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class Frame : public Karana::Core::LockingBase#

The class for a frame in the frames tree.

See Coordinate Frames for more discussion on the frames layer.

Subclassed by Karana::Dynamics::Node, Karana::Dynamics::PhysicalBody, Karana::Frame::SpiceFrame

Public Functions

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

Discard the Frame. Used when you want to specifically call Frame’s discard method rather than virtual dispatching to the most derived class’s _discard method.

Parameters:

frame – - The pointer to the frame to discard.

virtual ~Frame()#

Destructor for the Frame class.

const kc::ks_ptr<Frame> &parent() const#

Get the parent frame.

Returns:

The parent frame.

const kc::ks_ptr<EdgeFrameToFrame> &edge() const#

Get the edge associated with this frame.

Returns:

The edge f2f.

FrameContainer &container() const#

Get the reference to the container of the frame.

Returns:

The reference to the container of the frame.

const kc::ks_ptr<FrameContainer> &containerPtr() const#

Get the shared pointer for the container of the frame.

Returns:

The shared pointer for the container of the frame.

const kc::ks_ptr<ChainedFrameToFrame> &frameToFrame(const kc::ks_ptr<Frame> &frame) const#

Create a chained f2f between this frame and the target frame. This frame will be the o-frame and the target frame will become the p-frame.

Parameters:

frame – The target frame. This will be the p-frame in the chained frame to frame.

Returns:

The ChainedFrameToFrame connecting this frame (o-frame) and the target frame (p-frame).

const kc::ks_ptr<ChainedFrameToFrame> &frameToFrameRef(const Frame &frame) const#

Create a chained f2f between this frame and the target frame. This frame will be the o-frame and the target frame will become the p-frame.

Parameters:

frame – The target frame. This will be the p-frame in the chained frame to frame.

Returns:

The ChainedFrameToFrame connecting this frame (o-frame) and the target frame (p-frame).

const kc::ks_ptr<OrientedChainedFrameToFrame> &orientedFrameToFrame(const kc::ks_ptr<Frame> &frame) const#

Create an oriented chained f2f between this frame and the target frame. This frame will be the o-frame and the target frame will become the p-frame.

Note that it up to the user to ensure that the pframe is a true descendant of the oframe. If not, there will be errors when trying to use this oriented chain.

Parameters:

frame – The target frame. This will be the p-frame in the chained frame to frame.

Returns:

The OrientedChainedFrameToFrame connecting this frame (o-frame) and the target frame (p-frame).

const kc::ks_ptr<OrientedChainedFrameToFrame> &orientedFrameToFrameRef(const Frame &frame) const#

Create an oriented chained f2f between this frame and the target frame. This frame will be the o-frame and the target frame will become the p-frame.

Note that it up to the user to ensure that the pframe is a true descendant of the oframe. If not, there will be errors when trying to use this oriented chain.

Parameters:

frame – The target frame. This will be the p-frame in the chained frame to frame.

Returns:

The OrientedChainedFrameToFrame connecting this frame (o-frame) and the target frame (p-frame).

bool isAncestorOf(const Frame &other, bool strict) const#

Check if this frame is an ancestor of another frame.

Parameters:
  • other – The other frame to check against.

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

Returns:

True if this frame is an ancestor of the other frame, false otherwise.

const kc::ks_ptr<Frame> &getAncestor(const Frame &other) const#

Get the ancestor of this frame and another frame.

Parameters:

other – The other frame.

Returns:

The common ancestor.

Frame(std::string_view name, kc::ks_ptr<FrameContainer> frame_container)#

Frame constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.

Parameters:
  • name – The name of the frame.

  • frame_container – The container of the frame.

std::string dumpString(std::string_view prefix = "", const Base::DumpOptions *options = nullptr) const override#

Return inform about the Frame.

Parameters:
  • prefix – the prefix for each output line

  • options – to tailor the dump output

Returns:

the informational string

void dumpFrameTree(std::string_view prefix = "", const DumpFrameTreeOptions options = DumpFrameTreeOptions(true, false, false, false, false, false)) const#

Display the frame tree. The contents of the options struct can be used to control the content and verbosity of the displayed output.

Parameters:
  • prefix – the prefix for each output line

  • options – output content options

Public Static Functions

static kc::ks_ptr<Frame> create(std::string_view name, kc::ks_ptr<FrameContainer> fc)#

Creates a new frame with the given name.

Parameters:
  • name – - The name of the frame to create.

  • fc – - The parent frames container

Returns:

The created frame.

Protected Functions

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

Discard the provided frame.

Parameters:

base – - Base pointer to the frame to discard.

struct DumpFrameTreeOptions#

A struct with options to tailor the content from a dumpFrameTree() call

Public Members

bool type_string = true#

include the frame’s typeString info

bool edge_type = false#

include the frame’s edge’s typeString info

bool healthy_status = false#

include the frame’s healthy status

bool ref_count = false#

include the frame’s reference count

bool edge_ref_count = false#

include the frame’s edge’s reference count

bool id = false#

include the frame’s tree id