xychartitem_p.h
58 lines
| 1.4 KiB
| text/x-c
|
CLexer
|
r466 | #ifndef XYCHARTITEM_H | ||
#define XYCHARTITEM_H | ||||
#include "qchartglobal.h" | ||||
#include "chartitem_p.h" | ||||
#include <QPen> | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartPresenter; | ||||
class QXYSeries; | ||||
class XYChartItem : public QObject , public ChartItem | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
|
r530 | explicit XYChartItem(QXYSeries* series, QGraphicsItem *parent = 0); | ||
|
r466 | ~ XYChartItem(){}; | ||
QVector<QPointF> points() const {return m_points;} | ||||
QRectF clipRect() const { return m_clipRect;} | ||||
public slots: | ||||
void handlePointAdded(int index); | ||||
void handlePointRemoved(int index); | ||||
void handlePointReplaced(int index); | ||||
void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | ||||
void handleGeometryChanged(const QRectF& size); | ||||
protected: | ||||
|
r557 | virtual void setLayout(QVector<QPointF>& points); | ||
|
r466 | QPointF calculateGeometryPoint(const QPointF& point) const; | ||
QPointF calculateGeometryPoint(int index) const; | ||||
|
r544 | QPointF calculateDomainPoint(const QPointF& point) const; | ||
|
r466 | QVector<QPointF> calculateGeometryPoints() const; | ||
private: | ||||
|
r557 | void applyLayout(QVector<QPointF>& points); | ||
void updateLayout(QVector<QPointF>& points); | ||||
|
r466 | inline bool isEmpty(); | ||
private: | ||||
qreal m_minX; | ||||
qreal m_maxX; | ||||
qreal m_minY; | ||||
qreal m_maxY; | ||||
QXYSeries* m_series; | ||||
QSizeF m_size; | ||||
QRectF m_clipRect; | ||||
QVector<QPointF> m_points; | ||||
|
r530 | friend class XYAnimation; | ||
|
r476 | |||
|
r466 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||