#include <ImageDrawingManager.h>
Public Member Functions | |
ImageDrawingManager () | |
~ImageDrawingManager () | |
void | setDebugDrawing (DebugDrawing *pDebugDrawing) |
void | setImageID (ImageDrawingPaper imageDrawingPaper, ImageID imageID) |
ImageID | getImageID (ImageDrawingPaper imageDrawingPaper) |
void | notifyImage (ImageID imageID) |
void | showDrawingOnDrawingPaper (ImageDrawingPaper imageDrawingPaper, Drawings::ImageDrawing imageDrawing, bool show) |
bool | isDrawingShownOnDrawingPaper (ImageDrawingPaper imageDrawingPaper, Drawings::ImageDrawing imageDrawing) |
void | paint (CRect *rect, ImageDrawingPaper imageDrawingPaper) |
void | setWnd (ImageDrawingPaper imageDrawingPaper, CWnd *pWnd) |
void | copyDrawingPaperToClipBoard (ImageDrawingPaper drawingPaper) |
void | copyImageToClipBoard (ImageDrawingPaper drawingPaper) |
void | saveProperties () |
void | loadProperties () |
void | repaintDrawingPapers (ImageID imageID) |
void | setSendDebugImagesFromRobot (bool sendDebugImagesFromRobot) |
bool | getSendDebugImagesFromRobot () |
bool | getHighRes (ImageDrawingPaper drawingPaper) |
void | setHighRes (ImageDrawingPaper drawingPaper, bool highRes) |
Public Attributes | |
Image | imageYUV [numberOfImageIDs] |
Private Member Functions | |
void | generateMetaFile (ImageDrawingPaper drawingPaper) |
void | repaintDrawingPaper (ImageDrawingPaper drawingPaper) |
void | repaintDrawingPapers (Drawings::ImageDrawing drawing) |
void | createNewBitmap (ImageDrawingPaper drawingPaper) |
void | drawDrawingPaperToOffScreenDC (ImageDrawingPaper drawingPaper) |
void | drawImageToOffScreenDC (ImageDrawingPaper drawingPaper) |
void | drawDrawingToOffScreenDC (Drawings::ImageDrawing drawing, ImageDrawingPaper drawingPaper) |
void | sendDebugKeysForSimulatedRobots () |
Private Attributes | |
DebugDrawing * | imageDrawing [Drawings::numberOfImageDrawings] |
bool | isDrawingValid [Drawings::numberOfImageDrawings] |
CDC | dcOffScreen [numberOfImageDrawingPapers] |
CBitmap * | bmpOffScreen [numberOfImageDrawingPapers] |
HBITMAP | oldBitmap [numberOfImageDrawingPapers] |
int | currentWidth [numberOfImageDrawingPapers] |
int | currentHeight [numberOfImageDrawingPapers] |
bool | showImageDrawing [numberOfImageDrawingPapers][Drawings::numberOfImageDrawings] |
bool | imageDrawingIsShownOnAtLeastOnePaper [Drawings::numberOfImageDrawings] |
bool | debugImageIsShownAtLeastOnce [Images::numberOfImageIDs] |
ImageID | imageID [numberOfImageDrawingPapers] |
CWnd * | pWnd [numberOfImageDrawingPapers] |
bool | sendDebugImagesFromRobot |
bool | highRes [numberOfImageDrawingPapers] |
Definition at line 27 of file ImageDrawingManager.h.
ImageDrawingManager::ImageDrawingManager | ( | ) |
Constructor
Definition at line 15 of file ImageDrawingManager.cpp.
References bmpOffScreen, DrawingPapers::getDrawingPaperName(), highRes, imageDrawing, imageID, isDrawingValid, DrawingPapers::largeImageViewer, Images::noImage, Drawings::numberOfImageDrawings, pWnd, and sendDebugImagesFromRobot.
ImageDrawingManager::~ImageDrawingManager | ( | ) |
Destructor
Definition at line 37 of file ImageDrawingManager.cpp.
References bmpOffScreen, dcOffScreen, imageDrawing, Drawings::numberOfImageDrawings, and oldBitmap.
void ImageDrawingManager::copyDrawingPaperToClipBoard | ( | ImageDrawingPaper | drawingPaper | ) |
Copies the specified drawing paper to the clipboard.
drawingPaper | Specifies the drawing paper. |
Definition at line 227 of file ImageDrawingManager.cpp.
References Drawings::numberOfImageDrawings, and PaintMethodsWin32::paintDebugDrawingToCDC().
void ImageDrawingManager::copyImageToClipBoard | ( | ImageDrawingPaper | drawingPaper | ) |
Copies the image selected in the specified drawing paper to the clipboard.
drawingPaper | Specifies the drawing paper. |
Definition at line 262 of file ImageDrawingManager.cpp.
void ImageDrawingManager::createNewBitmap | ( | ImageDrawingPaper | drawingPaper | ) | [private] |
Definition at line 402 of file ImageDrawingManager.cpp.
References bmpOffScreen, currentHeight, currentWidth, dcOffScreen, and oldBitmap.
void ImageDrawingManager::drawDrawingPaperToOffScreenDC | ( | ImageDrawingPaper | drawingPaper | ) | [private] |
Definition at line 418 of file ImageDrawingManager.cpp.
References drawDrawingToOffScreenDC(), drawImageToOffScreenDC(), isDrawingValid, Drawings::numberOfImageDrawings, and showImageDrawing.
void ImageDrawingManager::drawDrawingToOffScreenDC | ( | Drawings::ImageDrawing | drawing, | |
ImageDrawingPaper | drawingPaper | |||
) | [private] |
Definition at line 488 of file ImageDrawingManager.cpp.
References PaintMethodsWin32::paintDebugDrawingToCDC().
Referenced by drawDrawingPaperToOffScreenDC().
void ImageDrawingManager::drawImageToOffScreenDC | ( | ImageDrawingPaper | drawingPaper | ) | [private] |
Definition at line 434 of file ImageDrawingManager.cpp.
References Images::imageProcessorScanLines, Images::noImage, ImageMethods::paintImage2CDCAsRGB(), and ImageMethods::paintImage2CDCAsYUV().
Referenced by drawDrawingPaperToOffScreenDC().
void ImageDrawingManager::generateMetaFile | ( | ImageDrawingPaper | drawingPaper | ) | [private] |
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 ImageDrawingManager::getHighRes | ( | ImageDrawingPaper | drawingPaper | ) |
Returns whether images are drawn in high resolution
Definition at line 529 of file ImageDrawingManager.cpp.
References highRes.
Referenced by DebugDrawingManager::getHighRes(), and setHighRes().
ImageID ImageDrawingManager::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 293 of file ImageDrawingManager.cpp.
bool ImageDrawingManager::getSendDebugImagesFromRobot | ( | ) |
Definition at line 515 of file ImageDrawingManager.cpp.
References sendDebugImagesFromRobot.
Referenced by DebugDrawingManager::getSendDebugImagesFromRobot().
bool ImageDrawingManager::isDrawingShownOnDrawingPaper | ( | ImageDrawingPaper | imageDrawingPaper, | |
Drawings::ImageDrawing | imageDrawing | |||
) |
imageDrawingPaper | The drawing paper. | |
imageDrawing | The drawing. |
Definition at line 126 of file ImageDrawingManager.cpp.
void ImageDrawingManager::loadProperties | ( | ) |
Loads which drawings and which image are shown on which drawing paper from the registry.
Definition at line 318 of file ImageDrawingManager.cpp.
References Drawings::getDrawingName(), DrawingPapers::getDrawingPaperName(), Images::getImageIDName(), imageDrawingIsShownOnAtLeastOnePaper, DrawingPapers::imageViewer1, DrawingPapers::imageViewer2, Images::noImage, Drawings::numberOfImageDrawings, Images::rawImage, Images::segmentedImage1, sendDebugKeysForSimulatedRobots(), and showImageDrawing.
Referenced by DebugDrawingManager::loadProperties().
void ImageDrawingManager::notifyImage | ( | ImageID | imageID | ) |
Definition at line 301 of file ImageDrawingManager.cpp.
References Drawings::numberOfImageDrawings, and Images::rawImage.
void ImageDrawingManager::paint | ( | CRect * | rect, | |
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.
rect | Specifies the rect in the device context to paint to. | |
imageDrawingPaper | Specifies the drawing paper to paint. |
Definition at line 187 of file ImageDrawingManager.cpp.
References int().
Referenced by DebugDrawingManager::paint().
void ImageDrawingManager::repaintDrawingPaper | ( | ImageDrawingPaper | drawingPaper | ) | [private] |
Calls the RedrawWindow function of the CWnd object displaying the specified drawing paper.
drawingPaper | Specifies the drawing paper. |
Definition at line 146 of file ImageDrawingManager.cpp.
Referenced by setHighRes().
void ImageDrawingManager::repaintDrawingPapers | ( | Drawings::ImageDrawing | drawing | ) | [private] |
Calls the RedrawWindow function of all CWnd objects displaying a drawing paper containing the specified drawing.
drawing | Specifies a drawing. |
Definition at line 157 of file ImageDrawingManager.cpp.
void ImageDrawingManager::repaintDrawingPapers | ( | ImageID | imageID | ) |
Calls the RedrawWindow function of all CWnd objects displaying the specified image.
imageID | The image to draw. |
Definition at line 172 of file ImageDrawingManager.cpp.
Referenced by setDebugDrawing().
void ImageDrawingManager::saveProperties | ( | ) |
Saves which drawings and which image are shown on which drawing paper to the reistry.
Definition at line 377 of file ImageDrawingManager.cpp.
References Drawings::getDrawingName(), DrawingPapers::getDrawingPaperName(), Images::getImageIDName(), Drawings::numberOfImageDrawings, and showImageDrawing.
Referenced by DebugDrawingManager::saveProperties().
void ImageDrawingManager::sendDebugKeysForSimulatedRobots | ( | ) | [private] |
Definition at line 91 of file ImageDrawingManager.cpp.
References DebugKey::always, debugImageIsShownAtLeastOnce, DebugKey::disabled, CRobotControlDebugKeyTables::forPhysicalRobots, CRobotControlDebugKeyTables::forSimulatedRobots, Images::getDebugKeyID(), Drawings::getDebugKeyID(), getDebugKeyTables(), imageDrawingIsShownOnAtLeastOnePaper, Drawings::numberOfImageDrawings, Images::numberOfImageIDs, sendDebugImagesFromRobot, CRobotControlDebugKeyTables::sendForPhysicalRobots(), CRobotControlDebugKeyTables::sendForSimulatedRobots(), and DebugKeyTable::set().
Referenced by loadProperties(), and setSendDebugImagesFromRobot().
void ImageDrawingManager::setDebugDrawing | ( | DebugDrawing * | pDebugDrawing | ) |
Gives the Image 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 61 of file ImageDrawingManager.cpp.
References imageDrawing, DebugDrawing::imageDrawingID, isDrawingValid, and repaintDrawingPapers().
Referenced by DebugDrawingManager::setDebugDrawing().
void ImageDrawingManager::setHighRes | ( | ImageDrawingPaper | drawingPaper, | |
bool | highRes | |||
) |
Sets whether images are drawn in high resolution
Definition at line 520 of file ImageDrawingManager.cpp.
References DrawingPapers::getDrawingPaperName(), getHighRes(), and repaintDrawingPaper().
Referenced by DebugDrawingManager::setHighRes().
void ImageDrawingManager::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 273 of file ImageDrawingManager.cpp.
void ImageDrawingManager::setSendDebugImagesFromRobot | ( | bool | sendDebugImagesFromRobot | ) |
Definition at line 509 of file ImageDrawingManager.cpp.
References sendDebugKeysForSimulatedRobots().
Referenced by DebugDrawingManager::setSendDebugImagesFromRobot().
void ImageDrawingManager::setWnd | ( | ImageDrawingPaper | imageDrawingPaper, | |
CWnd * | pWnd | |||
) |
The ImageDrawingManager 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 135 of file ImageDrawingManager.cpp.
void ImageDrawingManager::showDrawingOnDrawingPaper | ( | ImageDrawingPaper | imageDrawingPaper, | |
Drawings::ImageDrawing | imageDrawing, | |||
bool | show | |||
) |
Specifies if the specified drawing is shown on the specified drawing paper.
imageDrawingPaper | The image drawing paper. | |
imageDrawing | The debug drawing. | |
show | Specifies if the drawing is shown or not. |
Definition at line 74 of file ImageDrawingManager.cpp.
CBitmap* ImageDrawingManager::bmpOffScreen[numberOfImageDrawingPapers] [private] |
Definition at line 197 of file ImageDrawingManager.h.
Referenced by createNewBitmap(), ImageDrawingManager(), and ~ImageDrawingManager().
int ImageDrawingManager::currentHeight[numberOfImageDrawingPapers] [private] |
int ImageDrawingManager::currentWidth[numberOfImageDrawingPapers] [private] |
CDC ImageDrawingManager::dcOffScreen[numberOfImageDrawingPapers] [private] |
Definition at line 196 of file ImageDrawingManager.h.
Referenced by createNewBitmap(), and ~ImageDrawingManager().
bool ImageDrawingManager::debugImageIsShownAtLeastOnce[Images::numberOfImageIDs] [private] |
Stores if a special debug image is painted on at least one paper.
Definition at line 211 of file ImageDrawingManager.h.
Referenced by sendDebugKeysForSimulatedRobots().
bool ImageDrawingManager::highRes[numberOfImageDrawingPapers] [private] |
Definition at line 221 of file ImageDrawingManager.h.
Referenced by getHighRes(), and ImageDrawingManager().
DebugDrawing* ImageDrawingManager::imageDrawing[Drawings::numberOfImageDrawings] [private] |
Pointers to the debug drawings
Definition at line 192 of file ImageDrawingManager.h.
Referenced by ImageDrawingManager(), setDebugDrawing(), and ~ImageDrawingManager().
bool ImageDrawingManager::imageDrawingIsShownOnAtLeastOnePaper[Drawings::numberOfImageDrawings] [private] |
Stores if a special drawing is painted on at least one paper.
Definition at line 208 of file ImageDrawingManager.h.
Referenced by loadProperties(), and sendDebugKeysForSimulatedRobots().
ImageID ImageDrawingManager::imageID[numberOfImageDrawingPapers] [private] |
Stores, which of the images is shown on a special paper.
Definition at line 214 of file ImageDrawingManager.h.
Referenced by ImageDrawingManager().
Image ImageDrawingManager::imageYUV[numberOfImageIDs] |
Definition at line 224 of file ImageDrawingManager.h.
Referenced by CRobotControlDialogBar::getDebugImageCameraInfo(), and DebugDrawingManagerMessageHandler::handleMessage().
bool ImageDrawingManager::isDrawingValid[Drawings::numberOfImageDrawings] [private] |
Definition at line 194 of file ImageDrawingManager.h.
Referenced by drawDrawingPaperToOffScreenDC(), ImageDrawingManager(), and setDebugDrawing().
HBITMAP ImageDrawingManager::oldBitmap[numberOfImageDrawingPapers] [private] |
Definition at line 198 of file ImageDrawingManager.h.
Referenced by createNewBitmap(), and ~ImageDrawingManager().
CWnd* ImageDrawingManager::pWnd[numberOfImageDrawingPapers] [private] |
Pointer to the CWnds of where the drawing papers are shown.
Definition at line 217 of file ImageDrawingManager.h.
Referenced by ImageDrawingManager().
bool ImageDrawingManager::sendDebugImagesFromRobot [private] |
Definition at line 219 of file ImageDrawingManager.h.
Referenced by getSendDebugImagesFromRobot(), ImageDrawingManager(), and sendDebugKeysForSimulatedRobots().
bool ImageDrawingManager::showImageDrawing[numberOfImageDrawingPapers][Drawings::numberOfImageDrawings] [private] |
Stores if a special drawing is painted on a special paper.
Definition at line 205 of file ImageDrawingManager.h.
Referenced by drawDrawingPaperToOffScreenDC(), loadProperties(), and saveProperties().