SciDAVis
1.D4
|
A piece of text to be drawn on a Plot. More...
#include <Legend.h>
Public Types | |
enum | FrameStyle { None = 0, Line = 1, Shadow = 2 } |
The kinds of frame a Legend can draw around the Text. More... |
Public Member Functions | |
int | angle () |
QColor | backgroundColor () |
virtual QwtDoubleRect | boundingRect () const |
Bounding rectangle in plot coordinates. | |
QFont | font () |
int | frameStyle () |
Legend (Plot *) | |
QRect | rect () const |
Bounding rectangle in paint coordinates. | |
void | setAngle (int ang) |
void | setBackgroundColor (const QColor &c) |
void | setFont (const QFont &font) |
void | setFrameStyle (int style) |
void | setOrigin (const QPoint &p) |
Set QwtPlotMarker::value() in paint coordinates. | |
void | setOriginCoord (double x, double y) |
Sets the position of the top left corner in axis coordinates. | |
void | setText (const QString &s) |
void | setTextColor (const QColor &c) |
QString | text () |
QColor | textColor () |
void | updateOrigin () |
Keep the markers on screen each time the scales are modified by adding/removing curves. | |
~Legend () | |
Public Member Functions inherited from PlotEnrichement | |
double | bottom () |
QPoint | origin () const |
Return position in paint coordinates. | |
PlotEnrichement () | |
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. | |
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 () |
Protected Attributes | |
int | d_angle |
Rotation angle: not implemented yet. | |
int | d_frame |
Frame type. | |
Plot * | d_plot |
Parent plot. | |
QPoint | d_pos |
TopLeft position in pixels. | |
int | d_shadow_size_x |
int | d_shadow_size_y |
QwtText * | d_text |
Pointer to the QwtText object. | |
int | hspace |
Distance between symbols and legend text. | |
int | left_margin |
Distance between frame and content. | |
int | top_margin |
Private Member Functions | |
void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const |
void | drawFrame (QPainter *p, int type, const QRect &rect) const |
void | drawLegends (QPainter *p, const QRect &rect, QwtArray< long > height, int symbolLineLength) const |
void | drawSymbols (QPainter *p, const QRect &rect, QwtArray< long > height, int symbolLineLength) const |
void | drawVector (QPainter *p, int x, int y, int l, int curveIndex) const |
QwtArray< long > | itemsHeight (int y, int symbolLineLength, int &width, int &height) const |
QString | parse (const QString &str) const |
int | symbolsMaxLineLength () const |
A piece of text to be drawn on a Plot.
Contrary to its name, Legend is not just used for the plot legend, but for any kind of text; particularly also for the "Add Text" tool. Accordingly, it is also referred to as "TextMarker" by other classes.
Rename to TextMarker (or maybe TextEnrichment; see documentation of ImageMarker for details).
enum Legend::FrameStyle |
The kinds of frame a Legend can draw around the Text.
Legend::Legend | ( | Plot * | plot | ) |
References d_shadow_size_x, d_shadow_size_y, d_text, hspace, left_margin, and top_margin.
Legend::~Legend | ( | ) |
References d_text.
|
inline |
References d_angle.
Referenced by Graph::insertTextMarker(), Graph::saveMarkers(), and ApplicationWindow::showTextDialog().
|
inline |
References d_text.
Referenced by ApplicationWindow::copyMarker(), Graph::insertTextMarker(), Graph::saveMarkers(), and ApplicationWindow::showTextDialog().
|
virtual |
Bounding rectangle in plot coordinates.
Reimplemented from PlotEnrichement.
References PlotEnrichement::bottom(), d_plot, rect(), and PlotEnrichement::right().
|
private |
References d_frame, drawFrame(), drawLegends(), drawSymbols(), itemsHeight(), and symbolsMaxLineLength().
|
private |
References d_shadow_size_x, d_shadow_size_y, d_text, Line, None, and Shadow.
Referenced by draw().
|
private |
References d_text, hspace, left_margin, parse(), PlotEnrichement::size(), and text().
Referenced by draw().
|
private |
References Graph::Box, QwtPieCurve::color(), Plot::curve(), Graph::curve(), Graph::curveType(), d_plot, d_text, drawVector(), Graph::isPiePlot(), left_margin, QwtPieCurve::pattern(), text(), Graph::VectXYAM, and Graph::VectXYXY.
Referenced by draw().
|
private |
References VectorCurve::color(), Graph::curve(), d_plot, VectorCurve::filledArrowHead(), VectorCurve::headAngle(), VectorCurve::headLength(), and VectorCurve::width().
Referenced by drawSymbols().
|
inline |
|
inline |
References d_frame.
Referenced by ApplicationWindow::copyMarker(), Graph::insertTextMarker(), Graph::saveMarkers(), and ApplicationWindow::showTextDialog().
|
private |
References d_text, hspace, left_margin, parse(), PlotEnrichement::size(), text(), and top_margin.
|
private |
References Graph::curve(), and d_plot.
Referenced by drawLegends(), and itemsHeight().
|
virtual |
Bounding rectangle in paint coordinates.
Reimplemented from PlotEnrichement.
References d_plot, itemsHeight(), and symbolsMaxLineLength().
Referenced by MultiLayer::addTextLayer(), boundingRect(), SelectionMoveResizer::operateOnTargets(), Graph::plotPie(), CanvasPicker::selectMarker(), and Filter::showLegend().
|
inline |
References d_angle.
Referenced by Graph::insertTextMarker(), Graph::pasteMarker(), and Graph::updateTextMarker().
void Legend::setBackgroundColor | ( | const QColor & | c | ) |
References d_text.
Referenced by CanvasPicker::drawTextMarker(), Graph::insertTextMarker(), Graph::newLegend(), Graph::pasteMarker(), and Graph::updateTextMarker().
void Legend::setFont | ( | const QFont & | font | ) |
void Legend::setFrameStyle | ( | int | style | ) |
References d_frame.
Referenced by CanvasPicker::drawTextMarker(), Graph::insertTextMarker(), Graph::newLegend(), Graph::pasteMarker(), Graph::plotPie(), and Graph::updateTextMarker().
void Legend::setOrigin | ( | const QPoint & | p | ) |
Set QwtPlotMarker::value() in paint coordinates.
Reimplemented from PlotEnrichement.
Referenced by Graph::addTimeStamp(), CanvasPicker::drawTextMarker(), Graph::insertTextMarker(), Graph::newLegend(), SelectionMoveResizer::operateOnTargets(), Graph::pasteMarker(), Graph::plotPie(), and Filter::showLegend().
void Legend::setOriginCoord | ( | double | x, |
double | y | ||
) |
Sets the position of the top left corner in axis coordinates.
Referenced by Graph::insertTextMarker().
void Legend::setText | ( | const QString & | s | ) |
References d_text.
Referenced by Graph::addLegendItem(), CanvasPicker::drawTextMarker(), Graph::insertTextMarker(), Graph::modifyFunctionCurve(), Graph::newLegend(), Differentiation::output(), Graph::pasteMarker(), Graph::plotBoxDiagram(), Graph::plotPie(), Graph::removeLegendItem(), Graph::removePie(), Graph::updateCurveNames(), and Graph::updateTextMarker().
void Legend::setTextColor | ( | const QColor & | c | ) |
References d_text.
Referenced by CanvasPicker::drawTextMarker(), Graph::insertTextMarker(), Graph::newLegend(), Graph::pasteMarker(), and Graph::updateTextMarker().
|
private |
References Plot::curve(), Plot::curveKeys(), d_plot, d_text, and text().
|
inline |
References d_text.
Referenced by Graph::addLegendItem(), ApplicationWindow::copyMarker(), Graph::createTable(), drawLegends(), drawSymbols(), Graph::insertTextMarker(), itemsHeight(), Graph::modifyFunctionCurve(), SelectionMoveResizer::operateOnTargets(), Graph::removeLegendItem(), Graph::saveMarkers(), ApplicationWindow::showTextDialog(), symbolsMaxLineLength(), and Graph::updateCurveNames().
|
inline |
References d_text.
Referenced by ApplicationWindow::copyMarker(), Graph::insertTextMarker(), Graph::saveMarkers(), and ApplicationWindow::showTextDialog().
void Legend::updateOrigin | ( | ) |
Keep the markers on screen each time the scales are modified by adding/removing curves.
Referenced by Graph::updateMarkersBoundingRect().
|
protected |
Rotation angle: not implemented yet.
Referenced by angle(), and setAngle().
|
protected |
Frame type.
Referenced by draw(), frameStyle(), and setFrameStyle().
|
protected |
Parent plot.
Referenced by boundingRect(), drawSymbols(), drawVector(), parse(), rect(), setOrigin(), setOriginCoord(), symbolsMaxLineLength(), and updateOrigin().
|
protected |
TopLeft position in pixels.
Reimplemented from PlotEnrichement.
Referenced by setOrigin(), setOriginCoord(), and updateOrigin().
|
protected |
Referenced by drawFrame(), and Legend().
|
protected |
Referenced by drawFrame(), and Legend().
|
protected |
Pointer to the QwtText object.
Referenced by backgroundColor(), drawFrame(), drawLegends(), drawSymbols(), font(), itemsHeight(), Legend(), setBackgroundColor(), setFont(), setText(), setTextColor(), symbolsMaxLineLength(), text(), textColor(), and ~Legend().
|
protected |
Distance between symbols and legend text.
Referenced by drawLegends(), itemsHeight(), and Legend().
|
protected |
Distance between frame and content.
Referenced by drawLegends(), drawSymbols(), itemsHeight(), and Legend().
|
protected |
Referenced by itemsHeight(), and Legend().