00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023 #include "ChartSerieBase.h"
00024
00026 struct SChartXYPoint
00027 {
00028 SChartXYPoint() : X(0.0), Y(0.0)
00029 {
00030 #ifndef NO_USER_DATA
00031 pUserData = NULL;
00032 #endif
00033 }
00034 SChartXYPoint(double XVal, double YVal) : X(XVal), Y(YVal)
00035 {
00036 #ifndef NO_USER_DATA
00037 pUserData = NULL;
00038 #endif
00039 }
00040
00041 double GetX() const { return X; }
00042 double GetY() const { return Y; }
00043 double GetXMin() const { return X; }
00044 double GetXMax() const { return X; }
00045 double GetYMin() const { return Y; }
00046 double GetYMax() const { return Y; }
00047
00049 double X;
00051 double Y;
00052 #ifndef NO_USER_DATA
00054 void *pUserData;
00055 #endif
00056 };
00057
00059
00065 class CChartXYSerie : public CChartSerieBase<SChartXYPoint>
00066 {
00067 public:
00069 CChartXYSerie(CChartCtrl* pParent);
00071 virtual ~CChartXYSerie();
00072
00074 void AddPoint(double X, double Y);
00076
00085 void AddPoints(double* pX, double* pY, unsigned Count);
00087
00096 void SetPoints(double* pX, double* pY, unsigned Count);
00097
00099 double GetYPointValue(unsigned PointIndex) const;
00101 double GetXPointValue(unsigned PointIndex) const;
00103
00110 void SetYPointValue(unsigned PointIndex, double NewVal);
00112
00119 void SetXPointValue(unsigned PointIndex, double NewVal);
00120
00121 #ifndef NO_USER_DATA
00123
00128 void SetUserData(unsigned uPointIndex, void* pData);
00130
00135 void* GetUserData(unsigned uPointIndex);
00136 #endif
00137
00138 protected:
00140
00152 void GetBezierControlPoints(unsigned uFirst, unsigned uLast, SChartXYPoint* &pKnots,
00153 SChartXYPoint* &pFirstControlPoints, SChartXYPoint* &pSecondControlPoints) const;
00154
00155 private:
00156 double* GetFirstControlPoints(double* rhs, int Count) const;
00157 };