Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / SPlot2d / SPlot2d_Curve.cxx
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 //  File   : SPlot2d_Curve.cxx
20 //  Author : Sergey RUIN
21 //  Module : SUIT
22
23 #include "SPlot2d_Curve.h"
24 using namespace std;
25
26 /*!
27   Constructor
28 */
29 SPlot2d_Curve::SPlot2d_Curve()
30 :Plot2d_Curve() 
31 {
32 }
33
34 /*!
35   Destructor
36 */
37 SPlot2d_Curve::~SPlot2d_Curve()
38 {
39 }
40
41 /*!
42   Copy constructor. Makes deep copy of data.
43 */
44 SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
45 {
46   myAutoAssign = curve.isAutoAssign();
47   myHorTitle   = curve.getHorTitle();
48   myVerTitle   = curve.getVerTitle();
49   myHorUnits   = curve.getHorUnits();
50   myVerUnits   = curve.getVerUnits();
51   myColor      = curve.getColor();
52   myMarker     = curve.getMarker();
53   myLine       = curve.getLine();
54   myLineWidth  = curve.getLineWidth();
55   myPoints     = curve.getPointList();
56   myIO         = curve.getIO();
57   myTableIO    = curve.getTableIO();
58 }
59
60 /*!
61   operator=. Makes deep copy of data.
62 */
63 SPlot2d_Curve& SPlot2d_Curve::operator=( const SPlot2d_Curve& curve )
64 {
65   myAutoAssign = curve.isAutoAssign();
66   myHorTitle   = curve.getHorTitle();
67   myVerTitle   = curve.getVerTitle();
68   myHorUnits   = curve.getHorUnits();
69   myVerUnits   = curve.getVerUnits();
70   myColor      = curve.getColor();
71   myMarker     = curve.getMarker();
72   myLine       = curve.getLine();
73   myLineWidth  = curve.getLineWidth();
74   myPoints     = curve.getPointList();
75   myIO         = curve.getIO();
76   myTableIO    = curve.getTableIO();
77   return *this;
78 }
79
80 /*!
81   \return corresponding SALOME_InteractiveObject
82 */
83 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getIO() const
84 {
85   return myIO;
86 }
87
88 /*!
89   Sets corresponding SALOME_InteractiveObject
90   \param io - SALOME_InteractiveObject
91 */
92 void SPlot2d_Curve::setIO( const Handle(SALOME_InteractiveObject)& io )
93 {
94   myIO = io;
95 }
96
97 /*!
98   \return true if curve has table interactive object
99 */
100 bool SPlot2d_Curve::hasTableIO() const
101 {
102   return !myTableIO.IsNull();
103 }
104
105 /*!
106   \return table interactive object of curve
107 */
108 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getTableIO() const
109 {
110   return myTableIO;
111 }
112
113 /*!
114   Sets table interactive object of curve
115   \param io - SALOME_InteractiveObject
116 */
117 void SPlot2d_Curve::setTableIO( const Handle(SALOME_InteractiveObject)& io )
118 {
119   myTableIO = io;
120 }
121
122 /*!
123   \return SALOME_InteractiveObject
124 */
125 bool SPlot2d_Curve::hasIO() const
126 {
127   return !myIO.IsNull();
128 }
129
130 /*!
131   \return table title
132 */
133 QString SPlot2d_Curve::getTableTitle() const
134 {
135   QString title;
136   if( hasTableIO() )
137     title = getTableIO()->getName();
138   return title;
139 }