From c857c8b3eeaa8b0fe217479b2bf51a89aa5947bf Mon Sep 17 00:00:00 2001 From: san Date: Thu, 9 Jun 2005 13:51:06 +0000 Subject: [PATCH] setData() moved from SPlot2d_Curve --- src/Plot2d/Plot2d_Curve.cxx | 9 +++++++++ src/Plot2d/Plot2d_Curve.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/Plot2d/Plot2d_Curve.cxx b/src/Plot2d/Plot2d_Curve.cxx index 0f9c0125c..399e6be20 100755 --- a/src/Plot2d/Plot2d_Curve.cxx +++ b/src/Plot2d/Plot2d_Curve.cxx @@ -181,6 +181,15 @@ pointList Plot2d_Curve::getPointList() const return myPoints; } +/*! + Sets curve's data. +*/ +void Plot2d_Curve::setData( const double* hData, const double* vData, long size ) +{ + clearAllPoints(); + for(long i = 0; i < size; i++) addPoint(hData[i], vData[i]); +} + /*! Gets curve's data : abscissas of points */ diff --git a/src/Plot2d/Plot2d_Curve.h b/src/Plot2d/Plot2d_Curve.h index 133f744da..bbb969679 100755 --- a/src/Plot2d/Plot2d_Curve.h +++ b/src/Plot2d/Plot2d_Curve.h @@ -43,8 +43,11 @@ public: void deletePoint(int thePos); void clearAllPoints(); pointList getPointList() const; + + void setData( const double* hData, const double* vData, long size ); double* horData() const; double* verData() const; + int nbPoints() const; bool isEmpty() const; -- 2.39.2