Class Frame#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class Frame : public Karana::Core::Base#

The class for a frame in the frames tree.

See The frames layer 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.

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

Get the type string of the frame.

Returns:

The type string.

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

Get the name of the frame.

Get the parent frame.

Returns:

The name of the frame.

Returns:

The parent frame.

const kc::ks_ptr<EdgeFrame2Frame> &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<ChainedFrame2Frame> &frame2Frame(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 ChainedFrame2Frame connecting this frame (o-frame) and the target frame (p-frame).

const kc::ks_ptr<ChainedFrame2Frame> &frame2FrameRef(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 ChainedFrame2Frame connecting this frame (o-frame) and the target frame (p-frame).

const kc::ks_ptr<OrientedChainedFrame2Frame> &orientedFrame2Frame(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 OrientedChainedFrame2Frame connecting this frame (o-frame) and the target frame (p-frame).

const kc::ks_ptr<OrientedChainedFrame2Frame> &orientedFrame2FrameRef(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 OrientedChainedFrame2Frame 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)#

Constructor for the Frame class.

Parameters:
  • name – The name of the frame.

  • frame_container – The container of the frame.

std::string dumpString(const std::string &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(const std::string &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.

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 typeString = true#

include the frame’s typeString info

bool edgeType = false#

include the frame’s edge’s typeString info

bool lockStatus = false#

include the frame’s lock status

bool refCount = false#

include the frame’s reference count

bool edgeRefCount = false#

include the frame’s edge’s reference count

bool id = false#

include the frame’s tree id