#include <ImageMarker.h>
ImageMarker draws d_pic at the position specified by d_pos, scaled to d_size. d_file_name isn't used internally, but only provided to help Graph manage save/restore.
Following the above thoughts, it might help clarify the purpose of ImageMarker, LegendMarker and LineMarker if they are renamed according to the new superclasse's name (e.g. ImageEnrichment, TextEnrichment and LineEnrichment).
See the documentation of SelectionMoveResizer for other advantages of this approach.
Public Member Functions | |
double | bottom () |
virtual QwtDoubleRect | boundingRect () const |
Return bounding rectangle in plot coordinates. | |
QString | getFileName () |
Return d_file_name. | |
ImageMarker (const QPixmap &p) | |
Construct an image marker from a pixmap. | |
QPoint | origin () const |
Return position in paint coordinates. | |
QPixmap | pixmap () const |
Return the pixmap to be drawn, d_pic. | |
QRect | rect () const |
Return bounding rectangle in paint coordinates. | |
double | right () |
void | setBoundingRect (double left, double top, double right, double bottom) |
Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates. | |
void | setFileName (const QString &fn) |
Set d_file_name. | |
void | setOrigin (const QPoint &p) |
Set QwtPlotMarker::value() in paint coordinates. | |
void | setRect (int x, int y, int w, int h) |
Set value (position) and d_size, giving everything in paint coordinates. | |
void | setSize (const QSize &size) |
Set d_size. | |
QSize | size () |
Return d_size. | |
void | updateBoundingRect () |
Private Member Functions | |
void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const |
Does the actual drawing; see QwtPlotItem::draw. | |
Private Attributes | |
QString | d_file_name |
The file from which the image was loaded. | |
QPixmap | d_pic |
The pixmap to be drawn. | |
QPoint | d_pos |
The position in paint coordiantes. | |
QSize | d_size |
The size (in paint coordinates) to which d_pic will be scaled in draw(). | |
double | d_x_right |
The right side position in scale coordinates. | |
double | d_y_bottom |
The bottom side position in scale coordinates. |
ImageMarker::ImageMarker | ( | const QPixmap & | p | ) |
Construct an image marker from a pixmap.
double ImageMarker::bottom | ( | ) | [inline] |
Reimplemented from PlotEnrichement.
QwtDoubleRect ImageMarker::boundingRect | ( | ) | const [virtual] |
void ImageMarker::draw | ( | QPainter * | p, | |
const QwtScaleMap & | xMap, | |||
const QwtScaleMap & | yMap, | |||
const QRect & | r | |||
) | const [private] |
Does the actual drawing; see QwtPlotItem::draw.
QString ImageMarker::getFileName | ( | ) | [inline] |
Return d_file_name.
QPoint ImageMarker::origin | ( | ) | const [inline] |
QPixmap ImageMarker::pixmap | ( | ) | const [inline] |
Return the pixmap to be drawn, d_pic.
QRect ImageMarker::rect | ( | ) | const [virtual] |
double ImageMarker::right | ( | ) | [inline] |
Reimplemented from PlotEnrichement.
void ImageMarker::setBoundingRect | ( | double | left, | |
double | top, | |||
double | right, | |||
double | bottom | |||
) | [virtual] |
Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates.
Reimplemented from PlotEnrichement.
void ImageMarker::setFileName | ( | const QString & | fn | ) | [inline] |
Set d_file_name.
void ImageMarker::setOrigin | ( | const QPoint & | p | ) |
void ImageMarker::setRect | ( | int | x, | |
int | y, | |||
int | w, | |||
int | h | |||
) | [virtual] |
Set value (position) and d_size, giving everything in paint coordinates.
Reimplemented from PlotEnrichement.
void ImageMarker::setSize | ( | const QSize & | size | ) |
QSize ImageMarker::size | ( | ) | [inline] |
void ImageMarker::updateBoundingRect | ( | ) | [virtual] |
Reimplemented from PlotEnrichement.
QString ImageMarker::d_file_name [private] |
The file from which the image was loaded.
QPixmap ImageMarker::d_pic [private] |
The pixmap to be drawn.
QPoint ImageMarker::d_pos [private] |
QSize ImageMarker::d_size [private] |
The size (in paint coordinates) to which d_pic will be scaled in draw().
Reimplemented from PlotEnrichement.
double ImageMarker::d_x_right [private] |
double ImageMarker::d_y_bottom [private] |