00001
00002 #ifndef series_array_h
00003 #define series_array_h
00004
00005
00006
00007 #include "sxy_vector.h"
00008 #include "sxy_series.h"
00009
00010
00011
00013 struct SXYPoint {
00014 private: double x; double y;
00017
00018 public:
00019
00020 void setX(double v) { x = v; }
00021 void setY(double v) { y = v; }
00022
00023 double getX(void) { return x; }
00024 double getY(void) { return y; }
00025
00027 SXYPoint() : x(SXYSeries::getAnInvalidNumber()),
00028 y(SXYSeries::getAnInvalidNumber()) {}
00029
00031 SXYPoint(double h, double v) : x(h), y(v) {}
00032
00034 virtual ~SXYPoint() {
00035 x = -9999;
00036 y = -9999;
00037 }
00038 };
00039
00042 class SXYArraySeries : public SXYSeries {
00043
00045 const static SXYPoint NIL;
00046
00048 SXYVector<SXYPoint>* vector;
00049
00050 protected:
00051
00052 void allocVector(unsigned int n);
00053 void deallocVector(void);
00054
00055 public:
00056
00057 unsigned int getSize();
00058 unsigned int getNumPoints();
00059
00060 void removePointAt(unsigned int n);
00061 void insertPoint(double x, double y);
00062 void insertHole(void);
00063 void insertHoleAt(unsigned int n);
00064 void insertPointAt(unsigned int n, double x, double y);
00065
00066 void writePoint(unsigned int n, double x, double y);
00067 void invalidatePoint(unsigned int n);
00068 unsigned int getPoint(unsigned int n, double& x, double& y);
00069
00070 virtual ~SXYArraySeries();
00071 SXYArraySeries(unsigned int n);
00072 };
00073
00074 #endif
00075