RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
TreeState Class Reference

The tree structure state of a work cell. More...

#include <TreeState.hpp>

Public Types

typedef std::vector< Frame * > FrameList
 vector of frames
 

Public Member Functions

 TreeState ()
 Construct an empty TreeState.
 
 TreeState (rw::core::Ptr< StateSetup > setup)
 Construct an empty TreeState.
 
 TreeState (const TreeState &other)
 Copy constructor. More...
 
virtual ~TreeState ()
 destructor
 
const rw::kinematics::FramegetParent (rw::core::Ptr< const rw::kinematics::Frame > frame) const
 The parent frame of frame. More...
 
rw::kinematics::FramegetParent (rw::core::Ptr< rw::kinematics::Frame > frame) const
 The parent frame of frame. More...
 
const FrameListgetChildren (rw::core::Ptr< const Frame > frame) const
 The child frames of frame. More...
 
void attachFrame (rw::core::Ptr< Frame > frame, rw::core::Ptr< Frame > parent)
 Move a frame within the tree. More...
 
rw::core::Ptr< StateSetupgetStateSetup () const
 gets the StateSetup used to create the TreeState More...
 

Detailed Description

The tree structure state of a work cell.

The tree structure state gives access to the parent and child frames of a frame.

Currently modification of the tree structure is not supported. (This implementation simply forwards to the non-public Tree data structure.)

Tree structure states can be copied and assigned freely.

Constructor & Destructor Documentation

◆ TreeState()

TreeState ( const TreeState other)
explicit

Copy constructor.

Parameters
other[in] other TreeState to copy.

Member Function Documentation

◆ attachFrame()

void attachFrame ( rw::core::Ptr< Frame frame,
rw::core::Ptr< Frame parent 
)

Move a frame within the tree.

The frame frame is detached from its parent and reattached to parent. The frames frame and parent must both belong to the same tree.

We may want to later restrict this method so that only frames of certain types can be moved.

Parameters
frame[in] The frame to move.
parent[in] The frame to attach frame to.

◆ getChildren()

const FrameList& getChildren ( rw::core::Ptr< const Frame frame) const

The child frames of frame.

(We should query the modifiable part of the tree here, but that is not implemented yet.)

Note that we break const-correctness. We treat TreeState as an implementation detail upon which an iterator interface in Frame is then built.

Parameters
frame[in] The frame for which to retrieve the children.
Returns
The children of the frame if any children exist, else NULL.

◆ getParent() [1/2]

const rw::kinematics::Frame* getParent ( rw::core::Ptr< const rw::kinematics::Frame frame) const

The parent frame of frame.

If the frame has no parent, then NULL is returned.

(We should query the modifiable part of the tree here, but that is not implemented yet.)

Parameters
frame[in] The frame for which to retrieve the parent.
Returns
The parent of the frame or NULL if the frame has no parent.

◆ getParent() [2/2]

The parent frame of frame.

If the frame has no parent, then NULL is returned.

(We should query the modifiable part of the tree here, but that is not implemented yet.)

Parameters
frame[in] The frame for which to retrieve the parent.
Returns
The parent of the frame or NULL if the frame has no parent.

◆ getStateSetup()

rw::core::Ptr<StateSetup> getStateSetup ( ) const

gets the StateSetup used to create the TreeState

Returns
the StateSetup

The documentation for this class was generated from the following file: