Began proof-of-concept memory module.
[aesalon.git] / src / artisan / gviewport / LineObject.cpp
blobfcf931754abc3a8aadb298848745266153e60a55
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file src/artisan/gviewport/LineObject.cpp
8 */
10 #include "artisan/gviewport/LineObject.h"
11 #include "artisan/gviewport/CoordinateMapper.h"
13 #include "util/MessageSystem.h"
15 namespace Artisan {
16 namespace GViewport {
18 LineObject::LineObject(const Point &from, const Point &to) : Object(Rect(from, to)), m_from(from), m_to(to) {
22 LineObject::~LineObject() {
26 void LineObject::renderOnto(RenderedImage &image) {
27 CoordinateMapper mapper(image);
29 image.painter().drawLine(
30 mapper.dataToPixel(m_from).toQPoint(),
31 mapper.dataToPixel(m_to).toQPoint()
35 } // namespace GViewport
36 } // namespace Artisan