32 #include <qwt_plot_marker.h> 71 QColor
color(){
return linePen().color();};
76 double width(){
return linePen().widthF();};
84 Qt::PenStyle
style(){
return linePen().style ();};
109 double dist(
int x,
int y);
137 void draw(QPainter *p,
const QwtScaleMap &xMap,
const QwtScaleMap &yMap,
const QRect &r)
const;
138 double theta(
int xs,
int ys,
int xe,
int ye)
const;
int headAngle()
The angle of the arrow head.
Definition: ArrowMarker.h:100
Qt::PenStyle style()
The pen style of the arrow line.
Definition: ArrowMarker.h:84
bool filledArrowHead()
Definition: ArrowMarker.h:104
QPoint d_end
Pixel coordinates of the end point.
Definition: ArrowMarker.h:159
void setEditable(bool yes)
Starts/ends editing of end points by the user.
Definition: ArrowMarker.cpp:411
bool hasStartArrow()
Definition: ArrowMarker.h:88
int d_head_angle
Angle of the arrow head.
Definition: ArrowMarker.h:150
double width()
The width of the arrow line.
Definition: ArrowMarker.h:76
void setAttachPolicy(AttachPolicy attachTo)
Definition: ArrowMarker.cpp:587
Definition: ArrowMarker.h:46
double length()
Returns the length of the arrow line.
Definition: ArrowMarker.cpp:161
Definition: ArrowMarker.h:47
QPoint d_start
Pixel coordinates of the start point.
Definition: ArrowMarker.h:156
AttachPolicy attachPolicy()
Definition: ArrowMarker.h:133
int headLength()
Length of the arrow head.
Definition: ArrowMarker.h:95
double theta(int xs, int ys, int xe, int ye) const
Definition: ArrowMarker.cpp:145
AttachPolicy d_attach_policy
Definition: ArrowMarker.h:176
ArrowMarker()
Definition: ArrowMarker.cpp:47
bool d_end_arrow
Flag specifying if the end arrow is visible.
Definition: ArrowMarker.h:144
Draws lines and arrows on a QwtPlot.
Definition: ArrowMarker.h:43
void updateBoundingRect()
Recalculates the bounding rectangle in values coordinates using the pixel coordinats when the scales ...
Definition: ArrowMarker.cpp:397
QColor color()
Definition: ArrowMarker.h:71
Definition: ArrowMarker.h:46
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.
Definition: ArrowMarker.h:174
void setStyle(Qt::PenStyle s)
Sets the pen style for the arrow line.
Definition: ArrowMarker.cpp:241
Operation
Definition: ArrowMarker.h:46
Definition: ArrowMarker.h:46
AttachPolicy
Definition: ArrowMarker.h:47
bool d_editable
Whether start and end point can be moved by the user.
Definition: ArrowMarker.h:164
bool eventFilter(QObject *o, QEvent *e)
Filters events for the canvas while d_editable is true.
Definition: ArrowMarker.cpp:429
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const
Definition: ArrowMarker.cpp:59
void setHeadLength(int l)
Sets the length of the arrow head.
Definition: ArrowMarker.cpp:251
void setColor(const QColor &c)
Definition: ArrowMarker.cpp:221
double dist(int x, int y)
Returns the shortest distance to the arrow line or to one of the arrow heads.
Definition: ArrowMarker.cpp:178
double arrowWidth()
Returns half of the arrow width;.
Definition: ArrowMarker.cpp:213
Definition: ArrowMarker.h:46
void fillArrowHead(bool fill=true)
Specifies weather the arrow head should be filled with a brush.
Definition: ArrowMarker.cpp:267
void drawEndArrow(bool on=true)
Specifies weather the end arrow should be drawn.
Definition: ArrowMarker.h:91
void setStartPoint(const QPoint &p)
Sets the start point in pixel coordinates.
Definition: ArrowMarker.cpp:275
int d_head_length
Length of the arrow head.
Definition: ArrowMarker.h:153
QwtDoubleRect d_rect
Bounding rectangle of the arrow in axes values coordinates.
Definition: ArrowMarker.h:162
bool editable() const
Returns the state of d_editable.
Definition: ArrowMarker.h:125
bool d_start_arrow
Flag specifying if the start arrow is visible.
Definition: ArrowMarker.h:141
void setHeadAngle(int a)
Sets the angle of the arrow head.
Definition: ArrowMarker.cpp:259
void setWidth(double w)
Sets the width of the arrow line.
Definition: ArrowMarker.cpp:231
QRect rect() const
Returns the bounding rectangle in paint coordinates.
Definition: ArrowMarker.h:115
void displayInfo(bool clear=false)
Definition: ArrowMarker.cpp:538
QwtDoublePoint startPointCoord()
Axes values coordinates of the start point.
Definition: ArrowMarker.cpp:312
bool d_fill_head
Flag specifying if the arrow head is filled with a brush.
Definition: ArrowMarker.h:147
QPoint startPoint() const
Pixel coordinates of the start point.
Definition: ArrowMarker.cpp:303
void drawStartArrow(bool on=true)
Specifies weather the start arrow should be drawn.
Definition: ArrowMarker.h:87
QwtDoublePoint endPointCoord()
Axes values coordinates of the end point.
Definition: ArrowMarker.cpp:356
QwtDoubleRect boundingRect() const
Returns the bounding rectangle in plot coordinates.
Definition: ArrowMarker.cpp:380
Definition: ArrowMarker.h:47
bool hasEndArrow()
Definition: ArrowMarker.h:92
void setBoundingRect(double xs, double ys, double xe, double ye)
Definition: ArrowMarker.cpp:361
Operation d_op
What editing operation is in progress.
Definition: ArrowMarker.h:167
void setEndPoint(const QPoint &p)
Sets the end point in pixel coordinates.
Definition: ArrowMarker.cpp:289
QPoint endPoint() const
Pixel coordinates of the end point.
Definition: ArrowMarker.cpp:332