SciDAVis  1.D4
Public Member Functions | Private Member Functions | Private Attributes
PlotEnrichement Class Reference

Draw images on a QwtPlot. More...

#include <PlotEnrichement.h>

Inheritance diagram for PlotEnrichement:
ArrowMarker ImageMarker Legend

List of all members.

Public Member Functions

double bottom ()
virtual QwtDoubleRect boundingRect () const
 Return bounding rectangle in plot coordinates.
QPoint origin () const
 Return position in paint coordinates.
 PlotEnrichement ()
virtual QRect rect () const
 Return bounding rectangle in paint coordinates.
double right ()
virtual 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 setOrigin (const QPoint &p)
 Set QwtPlotMarker::value() in paint coordinates.
virtual 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.
virtual void updateBoundingRect ()

Private Member Functions

QRect calculatePaintingRect ()

Private Attributes

QPoint d_pos
 The position in paint coordiantes.
QSize d_size
 The size (in paint coordinates).
double d_x_right
 The right side position in scale coordinates.
double d_y_bottom
 The bottom side position in scale coordinates.

Detailed Description

Draw images on a QwtPlot.

PlotEnrichement 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.

Future Plans

Add a QwtPlotItem subclass (PlotEnrichment ?) and make PlotEnrichement, Legend and ArrowMarker subclasses of that. These (usually) don't really mark a specific point in a plot and they don't use the symbol/label functionality of QwtPlotMarker. Instead, it would make sense to provide a unified move/resize (or even general affine transformations via QMatrix) interface and support for positioning them either at fixed plot coordinates (like QwtPlotMarker) or at a fixed drawing position within a QwtPlot (like a QWidget child); leaving the choice of positioning policy to the user. If PlotEnrichment (ideas for a better name?) inherits from both QWidget and QwtPlotItem (which is luckily no QObject) and provides a unified drawing framework, its instances could be added directly to MultiLayer without the need for a dummy Graph in between. Could also help to avoid the hack in MultiLayer::updateMarkersBoundingRect().

Following the above thoughts, it might help clarify the purpose of PlotEnrichement, Legend and ArrowMarker 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.

See also:
Legend, ArrowMarker

Constructor & Destructor Documentation

PlotEnrichement::PlotEnrichement ( )

Member Function Documentation

double PlotEnrichement::bottom ( )
inline

Reimplemented in ImageMarker.

References d_y_bottom.

Referenced by Legend::boundingRect(), and setBoundingRect().

QwtDoubleRect PlotEnrichement::boundingRect ( ) const
virtual

Return bounding rectangle in plot coordinates.

Reimplemented in ArrowMarker, ImageMarker, and Legend.

References d_x_right, and d_y_bottom.

QRect PlotEnrichement::calculatePaintingRect ( )
private

References d_x_right, and d_y_bottom.

Referenced by setBoundingRect(), and setOrigin().

QPoint PlotEnrichement::origin ( ) const
inline

Return position in paint coordinates.

Reimplemented in ImageMarker.

References d_pos.

virtual QRect PlotEnrichement::rect ( ) const
inlinevirtual

Return bounding rectangle in paint coordinates.

Reimplemented in ArrowMarker, ImageMarker, and Legend.

References d_pos, and d_size.

double PlotEnrichement::right ( )
inline

Reimplemented in ImageMarker.

References d_x_right.

Referenced by Legend::boundingRect(), and setBoundingRect().

void PlotEnrichement::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 in ArrowMarker, and ImageMarker.

References bottom(), calculatePaintingRect(), d_pos, d_size, d_x_right, d_y_bottom, and right().

void PlotEnrichement::setOrigin ( const QPoint &  p)

Set QwtPlotMarker::value() in paint coordinates.

Reimplemented in ImageMarker, and Legend.

References calculatePaintingRect(), d_pos, d_size, and updateBoundingRect().

void PlotEnrichement::setRect ( int  x,
int  y,
int  w,
int  h 
)
virtual

Set value (position) and d_size, giving everything in paint coordinates.

Reimplemented in ImageMarker.

References d_pos, d_size, and updateBoundingRect().

void PlotEnrichement::setSize ( const QSize &  size)

Set d_size.

Reimplemented in ImageMarker.

QSize PlotEnrichement::size ( )
inline

Return d_size.

Reimplemented in ImageMarker.

References d_size.

Referenced by Legend::drawLegends(), and Legend::itemsHeight().

void PlotEnrichement::updateBoundingRect ( )
virtual

Reimplemented in ArrowMarker, and ImageMarker.

References d_pos, d_size, d_x_right, and d_y_bottom.

Referenced by setOrigin(), and setRect().


Member Data Documentation

QPoint PlotEnrichement::d_pos
private

The position in paint coordiantes.

Reimplemented in Legend, and ImageMarker.

Referenced by origin(), rect(), setBoundingRect(), setOrigin(), setRect(), and updateBoundingRect().

QSize PlotEnrichement::d_size
private

The size (in paint coordinates).

Reimplemented in ImageMarker.

Referenced by rect(), setBoundingRect(), setOrigin(), setRect(), size(), and updateBoundingRect().

double PlotEnrichement::d_x_right
private

The right side position in scale coordinates.

Reimplemented in ImageMarker.

Referenced by boundingRect(), calculatePaintingRect(), right(), setBoundingRect(), and updateBoundingRect().

double PlotEnrichement::d_y_bottom
private

The bottom side position in scale coordinates.

Reimplemented in ImageMarker.

Referenced by bottom(), boundingRect(), calculatePaintingRect(), setBoundingRect(), and updateBoundingRect().


The documentation for this class was generated from the following files: