#include <LineMarker.h>
Public Types | |
enum | Operation { None, MoveStart, MoveEnd, MoveBoth } |
Public Member Functions | |
QwtDoubleRect | boundingRect () const |
Returns the bounding rectangle in plot coordinates. | |
QColor | color () |
double | dist (int x, int y) |
Returns the shortest distance to the arrow line or to one of the arrow heads. | |
void | drawEndArrow (bool on=true) |
Specifies weather the end arrow should be drawn. | |
void | drawStartArrow (bool on=true) |
Specifies weather the start arrow should be drawn. | |
bool | editable () const |
Returns the state of d_editable. | |
QPoint | endPoint () const |
Pixel coordinates of the end point. | |
QwtDoublePoint | endPointCoord () |
Axes values coordinates of the end point. | |
bool | eventFilter (QObject *o, QEvent *e) |
Filters events for the canvas while d_editable is true. | |
void | fillArrowHead (bool fill=true) |
Specifies weather the arrow head should be filled with a brush. | |
bool | filledArrowHead () |
bool | hasEndArrow () |
bool | hasStartArrow () |
int | headAngle () |
The angle of the arrow head. | |
int | headLength () |
Length of the arrow head. | |
double | length () |
Returns the length of the arrow line. | |
LineMarker () | |
QRect | rect () const |
Returns the bounding rectangle in paint coordinates. | |
void | setBoundingRect (double xs, double ys, double xe, double ye) |
Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates. | |
void | setColor (const QColor &c) |
void | setEditable (bool yes) |
Starts/ends editing of end points by the user. | |
void | setEndPoint (double x, double y) |
Sets the end point in axes values coordinates. | |
void | setEndPoint (const QPoint &p) |
Sets the end point in pixel coordinates. | |
void | setHeadAngle (int a) |
Sets the angle of the arrow head. | |
void | setHeadLength (int l) |
Sets the length of the arrow head. | |
void | setStartPoint (double x, double y) |
Sets the start point in axes values coordinates. | |
void | setStartPoint (const QPoint &p) |
Sets the start point in pixel coordinates. | |
void | setStyle (Qt::PenStyle s) |
Sets the pen style for the arrow line. | |
void | setWidth (int w) |
Sets the width of the arrow line. | |
QPoint | startPoint () const |
Pixel coordinates of the start point. | |
QwtDoublePoint | startPointCoord () |
Axes values coordinates of the start point. | |
Qt::PenStyle | style () |
The pen style of the arrow line. | |
void | updateBoundingRect () |
Recalculates the bounding rectangle in values coordinates using the pixel coordinats when the scales change. | |
int | width () |
The width of the arrow line. | |
Private Member Functions | |
void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const |
double | theta (int xs, int ys, int xe, int ye) const |
Private Attributes | |
bool | d_editable |
Whether start and end point can be moved by the user. | |
QPoint | d_end |
Pixel coordinates of the end point. | |
bool | d_end_arrow |
Flag specifying if the end arrow is visible. | |
bool | d_fill_head |
Flag specifying if the arrow head is filled with a brush. | |
int | d_head_angle |
Angle of the arrow head. | |
int | d_head_length |
Length of the arrow head. | |
Operation | d_op |
What editing operation is in progress. | |
QPoint | d_op_startat |
Difference between mouse position where a MoveBoth operation started and startPoint(). When only one point is being moved, we can simply setStartPoint() or setEndPoint() to the current mouse position, but when the editing starts in the middle of the line, we need to remember this bit. | |
QwtDoubleRect | d_rect |
Bounding rectangle of the arrow in axes values coordinates. | |
QPoint | d_start |
Pixel coordinates of the start point. | |
bool | d_start_arrow |
Flag specifying if the start arrow is visible. |
LineMarker::LineMarker | ( | ) |
QwtDoubleRect LineMarker::boundingRect | ( | ) | const [virtual] |
QColor LineMarker::color | ( | ) | [inline] |
double LineMarker::dist | ( | int | x, | |
int | y | |||
) |
Returns the shortest distance to the arrow line or to one of the arrow heads.
void LineMarker::draw | ( | QPainter * | p, | |
const QwtScaleMap & | xMap, | |||
const QwtScaleMap & | yMap, | |||
const QRect & | r | |||
) | const [private] |
void LineMarker::drawEndArrow | ( | bool | on = true |
) | [inline] |
Specifies weather the end arrow should be drawn.
void LineMarker::drawStartArrow | ( | bool | on = true |
) | [inline] |
Specifies weather the start arrow should be drawn.
bool LineMarker::editable | ( | ) | const [inline] |
Returns the state of d_editable.
QPoint LineMarker::endPoint | ( | ) | const |
Pixel coordinates of the end point.
QwtDoublePoint LineMarker::endPointCoord | ( | ) |
Axes values coordinates of the end point.
bool LineMarker::eventFilter | ( | QObject * | o, | |
QEvent * | e | |||
) |
Filters events for the canvas while d_editable is true.
void LineMarker::fillArrowHead | ( | bool | fill = true |
) |
Specifies weather the arrow head should be filled with a brush.
bool LineMarker::filledArrowHead | ( | ) | [inline] |
bool LineMarker::hasEndArrow | ( | ) | [inline] |
bool LineMarker::hasStartArrow | ( | ) | [inline] |
int LineMarker::headAngle | ( | ) | [inline] |
The angle of the arrow head.
int LineMarker::headLength | ( | ) | [inline] |
Length of the arrow head.
double LineMarker::length | ( | ) |
Returns the length of the arrow line.
QRect LineMarker::rect | ( | ) | const [inline, virtual] |
void LineMarker::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 LineMarker::setColor | ( | const QColor & | c | ) |
void LineMarker::setEditable | ( | bool | yes | ) |
Starts/ends editing of end points by the user.
void LineMarker::setEndPoint | ( | double | x, | |
double | y | |||
) |
Sets the end point in axes values coordinates.
void LineMarker::setEndPoint | ( | const QPoint & | p | ) |
Sets the end point in pixel coordinates.
void LineMarker::setHeadAngle | ( | int | a | ) |
Sets the angle of the arrow head.
void LineMarker::setHeadLength | ( | int | l | ) |
Sets the length of the arrow head.
void LineMarker::setStartPoint | ( | double | x, | |
double | y | |||
) |
Sets the start point in axes values coordinates.
void LineMarker::setStartPoint | ( | const QPoint & | p | ) |
Sets the start point in pixel coordinates.
void LineMarker::setStyle | ( | Qt::PenStyle | s | ) |
Sets the pen style for the arrow line.
void LineMarker::setWidth | ( | int | w | ) |
Sets the width of the arrow line.
QPoint LineMarker::startPoint | ( | ) | const |
Pixel coordinates of the start point.
QwtDoublePoint LineMarker::startPointCoord | ( | ) |
Axes values coordinates of the start point.
Qt::PenStyle LineMarker::style | ( | ) | [inline] |
The pen style of the arrow line.
double LineMarker::theta | ( | int | xs, | |
int | ys, | |||
int | xe, | |||
int | ye | |||
) | const [private] |
void LineMarker::updateBoundingRect | ( | ) | [virtual] |
Recalculates the bounding rectangle in values coordinates using the pixel coordinats when the scales change.
Reimplemented from PlotEnrichement.
int LineMarker::width | ( | ) | [inline] |
The width of the arrow line.
bool LineMarker::d_editable [private] |
Whether start and end point can be moved by the user.
QPoint LineMarker::d_end [private] |
Pixel coordinates of the end point.
bool LineMarker::d_end_arrow [private] |
Flag specifying if the end arrow is visible.
bool LineMarker::d_fill_head [private] |
Flag specifying if the arrow head is filled with a brush.
int LineMarker::d_head_angle [private] |
Angle of the arrow head.
int LineMarker::d_head_length [private] |
Length of the arrow head.
Operation LineMarker::d_op [private] |
What editing operation is in progress.
QPoint LineMarker::d_op_startat [private] |
Difference between mouse position where a MoveBoth operation started and startPoint(). When only one point is being moved, we can simply setStartPoint() or setEndPoint() to the current mouse position, but when the editing starts in the middle of the line, we need to remember this bit.
QwtDoubleRect LineMarker::d_rect [private] |
Bounding rectangle of the arrow in axes values coordinates.
QPoint LineMarker::d_start [private] |
Pixel coordinates of the start point.
bool LineMarker::d_start_arrow [private] |
Flag specifying if the start arrow is visible.