![]() |
RobWorkProject
25.2.11-
|
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::Frame * | getParent (rw::core::Ptr< const rw::kinematics::Frame > frame) const |
The parent frame of frame. More... | |
rw::kinematics::Frame * | getParent (rw::core::Ptr< rw::kinematics::Frame > frame) const |
The parent frame of frame. More... | |
const FrameList & | getChildren (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< StateSetup > | getStateSetup () const |
gets the StateSetup used to create the TreeState More... | |
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.
Copy constructor.
other | [in] other TreeState to copy. |
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.
frame | [in] The frame to move. |
parent | [in] The frame to attach frame to. |
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.
frame | [in] The frame for which to retrieve the children. |
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.)
frame | [in] The frame for which to retrieve the parent. |
rw::kinematics::Frame* getParent | ( | rw::core::Ptr< 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.)
frame | [in] The frame for which to retrieve the parent. |
rw::core::Ptr<StateSetup> getStateSetup | ( | ) | const |
gets the StateSetup used to create the TreeState