Salome HOME
PAL9764 - names and units aren't displayed in Plot2d
[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 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getIO() const
63 {
64   return myIO;
65 }
66
67 void SPlot2d_Curve::setIO( const Handle(SALOME_InteractiveObject)& io )
68 {
69   myIO = io;
70 }
71
72 bool SPlot2d_Curve::hasTableIO() const
73 {
74   return !myTableIO.IsNull();
75 }
76
77 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getTableIO() const
78 {
79   return myTableIO;
80 }
81
82 void SPlot2d_Curve::setTableIO( const Handle(SALOME_InteractiveObject)& io )
83 {
84   myTableIO = io;
85 }
86
87 bool SPlot2d_Curve::hasIO() const
88 {
89   return !myIO.IsNull();
90 }
91
92 QString SPlot2d_Curve::getTableTitle() const
93 {
94   QString title;
95   if( hasTableIO() )
96     title = getTableIO()->getName();
97   return title;
98 }