Salome HOME
Initial version
[modules/gui.git] / src / SPlot2d / SPlot2d_Curve.cxx
1 //  File   : SPlot2d_Curve.cxx
2 //  Author : Sergey RUIN
3 //  Module : SUIT
4
5 #include "SPlot2d_Curve.h"
6 using namespace std;
7
8 /*!
9   Constructor
10 */
11 SPlot2d_Curve::SPlot2d_Curve()
12 :Plot2d_Curve() 
13 {
14 }
15
16 /*!
17   Destructor
18 */
19 SPlot2d_Curve::~SPlot2d_Curve()
20 {
21 }
22
23 /*!
24   Copy constructor. Makes deep copy of data.
25 */
26 SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
27 {
28   myAutoAssign = curve.isAutoAssign();
29   myHorTitle   = curve.getHorTitle();
30   myVerTitle   = curve.getVerTitle();
31   myHorUnits   = curve.getHorUnits();
32   myVerUnits   = curve.getVerUnits();
33   myColor      = curve.getColor();
34   myMarker     = curve.getMarker();
35   myLine       = curve.getLine();
36   myLineWidth  = curve.getLineWidth();
37   myPoints     = curve.getPointList();
38   myIO         = curve.getIO();
39   myTableIO    = curve.getTableIO();
40 }
41
42 /*!
43   operator=. Makes deep copy of data.
44 */
45 SPlot2d_Curve& SPlot2d_Curve::operator=( const SPlot2d_Curve& curve )
46 {
47   myAutoAssign = curve.isAutoAssign();
48   myHorTitle   = curve.getHorTitle();
49   myVerTitle   = curve.getVerTitle();
50   myHorUnits   = curve.getHorUnits();
51   myVerUnits   = curve.getVerUnits();
52   myColor      = curve.getColor();
53   myMarker     = curve.getMarker();
54   myLine       = curve.getLine();
55   myLineWidth  = curve.getLineWidth();
56   myPoints     = curve.getPointList();
57   myIO         = curve.getIO();
58   myTableIO    = curve.getTableIO();
59   return *this;
60 }
61
62 /*!
63   Sets curve's data. 
64 */
65 void SPlot2d_Curve::setData( const double* hData, const double* vData, long size )
66 {
67   clearAllPoints();
68   for(long i = 0; i < size; i++) addPoint(hData[i], vData[i]);
69 }