DebugDrawing Class Reference

#include <DebugDrawing.h>

List of all members.

Public Types

 MAX_NUMBER_OF_POINTS = 16
enum  { MAX_NUMBER_OF_POINTS = 16 }

Public Member Functions

 DebugDrawing ()
 DebugDrawing (Drawings::FieldDrawing fieldDrawing)
 DebugDrawing (Drawings::ImageDrawing imageDrawing)
 DebugDrawing (const DebugDrawing &other)
 DebugDrawing (const DebugDrawing *pDebugDrawing)
 ~DebugDrawing ()
void reset ()
const DebugDrawingoperator= (const DebugDrawing &other)
const DebugDrawingoperator+= (const DebugDrawing &other)
void arrow (Vector2< double > offset, Vector2< double > direction, Color color)
void arrow (int xStart, int yStart, int xEnd, int yEnd, Drawings::PenStyle penStyle, int width, Color color)
void line (int xStart, int yStart, int xEnd, int yEnd, Drawings::PenStyle penStyle, int width, Color color)
void line (int xStart, int yStart, int xEnd, int yEnd)
void polygon (const Vector2< int > *points, int nCount, int width, Drawings::PenStyle penStyle, Color penColor, Drawings::FillStyle fillStyle, Color fillColor)
void rectangle (int left, int right, int top, int bottom, int width, Drawings::PenStyle penStyle, Color penColor, Drawings::FillStyle fillStyle, Color fillColor)
void rectangle (int left, int right, int top, int bottom, Color color)
void dot (int x, int y, Color penColor, Color fillColor)
void largeDot (int x, int y, Color penColor, Color fillColor)
void ellipse (int left, int right, int top, int bottom, Color color)
void ellipse (int left, int right, int top, int bottom, int width, Drawings::PenStyle penStyle, Color penColor, Drawings::FillStyle fillStyle, Color fillColor)
void circle (int xCenter, int yCenter, int radius, int penWidth, Drawings::PenStyle penStyle, Color penColor, Drawings::FillStyle fillStyle, Color fillColor)
void pose2DSample (Pose2D pose)
void pose2DSample (Pose2D pose, Color color)
bool addShapeFromQueue (InMessage &message, Drawings::ShapeType shapeType)

Public Attributes

List< Element * > elements
Drawings::TypeOfDrawing typeOfDrawing
Drawings::FieldDrawing fieldDrawingID
Drawings::ImageDrawing imageDrawingID

Classes

struct  Color
class  Element
class  Ellipse
class  Line
class  Polygon


Detailed Description

The DebugDrawing class defines a class of drawing objects for debug purposes.

The DebugDrawing object provides member functions for painting simple graphic structures like lines, ellipses, polygons and text. To use a DebugDrawing object, construct it, and then call its member functions.

Author:
Matthias Jüngel

Definition at line 25 of file DebugDrawing.h.


Member Enumeration Documentation

anonymous enum

the maximum number of points in a polygon

Enumerator:
MAX_NUMBER_OF_POINTS 

Definition at line 129 of file DebugDrawing.h.


Constructor & Destructor Documentation

DebugDrawing::DebugDrawing (  )  [inline]

Default constructor.

Definition at line 29 of file DebugDrawing.h.

DebugDrawing::DebugDrawing ( Drawings::FieldDrawing  fieldDrawing  ) 

Constructs a DebugDrawing object.

Definition at line 10 of file DebugDrawing.cpp.

References Drawings::drawingOnField, fieldDrawingID, and typeOfDrawing.

DebugDrawing::DebugDrawing ( Drawings::ImageDrawing  imageDrawing  ) 

Constructs a DebugDrawing object.

Definition at line 17 of file DebugDrawing.cpp.

References Drawings::drawingOnImage, imageDrawingID, and typeOfDrawing.

DebugDrawing::DebugDrawing ( const DebugDrawing other  ) 

Copy constructor for a DebugDrawing object.

