15 #if QT_VERSION < 0x040601 16 #define qAtan2(y, x) ::atan2(y, x) 17 #define qFastSin(x) qSin(x) 18 #define qFastCos(x) qCos(x) 171 setPen( QPen( color, width, style ) );
205 const QPointF &from,
const QPointF &to )
const 207 const qreal pw = qMax( painter->pen().widthF(), qreal( 1.0 ) );
224 if ( ( orientation == Qt::Horizontal )
225 && ( p1.y() == p2.y() ) )
229 const double y = p1.y() - sw / 2;
231 p1.x(), y, p1.x(), y + sw );
233 p2.x(), y, p2.x(), y + sw );
235 else if ( ( orientation == Qt::Vertical )
236 && ( p1.x() == p2.x() ) )
240 const double x = p1.x() - sw / 2;
242 x, p1.y(), x + sw, p1.y() );
244 x, p2.y(), x + sw, p2.y() );
250 const double dx = p2.x() - p1.x();
251 const double dy = p2.y() - p1.y();
253 double dw2 = sw / 2.0;
255 const double cx =
qFastCos( angle ) * dw2;
256 const double sy =
qFastSin( angle ) * dw2;
259 p1.x() - cx, p1.y() - sy,
260 p1.x() + cx, p1.y() + sy );
262 p2.x() - cx, p2.y() - sy,
263 p2.x() + cx, p2.y() + sy );
276 if ( ( orientation == Qt::Horizontal )
277 && ( p1.y() == p2.y() ) )
283 p1.x(), y, p2.x() - p1.x(), sw );
285 else if ( ( orientation == Qt::Vertical )
286 && ( p1.x() == p2.x() ) )
292 x, p1.y(), sw, p2.y() - p1.y() );
298 const double dx = p2.x() - p1.x();
299 const double dy = p2.y() - p1.y();
301 double dw2 = sw / 2.0;
303 const double cx =
qFastCos( angle ) * dw2;
304 const double sy =
qFastSin( angle ) * dw2;
307 polygon += QPointF( p1.x() - cx, p1.y() - sy );
308 polygon += QPointF( p1.x() + cx, p1.y() + sy );
309 polygon += QPointF( p2.x() + cx, p2.y() + sy );
310 polygon += QPointF( p2.x() - cx, p2.y() - sy );
static void drawLine(QPainter *, double x1, double y1, double x2, double y2)
Wrapper for QPainter::drawLine()
virtual ~QwtIntervalSymbol()
Destructor.
TFSIMD_FORCE_INLINE const tfScalar & y() const
QwtIntervalSymbol & operator=(const QwtIntervalSymbol &)
Assignment operator.
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
QwtIntervalSymbol::Style style
bool operator!=(const QwtIntervalSymbol &) const
Compare two symbols.
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
QwtIntervalSymbol(Style=NoSymbol)
const QBrush & brush() const
static void drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
static void drawRect(QPainter *, double x, double y, double w, double h)
Wrapper for QPainter::drawRect()
A drawing primitive for displaying an interval like an error bar.
TFSIMD_FORCE_INLINE const tfScalar & x() const
void setBrush(const QBrush &b)
Assign a brush.
virtual void draw(QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const
bool operator==(const PrivateData &other) const
No Style. The symbol cannot be drawn.
bool operator==(const QwtIntervalSymbol &) const
Compare two symbols.
static bool roundingAlignment()