xychart_p.h
95 lines
| 2.7 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r466 | #ifndef XYCHARTITEM_H | ||
#define XYCHARTITEM_H | ||||
#include "qchartglobal.h" | ||||
#include "chartitem_p.h" | ||||
|
r1217 | #include "xyanimation_p.h" | ||
|
r466 | #include <QPen> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartPresenter; | ||||
class QXYSeries; | ||||
|
r1218 | class XYChart : public Chart | ||
|
r466 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r1218 | explicit XYChart(QXYSeries *series, ChartPresenter *presenter); | ||
~XYChart(){}; | ||||
|
r466 | |||
|
r1217 | void setGeometryPoints(QVector<QPointF>& points); | ||
QVector<QPointF> geometryPoints() const { return m_points; } | ||||
|
r466 | |||
|
r1217 | void setClipRect(const QRectF &rect); | ||
QRectF clipRect() const { return m_clipRect; } | ||||
|
r1218 | QSizeF size() const { return m_size; } | ||
QPointF origin() const { return m_origin; } | ||||
|
r1217 | void setAnimation(XYAnimation* animation); | ||
ChartAnimation* animation() const { return m_animation; } | ||||
|
r1218 | virtual void updateGeometry() = 0; | ||
|
r677 | |||
|
r775 | public Q_SLOTS: | ||
|
r466 | void handlePointAdded(int index); | ||
|
r1054 | void handlePointsAdded(int start, int end); | ||
|
r466 | void handlePointRemoved(int index); | ||
|
r1054 | void handlePointsRemoved(int start, int end); | ||
|
r466 | void handlePointReplaced(int index); | ||
|
r1085 | void handleReinitialized(); | ||
|
r466 | void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | ||
|
r743 | void handleGeometryChanged(const QRectF &size); | ||
|
r466 | |||
|
r775 | Q_SIGNALS: | ||
|
r571 | void clicked(const QPointF& point); | ||
|
r466 | protected: | ||
|
r1217 | virtual void updateChart(QVector<QPointF> &oldPoints,QVector<QPointF> &newPoints,int index = 0); | ||
|
r743 | QPointF calculateGeometryPoint(const QPointF &point) const; | ||
|
r466 | QPointF calculateGeometryPoint(int index) const; | ||
|
r743 | QPointF calculateDomainPoint(const QPointF &point) const; | ||
|
r466 | QVector<QPointF> calculateGeometryPoints() const; | ||
private: | ||||
inline bool isEmpty(); | ||||
private: | ||||
qreal m_minX; | ||||
qreal m_maxX; | ||||
qreal m_minY; | ||||
qreal m_maxY; | ||||
QXYSeries* m_series; | ||||
QSizeF m_size; | ||||
|
r1218 | QPointF m_origin; | ||
|
r466 | QRectF m_clipRect; | ||
QVector<QPointF> m_points; | ||||
|
r1217 | XYAnimation* m_animation; | ||
|
r466 | |||
|
r571 | friend class AreaChartItem; | ||
|
r476 | |||
|
r466 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||