Definition at line 67 of file DebugDrawing.cpp.

DebugDrawing::DebugDrawing ( const DebugDrawing pDebugDrawing  ) 

Copy constructor for a DebugDrawing object.

Definition at line 72 of file DebugDrawing.cpp.

DebugDrawing::~DebugDrawing (  )  [inline]

Destructor.

Definition at line 44 of file DebugDrawing.h.

References reset().


Member Function Documentation

bool DebugDrawing::addShapeFromQueue ( InMessage message,
Drawings::ShapeType  shapeType 
)

Definition at line 351 of file DebugDrawing.cpp.

References Drawings::arrow, InMessage::bin, Drawings::bs_null, Drawings::bs_solid, Drawings::circle, Drawings::dot, Drawings::filledCircle, Drawings::largeDot, Drawings::line, Drawings::octangle, Drawings::octangleRGB, Drawings::ps_solid, Vector2< V >::x, and Vector2< V >::y.

Referenced by DebugDrawingManagerMessageHandler::handleMessage(), and RobotConsole::handleMessage().

void DebugDrawing::arrow ( int  xStart,
int  yStart,
int  xEnd,
int  yEnd,
Drawings::PenStyle  penStyle,
int  width,
Color  color 
)

Adds an arrow to the debug drawing

Parameters:
xStart Specifies the x-coordinate of the startpoint for the line.
yStart Specifies the y-coordinate of the startpoint for the line.
xEnd Specifies the x-coordinate of the endpoint for the line.
yEnd Specifies the y-coordinate of the endpoint for the line.
penStyle not used!
width not used!
color Specifies the color of the line.

Definition at line 102 of file DebugDrawing.cpp.

void DebugDrawing::arrow ( Vector2< double >  offset,
Vector2< double >  direction,
Color  color 
)

Adds an arrow to the debug drawing

Parameters:
offset vector pointing to the tip of the arrow
direction vector pointing in the direction of the arrow
color 

Definition at line 85 of file DebugDrawing.cpp.

References Drawings::ps_solid, Vector2< V >::x, and Vector2< V >::y.

Referenced by DrawingMethods::paintLinesPerceptForFieldView(), and DrawingMethods::paintLinesPerceptForImageView().

void DebugDrawing::circle ( int  xCenter,
int  yCenter,
int  radius,
int  penWidth,
Drawings::PenStyle  penStyle,
Color  penColor,
Drawings::FillStyle  fillStyle,
Color  fillColor 
)

Adds a filled circle to the debug drawing. The figure drawn by this function extends up to, but does not include, the right and bottom coordinates.

Parameters:
xCenter Specifies the x-coordinate of the center of the circle.
yCenter Specifies the y-coordinate of the center of the circle.
radius Specifies the radius of the circle.
penWidth Specifies the width of the pen to draw with.
penStyle Specifies the penStyle of the border.
penColor Specifies the color of the border.
fillStyle Specifies the fillStyle of the ellipse.
fillColor Specifies the color of the ellipse.

Definition at line 293 of file DebugDrawing.cpp.

Referenced by DrawingMethods::paintBallPerceptForFieldView(), DrawingMethods::paintBallPerceptForImageView(), DrawingMethods::paintLandmarksPerceptForFieldView(), DrawingMethods::paintLinesPerceptForFieldView(), DrawingMethods::paintLinesPerceptForImageView(), DrawingMethods::paintObstaclesPerceptForFieldView(), DrawingMethods::paintObstaclesPerceptForImageView(), DrawingMethods::paintPerceptCollectionForRadarView(), DrawingMethods::paintPSDPerceptForImageView(), and DrawingMethods::paintWorldState().

void DebugDrawing::dot ( int  x,
int  y,
Color  penColor,
Color  fillColor 
)

Adds a filled square to the debug drawing. The border of the square is a solid line with width 0. The square is a 3x3 square.

