RobWorkProject
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 (boost::shared_ptr< StateSetup > setup)
 Construct an empty TreeState.
 
 TreeState (const TreeState &other)
 Copy constructor. More...
 
virtual ~TreeState ()
 destructor
 
const FramegetParent (const Frame *frame) const
 The parent frame of frame. More...
 
FramegetParent (Frame *frame) const
 The parent frame of frame. More...
 
const FrameListgetChildren (const Frame *frame) const
 The child frames of frame. More...
 
void attachFrame (Frame *frame, Frame *parent)
 Move a frame within the tree. More...
 
boost::shared_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 ( Frame frame,
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 ( 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 Frame* getParent ( const 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]

Frame* getParent ( 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.

◆ getStateSetup()

boost::shared_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: