Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FieldView Class Reference

Drawing widget that draws an (MSL-) soccer field with robots, opponents, and balls. More...

#include <>>

Public Member Functions

 FieldView (fawkes::WorldInfoDataContainer *data, bool show_pose=true, bool show_ball=true, bool show_opponents=false)
 Constructor.
virtual ~FieldView ()
 Destructor.
bool toggle_show_pose (Glib::ustring name)
 Toggle whether to show the pose of the specified robot.
bool toggle_show_ball (Glib::ustring name)
 Toggle whether to show the ball detected by the specified robot.
bool toggle_show_opponents (Glib::ustring name)
 Toggle whether to show the opponents seen by the specified robot.
void remove_host (Glib::ustring name)
 Remove a host.

Protected Member Functions

virtual bool on_draw (const Cairo::RefPtr< Cairo::Context > &context)
 Overloaded signal handler.

Detailed Description

Drawing widget that draws an (MSL-) soccer field with robots, opponents, and balls.

Author
Daniel Beck

Definition at line 33 of file field_view.h.

Constructor & Destructor Documentation

FieldView::FieldView ( fawkes::WorldInfoDataContainer data,
bool  show_pose = true,
bool  show_ball = true,
bool  show_opponents = false 
)

Constructor.

Parameters
show_posedefault value for show pose
show_balldefault value for show ball
show_opponentsdefault value for show opponents
datapointer to a WorldInfoDataContainer that is used as the data source

Definition at line 47 of file field_view.cpp.

FieldView::~FieldView ( )
virtual

Destructor.

Definition at line 60 of file field_view.cpp.

Member Function Documentation

bool FieldView::on_draw ( const Cairo::RefPtr< Cairo::Context > &  context)
protectedvirtual

Overloaded signal handler.

This is were the drawing action happens.

Parameters
contextcairo context for drawing
Returns
always true

Definition at line 141 of file field_view.cpp.

References fawkes::HomCoord::x(), fawkes::HomPose2d::x(), fawkes::HomCoord::y(), fawkes::HomPose2d::y(), and fawkes::HomPose2d::yaw().

void FieldView::remove_host ( Glib::ustring  name)

Remove a host.

Parameters
namethe name of the host to be removed.

Definition at line 128 of file field_view.cpp.

bool FieldView::toggle_show_ball ( Glib::ustring  name)

Toggle whether to show the ball detected by the specified robot.

Parameters
namethe hostname of the robot
Returns
true if the ball wasn't shown before, false otherwise

Definition at line 89 of file field_view.cpp.

bool FieldView::toggle_show_opponents ( Glib::ustring  name)

Toggle whether to show the opponents seen by the specified robot.

Parameters
namethe hostname of the robot
Returns
true if the opponents weren't shown before, false otherwise

Definition at line 109 of file field_view.cpp.

bool FieldView::toggle_show_pose ( Glib::ustring  name)

Toggle whether to show the pose of the specified robot.

Parameters
namethe hostname of the robot
Returns
true if the pose wasn't shown before, false otherwise

Definition at line 69 of file field_view.cpp.


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