Parameters:
x Specifies the center of the dot.
y Specifies the center of the dot.
penColor Specifies the penColor of the dot.
fillColor Specifies the fillColor of the dot.

Definition at line 172 of file DebugDrawing.cpp.

References Drawings::bs_solid, Drawings::ps_solid, Vector2< V >::x, and Vector2< V >::y.

Referenced by DrawingMethods::paintBallPerceptForImageView(), and DrawingMethods::paintObstaclesPerceptForImageView().

void DebugDrawing::ellipse ( int  left,
int  right,
int  top,
int  bottom,
int  width,
Drawings::PenStyle  penStyle,
Color  penColor,
Drawings::FillStyle  fillStyle,
Color  fillColor 
)

Adds a filled ellipse to the debug drawing. The ellipse extends up to, but does not include, the right and bottom coordinates. The figure drawn by this function extends up to, but does not include, the right and bottom coordinates.

Parameters:
left Specifies the x-coordinate of the upper-left corner of the ellipse’s bounding rectangle.
right Specifies the x-coordinate of the lower-right corner of the ellipse’s bounding rectangle.
top Specifies the y-coordinate of the upper-left corner of the ellipse’s bounding rectangle.
bottom Specifies the y-coordinate of the lower-right corner of the ellipse’s bounding rectangle.
width Specifies the width of the border.
penStyle Specifies the penStyle of the border.
penColor Specifies the color of the border.
fillStyle Specifies the fillStyle of the ellipse.
fillColor Specifies the color of the ellipse.

Definition at line 259 of file DebugDrawing.cpp.

References DebugDrawing::Ellipse::bottom, DebugDrawing::Ellipse::fillColor, DebugDrawing::Ellipse::fillStyle, DebugDrawing::Ellipse::left, DebugDrawing::Element::penColor, DebugDrawing::Element::penStyle, DebugDrawing::Ellipse::right, DebugDrawing::Ellipse::top, and DebugDrawing::Element::width.

void DebugDrawing::ellipse ( int  left,
int  right,
int  top,
int  bottom,
Color  color 
)

Adds a filled ellipse to the debug drawing. The border of the ellipse is a solid black line with width 1. The ellipse extends up to, but does not include, the right and bottom coordinates. The figure drawn by this function extends up to, but does not include, the right and bottom coordinates.

Parameters:
left Specifies the x-coordinate of the upper-left corner of the ellipse’s bounding rectangle.
right Specifies the x-coordinate of the lower-right corner of the ellipse’s bounding rectangle.
top Specifies the y-coordinate of the upper-left corner of the ellipse’s bounding rectangle.
bottom Specifies the y-coordinate of the lower-right corner of the ellipse’s bounding rectangle.
color Specifies the color of the ellipse.

Definition at line 285 of file DebugDrawing.cpp.

References Drawings::bs_solid, and Drawings::ps_solid.

Referenced by DrawingMethods::paintFieldLines().

void DebugDrawing::largeDot ( int  x,
int  y,
Color  penColor,
Color  fillColor 
)

Adds a filled square to the debug drawing. The border of the square is a solid line with width 5. The square is a 10x10 square.

Parameters:
x Specifies the center of the dot.
y Specifies the center of the dot.
penColor Specifies the penColor of the dot.
fillColor Specifies the fillColor of the dot.

Definition at line 199 of file DebugDrawing.cpp.

References Drawings::bs_solid, Drawings::ps_solid, Vector2< V >::x, and Vector2< V >::y.

Referenced by DrawingMethods::paintCollisionPerceptForFieldView(), and DrawingMethods::paintFieldLines().

void DebugDrawing::line ( int  xStart,
int  yStart,
int  xEnd,
int  yEnd 
)

Adds a line to the debug drawing. The line is a solid black line with width 1.

Parameters:
xStart Specifies the x-coordinate of the startpoint for the line.
yStart Specifies the y-coordinate of the startpoint for the line.
xEnd Specifies the x-coordinate of the endpoint for the line.
yEnd Specifies the y-coordinate of the endpoint for the line.

