#include <DebugDrawingManager.h>
Public Member Functions | |
DebugDrawingManager () | |
~DebugDrawingManager () | |
void | drawingFinished (Drawings::FieldDrawing drawingID) |
void | drawingFinished (Drawings::ImageDrawing drawingID) |
void | setImageID (ImageDrawingPaper imageDrawingPaper, ImageID imageID) |
ImageID | getImageID (ImageDrawingPaper imageDrawingPaper) |
void | setDebugDrawing (DebugDrawing *pDebugDrawing) |
void | notifyImage (ImageID imageID) |
void | showDrawingOnDrawingPaper (FieldDrawingPaper fieldDrawingPaper, Drawings::FieldDrawing fieldDrawing, bool show) |
void | showDrawingOnDrawingPaper (ImageDrawingPaper imageDrawingPaper, Drawings::ImageDrawing imageDrawing, bool show) |
void | rotate (FieldDrawingPaper fieldDrawingPaper) |
void | enableAutoRotate (FieldDrawingPaper fieldDrawingPaper, bool enable) |
bool | isAutoRotateEnabled (FieldDrawingPaper fieldDrawingPaper) |
bool | isDrawingShownOnDrawingPaper (FieldDrawingPaper fieldDrawingPaper, Drawings::FieldDrawing fieldDrawing) |
bool | isDrawingShownOnDrawingPaper (ImageDrawingPaper imageDrawingPaper, Drawings::ImageDrawing imageDrawing) |
XFORM | calcPaintXForm (CRect *dcRect, FieldDrawingPaper fieldDrawingPaper) |
void | paint (CDC *pDC, CRect *dcRect, FieldDrawingPaper fieldDrawingPaper) |
void | paint (CRect *dcRect, ImageDrawingPaper imageDrawingPaper) |
void | setCallBackMethod (FieldDrawingPaper fieldDrawingPaper, CWnd *pWnd) |
void | setCallBackMethod (ImageDrawingPaper imageDrawingPaper, CWnd *pWnd) |
void | copyDrawingPaperToClipBoard (FieldDrawingPaper drawingPaper) |
void | copyDrawingPaperToClipBoard (ImageDrawingPaper drawingPaper) |
void | copyImageToClipBoard (ImageDrawingPaper drawingPaper) |
void | saveProperties () |
void | loadProperties () |
void | zoomIn (FieldDrawingPaper drawingPaper) |
void | zoomOut (FieldDrawingPaper drawingPaper) |
void | zoomDrawingPaper (FieldDrawingPaper drawingPaper, double factor) |
void | setSendDebugImagesFromRobot (bool sendDebugImagesFromRobot) |
bool | getSendDebugImagesFromRobot () |
bool | getHighRes (ImageDrawingPaper drawingPaper) |
void | setHighRes (ImageDrawingPaper drawingPaper, bool highRes) |
Public Attributes | |
DebugDrawingManagerMessageHandler | messageHandler |
DebugDrawing | fieldPolygonsDrawingRed |
DebugDrawing | fieldPolygonsDrawingBlue |
DebugDrawing | fieldLinesDrawing |
ImageDrawingManager | imageDrawingManager |
Protected Member Functions | |
void | generateMetaFile (FieldDrawingPaper drawingPaper) |
void | repaintDrawingPaper (FieldDrawingPaper drawingPaper) |
void | repaintDrawingPapers (Drawings::FieldDrawing drawing) |
double | calculateScale (CRect *dcRect, double rotationAngle) |
void | sendDebugKeysForSimulatedRobots () |
Protected Attributes | |
DebugDrawing * | incompleteDrawing [Drawings::numberOfFieldDrawings+Drawings::numberOfImageDrawings] |
DebugDrawing * | fieldDrawing [Drawings::numberOfFieldDrawings] |
bool | showFieldDrawing [numberOfFieldDrawingPapers][Drawings::numberOfFieldDrawings] |
bool | fieldDrawingIsShownOnAtLeastOnePaper [Drawings::numberOfFieldDrawings] |
int | verticalRotationAngle [numberOfFieldDrawingPapers] |
int | horizontalRotationAngle [numberOfFieldDrawingPapers] |
bool | autoRotate [numberOfFieldDrawingPapers] |
HENHMETAFILE | metaFileHandleFieldDrawingPaper [numberOfFieldDrawingPapers] |
CWnd * | pWndField [numberOfFieldDrawingPapers] |
double | zoom [numberOfFieldDrawingPapers] |
Friends | |
class | DebugDrawingManagerMessageHandler |
Definition at line 24 of file DebugDrawingManager.h.
DebugDrawingManager::DebugDrawingManager | ( | ) |
Constructor
Definition at line 16 of file DebugDrawingManager.cpp.
References autoRotate, Player::blue, Drawings::fieldLines, fieldLinesDrawing, Drawings::fieldPolygons, fieldPolygonsDrawingBlue, fieldPolygonsDrawingRed, horizontalRotationAngle, DrawingPapers::mainWindow, Drawings::numberOfFieldDrawings, Drawings::numberOfImageDrawings, DrawingMethods::paintFieldLines(), DrawingMethods::paintFieldPolygons(), pWndField, Player::red, setDebugDrawing(), showFieldDrawing, verticalRotationAngle, and zoom.
DebugDrawingManager::~DebugDrawingManager | ( | ) |
Destructor
Definition at line 56 of file DebugDrawingManager.cpp.
References fieldDrawing, incompleteDrawing, Drawings::numberOfFieldDrawings, and Drawings::numberOfImageDrawings.
XFORM DebugDrawingManager::calcPaintXForm | ( | CRect * | dcRect, | |
FieldDrawingPaper | fieldDrawingPaper | |||
) |
Definition at line 271 of file DebugDrawingManager.cpp.
References autoRotate, calculateScale(), fromDegrees(), horizontalRotationAngle, verticalRotationAngle, and zoom.
Referenced by paint().
double DebugDrawingManager::calculateScale | ( | CRect * | dcRect, | |
double | rotationAngle | |||
) | [protected] |
Calculates how the image has to be scaled to fit in the rect
Definition at line 223 of file DebugDrawingManager.cpp.
References abs(), int(), and max.
Referenced by calcPaintXForm().
void DebugDrawingManager::copyDrawingPaperToClipBoard | ( | ImageDrawingPaper | drawingPaper | ) |
Copies the specified drawing paper to the clipboard.
drawingPaper | Specifies the drawing paper. |
Definition at line 406 of file DebugDrawingManager.cpp.
void DebugDrawingManager::copyDrawingPaperToClipBoard | ( | FieldDrawingPaper | drawingPaper | ) |
Copies the specified drawing paper to the clipboard.
drawingPaper | Specifies the drawing paper. |
Definition at line 371 of file DebugDrawingManager.cpp.
References Drawings::numberOfFieldDrawings, and PaintMethodsWin32::paintDebugDrawingToCDC().
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::copyImageToClipBoard | ( | ImageDrawingPaper | drawingPaper | ) |
Copies the image selected in the specified drawing paper to the clipboard.
drawingPaper | Specifies the drawing paper. |
Definition at line 414 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::drawingFinished | ( | Drawings::ImageDrawing | drawingID | ) |
Definition at line 82 of file DebugDrawingManager.cpp.
References Drawings::drawingOnImage, DebugDrawing::imageDrawingID, incompleteDrawing, Drawings::numberOfFieldDrawings, setDebugDrawing(), and DebugDrawing::typeOfDrawing.
void DebugDrawingManager::drawingFinished | ( | Drawings::FieldDrawing | drawingID | ) |
Definition at line 73 of file DebugDrawingManager.cpp.
References Drawings::drawingOnField, DebugDrawing::fieldDrawingID, incompleteDrawing, setDebugDrawing(), and DebugDrawing::typeOfDrawing.
Referenced by DebugDrawingManagerMessageHandler::handleMessage().
void DebugDrawingManager::enableAutoRotate | ( | FieldDrawingPaper | fieldDrawingPaper, | |
bool | enable | |||
) |
Enables or disables the auto rotate property of the specified drawing paper. If the auto rotate property is enabled, the paint method rotates the drawing paper such that it is shown with maximal size.
fieldDrawingPaper | The drawing paper. | |
enable | Whether or not to enable the auto rotate property. |
Definition at line 551 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::generateMetaFile | ( | FieldDrawingPaper | drawingPaper | ) | [protected] |
Generates a Metafile containing all the drawings of the specified
drawingPaper | Specifies the drawing paper. drawing paper. The handle to that Metafile is stored in the List of meta file handles. |
bool DebugDrawingManager::getHighRes | ( | ImageDrawingPaper | drawingPaper | ) |
Returns whether images are drawn in high resolution
Definition at line 626 of file DebugDrawingManager.cpp.
References ImageDrawingManager::getHighRes(), and imageDrawingManager.
Referenced by DebugDrawingManagerUI::showContextMenu().
ImageID DebugDrawingManager::getImageID | ( | ImageDrawingPaper | imageDrawingPaper | ) |
Returns the id of the image which is shown on the specified drawing paper.
imageDrawingPaper | Specifies the image drawing paper. |
Definition at line 543 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
bool DebugDrawingManager::getSendDebugImagesFromRobot | ( | ) |
Definition at line 616 of file DebugDrawingManager.cpp.
References ImageDrawingManager::getSendDebugImagesFromRobot(), and imageDrawingManager.
Referenced by DebugDrawingManagerUI::showContextMenu().
bool DebugDrawingManager::isAutoRotateEnabled | ( | FieldDrawingPaper | fieldDrawingPaper | ) |
fieldDrawingPaper | The drawing paper. |
Definition at line 563 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
bool DebugDrawingManager::isDrawingShownOnDrawingPaper | ( | ImageDrawingPaper | imageDrawingPaper, | |
Drawings::ImageDrawing | imageDrawing | |||
) |
imageDrawingPaper | The drawing paper. | |
imageDrawing | The image drawing. |
Definition at line 171 of file DebugDrawingManager.cpp.
bool DebugDrawingManager::isDrawingShownOnDrawingPaper | ( | FieldDrawingPaper | fieldDrawingPaper, | |
Drawings::FieldDrawing | fieldDrawing | |||
) |
fieldDrawingPaper | The drawing paper. | |
fieldDrawing | The field drawing. |
Definition at line 162 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::loadProperties | ( | ) |
Loads which drawings and which image are shown on which drawing paper and the rotation angle of the drawing papers from the registry.
Definition at line 421 of file DebugDrawingManager.cpp.
References autoRotate, fieldDrawingIsShownOnAtLeastOnePaper, Drawings::fieldLines, Drawings::getDrawingName(), DrawingPapers::getDrawingPaperName(), horizontalRotationAngle, imageDrawingManager, ImageDrawingManager::loadProperties(), DrawingPapers::mainWindow, Drawings::numberOfFieldDrawings, sendDebugKeysForSimulatedRobots(), showFieldDrawing, and verticalRotationAngle.
Referenced by CRobotControlMainFrame::OnCreate().
void DebugDrawingManager::notifyImage | ( | ImageID | imageID | ) |
Definition at line 588 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerMessageHandler::handleMessage().
void DebugDrawingManager::paint | ( | CRect * | dcRect, | |
ImageDrawingPaper | imageDrawingPaper | |||
) |
Paints the content of the specified drawing paper. Call this member function from the OnPaint function of the CWnd displaying the device context.
dcRect | Specifies the rect in the device context to paint to. | |
imageDrawingPaper | Specifies the drawing paper to paint. |
Definition at line 362 of file DebugDrawingManager.cpp.
References imageDrawingManager, and ImageDrawingManager::paint().
void DebugDrawingManager::paint | ( | CDC * | pDC, | |
CRect * | dcRect, | |||
FieldDrawingPaper | fieldDrawingPaper | |||
) |
Paints the content of the specified drawing paper. Call this member function from the OnPaint function of the CWnd displaying the device context.
pDC | A pointer to a device context. | |
dcRect | Specifies the rect in the device context to paint to. | |
fieldDrawingPaper | Specifies the drawing paper to paint. |
Definition at line 300 of file DebugDrawingManager.cpp.
References calcPaintXForm(), fieldDrawing, Drawings::numberOfFieldDrawings, PaintMethodsWin32::paintDebugDrawingToCDC(), and showFieldDrawing.
Referenced by CRobotControlFieldView::OnPaint(), and CRobotControlDialogBar::paintDrawingPaper().
void DebugDrawingManager::repaintDrawingPaper | ( | FieldDrawingPaper | drawingPaper | ) | [protected] |
Calls the RedrawWindow function of the CWnd object displaying the specified drawing paper.
drawingPaper | Specifies the drawing paper. |
Definition at line 198 of file DebugDrawingManager.cpp.
void DebugDrawingManager::repaintDrawingPapers | ( | Drawings::FieldDrawing | drawing | ) | [protected] |
Calls the RedrawWindow function of all CWnd objects displaying a drawing paper containing the specified drawing.
drawing | Specifies a drawing. |
Definition at line 209 of file DebugDrawingManager.cpp.
Referenced by setDebugDrawing().
void DebugDrawingManager::rotate | ( | FieldDrawingPaper | fieldDrawingPaper | ) |
Rotates the view of the specified drawing paper.
fieldDrawingPaper | The drawing paper. |
Definition at line 571 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::saveProperties | ( | ) |
Saves which drawings and which image are shown on which drawing paper and the rotation angle of the drawing papers to the reistry.
Definition at line 489 of file DebugDrawingManager.cpp.
References autoRotate, Drawings::getDrawingName(), DrawingPapers::getDrawingPaperName(), horizontalRotationAngle, imageDrawingManager, Drawings::numberOfFieldDrawings, ImageDrawingManager::saveProperties(), showFieldDrawing, and verticalRotationAngle.
Referenced by CRobotControlMainFrame::OnClose().
void DebugDrawingManager::sendDebugKeysForSimulatedRobots | ( | ) | [protected] |
Definition at line 130 of file DebugDrawingManager.cpp.
References DebugKey::always, DebugKey::disabled, fieldDrawingIsShownOnAtLeastOnePaper, CRobotControlDebugKeyTables::forSimulatedRobots, Drawings::getDebugKeyID(), getDebugKeyTables(), Drawings::numberOfFieldDrawings, CRobotControlDebugKeyTables::sendForSimulatedRobots(), and DebugKeyTable::set().
Referenced by loadProperties().
void DebugDrawingManager::setCallBackMethod | ( | ImageDrawingPaper | imageDrawingPaper, | |
CWnd * | pWnd | |||
) |
The DebugDrawingManager calls the RedrawWindow method of the CWnd object each time something changes at the specified drawing paper.
imageDrawingPaper | Specifies the drawing paper. | |
pWnd | A pointer to a CWnd object. |
Definition at line 189 of file DebugDrawingManager.cpp.
void DebugDrawingManager::setCallBackMethod | ( | FieldDrawingPaper | fieldDrawingPaper, | |
CWnd * | pWnd | |||
) |
The DebugDrawingManager calls the RedrawWindow method of the CWnd object each time something changes at the specified drawing paper.
fieldDrawingPaper | Specifies the drawing paper. | |
pWnd | A pointer to a CWnd object. |
Definition at line 180 of file DebugDrawingManager.cpp.
Referenced by CRobotControlFieldView::OnCreate(), and CRobotControlDialogBar::registerDrawingPaper().
void DebugDrawingManager::setDebugDrawing | ( | DebugDrawing * | pDebugDrawing | ) |
Gives the Debug Drawing Manager a reference to a debug drawing. This debug drawing is copied to an internal representation.
pDebugDrawing | Pointer to the debug drawing. |
Definition at line 92 of file DebugDrawingManager.cpp.
References Drawings::drawingOnField, Drawings::drawingOnImage, fieldDrawing, DebugDrawing::fieldDrawingID, imageDrawingManager, repaintDrawingPapers(), ImageDrawingManager::setDebugDrawing(), and DebugDrawing::typeOfDrawing.
Referenced by DebugDrawingManager(), drawingFinished(), DebugDrawingManagerMessageHandler::handleMessage(), and DebugDrawingManagerMessageHandler::repaintField().
void DebugDrawingManager::setHighRes | ( | ImageDrawingPaper | drawingPaper, | |
bool | highRes | |||
) |
Sets whether images are drawn in high resolution
Definition at line 631 of file DebugDrawingManager.cpp.
References imageDrawingManager, and ImageDrawingManager::setHighRes().
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::setImageID | ( | ImageDrawingPaper | imageDrawingPaper, | |
ImageID | imageID | |||
) |
Specifies which image is shown on the specified image drawing paper. Only one image can be shown on one image drawing paper.
imageDrawingPaper | Specifies the drawing paper where the image is shown. | |
imageID | Specifies the image that is shown. |
Definition at line 534 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::setSendDebugImagesFromRobot | ( | bool | sendDebugImagesFromRobot | ) |
Definition at line 611 of file DebugDrawingManager.cpp.
References imageDrawingManager, and ImageDrawingManager::setSendDebugImagesFromRobot().
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::showDrawingOnDrawingPaper | ( | ImageDrawingPaper | imageDrawingPaper, | |
Drawings::ImageDrawing | imageDrawing, | |||
bool | show | |||
) |
Specifies if the specified drawing is shown on the specified drawing paper.
imageDrawingPaper | The drawing paper. | |
imageDrawing | The debug drawing. | |
show | Specifies if the drawing is shown or not. |
Definition at line 152 of file DebugDrawingManager.cpp.
void DebugDrawingManager::showDrawingOnDrawingPaper | ( | FieldDrawingPaper | fieldDrawingPaper, | |
Drawings::FieldDrawing | fieldDrawing, | |||
bool | show | |||
) |
Specifies if the specified drawing is shown on the specified drawing paper.
fieldDrawingPaper | The drawing paper. | |
fieldDrawing | The debug drawing. | |
show | Specifies if the drawing is shown or not. |
Definition at line 112 of file DebugDrawingManager.cpp.
Referenced by DebugDrawingManagerUI::showContextMenu().
void DebugDrawingManager::zoomDrawingPaper | ( | FieldDrawingPaper | drawingPaper, | |
double | factor | |||
) |
Changes the magnification for the specified drawing paper according to factor
Definition at line 606 of file DebugDrawingManager.cpp.
References zoom.
Referenced by CRobotControlFieldView::OnMouseWheel().
void DebugDrawingManager::zoomIn | ( | FieldDrawingPaper | drawingPaper | ) |
Increases the magnification for the specified drawing paper
Definition at line 595 of file DebugDrawingManager.cpp.
References zoom.
void DebugDrawingManager::zoomOut | ( | FieldDrawingPaper | drawingPaper | ) |
Decreases the magnification for the specified drawing paper
Definition at line 601 of file DebugDrawingManager.cpp.
References zoom.
friend class DebugDrawingManagerMessageHandler [friend] |
Definition at line 249 of file DebugDrawingManager.h.
bool DebugDrawingManager::autoRotate[numberOfFieldDrawingPapers] [protected] |
Specifies if a special drawing paper has the auto rotate property
Definition at line 302 of file DebugDrawingManager.h.
Referenced by calcPaintXForm(), DebugDrawingManager(), loadProperties(), and saveProperties().
DebugDrawing* DebugDrawingManager::fieldDrawing[Drawings::numberOfFieldDrawings] [protected] |
Pointers to the debug drawings
Definition at line 285 of file DebugDrawingManager.h.
Referenced by paint(), setDebugDrawing(), and ~DebugDrawingManager().
bool DebugDrawingManager::fieldDrawingIsShownOnAtLeastOnePaper[Drawings::numberOfFieldDrawings] [protected] |
Stores if a special drawing is painted on at least one paper.
Definition at line 291 of file DebugDrawingManager.h.
Referenced by loadProperties(), and sendDebugKeysForSimulatedRobots().
field lines
Definition at line 134 of file DebugDrawingManager.h.
Referenced by DebugDrawingManager(), and DebugDrawingManagerMessageHandler::repaintField().
field polygons for the blue robot
Definition at line 133 of file DebugDrawingManager.h.
Referenced by DebugDrawingManager(), and DebugDrawingManagerMessageHandler::repaintField().
field polygons for the red robot
Definition at line 132 of file DebugDrawingManager.h.
Referenced by DebugDrawingManager(), and DebugDrawingManagerMessageHandler::repaintField().
int DebugDrawingManager::horizontalRotationAngle[numberOfFieldDrawingPapers] [protected] |
Rotation angle in degrees of each drawing paper if auto rotate displays that paper horizontal. Rotation angle of the drawing paper, if it has not the auto rotate property
Definition at line 299 of file DebugDrawingManager.h.
Referenced by calcPaintXForm(), DebugDrawingManager(), loadProperties(), and saveProperties().
Definition at line 313 of file DebugDrawingManager.h.
Referenced by CRobotControlDialogBar::getDebugImageCameraInfo(), getHighRes(), getSendDebugImagesFromRobot(), DebugDrawingManagerMessageHandler::handleMessage(), loadProperties(), paint(), saveProperties(), setDebugDrawing(), setHighRes(), and setSendDebugImagesFromRobot().
DebugDrawing* DebugDrawingManager::incompleteDrawing[Drawings::numberOfFieldDrawings+Drawings::numberOfImageDrawings] [protected] |
Pointers to the incomplete incoming drawings
Definition at line 281 of file DebugDrawingManager.h.
Referenced by drawingFinished(), DebugDrawingManagerMessageHandler::handleMessage(), and ~DebugDrawingManager().
Handles incoming Messages
Definition at line 33 of file DebugDrawingManager.h.
Referenced by CMessageHandlerForQueueToGUI::handleMessage().
HENHMETAFILE DebugDrawingManager::metaFileHandleFieldDrawingPaper[numberOfFieldDrawingPapers] [protected] |
The meta file handles of the field drawing papers
Definition at line 305 of file DebugDrawingManager.h.
CWnd* DebugDrawingManager::pWndField[numberOfFieldDrawingPapers] [protected] |
Pointer to the CWnds of where the drawing papers are shown.
Definition at line 308 of file DebugDrawingManager.h.
Referenced by DebugDrawingManager().
bool DebugDrawingManager::showFieldDrawing[numberOfFieldDrawingPapers][Drawings::numberOfFieldDrawings] [protected] |
Stores if a special drawing is painted on a special paper.
Definition at line 288 of file DebugDrawingManager.h.
Referenced by DebugDrawingManager(), loadProperties(), paint(), and saveProperties().
int DebugDrawingManager::verticalRotationAngle[numberOfFieldDrawingPapers] [protected] |
Rotation angle in degrees of each drawing paper if auto rotate displays that paper vertical
Definition at line 295 of file DebugDrawingManager.h.
Referenced by calcPaintXForm(), DebugDrawingManager(), loadProperties(), and saveProperties().
double DebugDrawingManager::zoom[numberOfFieldDrawingPapers] [protected] |
Definition at line 310 of file DebugDrawingManager.h.
Referenced by calcPaintXForm(), DebugDrawingManager(), zoomDrawingPaper(), zoomIn(), and zoomOut().