Definition at line 139 of file DebugDrawing.cpp.

References Drawings::ps_solid.

void DebugDrawing::line ( int  xStart,
int  yStart,
int  xEnd,
int  yEnd,
Drawings::PenStyle  penStyle,
int  width,
Color  color 
)

Adds a line to the debug drawing.

Parameters:
xStart Specifies the x-coordinate of the startpoint for the line.
yStart Specifies the y-coordinate of the startpoint for the line.
xEnd Specifies the x-coordinate of the endpoint for the line.
yEnd Specifies the y-coordinate of the endpoint for the line.
penStyle Specifies the penStyle of the Line.
width Specifies the width of the line.
color Specifies the color of the line.

Definition at line 117 of file DebugDrawing.cpp.

References DebugDrawing::Element::penColor, DebugDrawing::Element::penStyle, DebugDrawing::Element::width, DebugDrawing::Line::xEnd, DebugDrawing::Line::xStart, DebugDrawing::Line::yEnd, and DebugDrawing::Line::yStart.

Referenced by DrawingMethods::paintAngleBoundaryToImage(), DrawingMethods::paintBallPerceptForFieldView(), DrawingMethods::paintEdgesPerceptForFieldView(), DrawingMethods::paintEdgesPerceptForImageView(), DrawingMethods::paintFieldLines(), DrawingMethods::paintFreePartOfGoalModelForImageView(), DrawingMethods::paintFreePartOfGoalPerceptForImageView(), DrawingMethods::paintLandmarksPerceptForFieldView(), DrawingMethods::paintLandmarksPerceptForImageView(), DrawingMethods::paintObstaclesModelForFieldView(), DrawingMethods::paintObstaclesModelForImageView(), DrawingMethods::paintObstaclesPerceptForFieldView(), DrawingMethods::paintObstaclesPerceptForImageView(), DrawingMethods::paintPlayersPerceptForFieldView(), DrawingMethods::paintPSDPerceptForImageView(), and DrawingMethods::paintWorldState().

const DebugDrawing & DebugDrawing::operator+= ( const DebugDrawing other  ) 

Adds the contents of another debug drawing to this one.

Definition at line 36 of file DebugDrawing.cpp.

References elements, DebugDrawing::Element::ELLIPSE, DebugDrawing::Element::LINE, and DebugDrawing::Element::POLYGON.

const DebugDrawing & DebugDrawing::operator= ( const DebugDrawing other  ) 

Assignment operator.

Definition at line 23 of file DebugDrawing.cpp.

References fieldDrawingID, imageDrawingID, reset(), and typeOfDrawing.

void DebugDrawing::polygon ( const Vector2< int > *  points,
int  nCount,
int  width,
Drawings::PenStyle  penStyle,
Color  penColor,
Drawings::FillStyle  fillStyle,
Color  fillColor 
)

Adds a polygon to the debug drawing.

Parameters:
points Points to an array of points that specifies the vertices of the polygon. Each point in the array is a Point.
nCount Specifies the number of vertices in the array.
width Specifies the width of the border.
penStyle Specifies the penStyle of the border.
penColor Specifies the color of the border.
fillStyle Specifies the fillStyle of the polygon.
fillColor Specifies the color of the polygon.

Definition at line 150 of file DebugDrawing.cpp.

References DebugDrawing::Polygon::fillColor, DebugDrawing::Polygon::fillStyle, DebugDrawing::Polygon::nCount, DebugDrawing::Element::penColor, DebugDrawing::Element::penStyle, DebugDrawing::Polygon::points, and DebugDrawing::Element::width.

Referenced by DrawingMethods::drawRobot(), and DrawingMethods::paintFieldPolygons().

void DebugDrawing::pose2DSample ( Pose2D  pose,
Color  color 
)

draws a Pose2D as an Arrow on the field

Definition at line 332 of file DebugDrawing.cpp.

References Drawings::ps_solid, Pose2D::translation, Vector2< V >::x, and Vector2< V >::y.

void DebugDrawing::pose2DSample ( Pose2D  pose  ) 

draws a Pose2D as an Arrow on the field

Definition at line 316 of file DebugDrawing.cpp.

References Pose2D::translation, Vector2< V >::x, and Vector2< V >::y.

void DebugDrawing::rectangle ( int  left,
int  right,
int  top,
int  bottom,
Color  color 
) [inline]

Adds a filled rectangle to the debug drawing. The border of the rectangle is a solid black line with width 1. The rectangle extends up to, but does not include, the right and bottom coordinates.

Parameters:
left Specifies the x-coordinate of the upper-left corner of the rectangle.
right Specifies the x-coordinate of the lower-right corner of the rectangle.
top Specifies the y-coordinate of the upper-left corner of the rectangle.
bottom Specifies the y-coordinate of the lower-right corner of the rectangle.
color Specifies the color of the rectangle.

Definition at line 286 of file DebugDrawing.h.

References Drawings::bs_solid, Drawings::ps_solid, and rectangle().

void DebugDrawing::rectangle ( int  left,
int  right,
int  top,
int  bottom,
int  width,
Drawings::PenStyle  penStyle,
Color  penColor,
Drawings::FillStyle  fillStyle,
Color  fillColor 
)

Adds a filled rectangle to the debug drawing. The rectangle extends up to, but does not include, the right and bottom coordinates.

Parameters:
left Specifies the x-coordinate of the upper-left corner of the rectangle.
right Specifies the x-coordinate of the lower-right corner of the rectangle.
top Specifies the y-coordinate of the upper-left corner of the rectangle.
bottom Specifies the y-coordinate of the lower-right corner of the rectangle.
width Specifies the width of the border.
penStyle Specifies the penStyle of the border.
penColor Specifies the color of the border.
fillStyle Specifies the fillStyle of the ellipse.
fillColor Specifies the color of the ellipse.

Definition at line 227 of file DebugDrawing.cpp.

References Vector2< V >::x, and Vector2< V >::y.

Referenced by DrawingMethods::paintFieldPolygons(), and rectangle().

void DebugDrawing::reset (  ) 

The function empties the drawing.

Definition at line 77 of file DebugDrawing.cpp.

References elements.

Referenced by DebugDrawingManagerMessageHandler::handleMessage(), RobotConsole::handleMessage(), operator=(), operator>>(), and ~DebugDrawing().


Member Data Documentation

List<Element*> DebugDrawing::elements

Contains all elements of this debug drawing

Definition at line 171 of file DebugDrawing.h.

Referenced by operator+=(), operator<<(), operator>>(), PaintMethodsWin32::paintDebugDrawingToCDC(), and reset().

Drawings::FieldDrawing DebugDrawing::fieldDrawingID

Definition at line 383 of file DebugDrawing.h.

Referenced by DebugDrawing(), DebugDrawingManager::drawingFinished(), RobotConsole::handleMessage(), operator<<(), operator=(), operator>>(), and DebugDrawingManager::setDebugDrawing().

Drawings::ImageDrawing DebugDrawing::imageDrawingID

Definition at line 384 of file DebugDrawing.h.

Referenced by DebugDrawing(), DebugDrawingManager::drawingFinished(), DebugDrawingManagerMessageHandler::handleMessage(), RobotConsole::handleMessage(), operator<<(), operator=(), operator>>(), and ImageDrawingManager::setDebugDrawing().

Drawings::TypeOfDrawing DebugDrawing::typeOfDrawing

the kind of the drawing

Definition at line 382 of file DebugDrawing.h.

Referenced by DebugDrawing(), DebugDrawingManager::drawingFinished(), RobotConsole::handleMessage(), operator<<(), operator=(), operator>>(), and DebugDrawingManager::setDebugDrawing().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:27:38 2006 for DT2005.panorama by  doxygen 1.4.7