Salome HOME
updated copyright message
[modules/gui.git] / src / SPlot2d / SPlot2d_Curve.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : SPlot2d_Curve.cxx
23 //  Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
24
25 #include "SPlot2d_Curve.h"
26
27 /*!
28   Constructor
29 */
30 SPlot2d_Curve::SPlot2d_Curve()
31 :Plot2d_Curve() 
32 {
33 }
34
35 /*!
36   Destructor
37 */
38 SPlot2d_Curve::~SPlot2d_Curve()
39 {
40 }
41
42 /*!
43   Copy constructor. Makes deep copy of data.
44 */
45 SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
46 : Plot2d_Curve( curve )
47 {
48   myIO      = curve.getIO();
49   myTableIO = curve.getTableIO();
50 }
51
52 /*!
53   operator=. Makes deep copy of data.
54 */
55 SPlot2d_Curve& SPlot2d_Curve::operator=( const SPlot2d_Curve& curve )
56 {
57   Plot2d_Curve::operator=(curve);
58   myIO         = curve.getIO();
59   myTableIO    = curve.getTableIO();
60   return *this;
61 }
62
63 /*!
64   \return corresponding SALOME_InteractiveObject
65 */
66 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getIO() const
67 {
68   return myIO;
69 }
70
71 /*!
72   Sets corresponding SALOME_InteractiveObject
73   \param io - SALOME_InteractiveObject
74 */
75 void SPlot2d_Curve::setIO( const Handle(SALOME_InteractiveObject)& io )
76 {
77   myIO = io;
78 }
79
80 /*!
81   \return true if curve has table interactive object
82 */
83 bool SPlot2d_Curve::hasTableIO() const
84 {
85   return !myTableIO.IsNull();
86 }
87
88 /*!
89   \return table interactive object of curve
90 */
91 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getTableIO() const
92 {
93   return myTableIO;
94 }
95
96 /*!
97   Sets table interactive object of curve
98   \param io - SALOME_InteractiveObject
99 */
100 void SPlot2d_Curve::setTableIO( const Handle(SALOME_InteractiveObject)& io )
101 {
102   myTableIO = io;
103 }
104
105 /*!
106   \return SALOME_InteractiveObject
107 */
108 bool SPlot2d_Curve::hasIO() const
109 {
110   return !myIO.IsNull();
111 }
112
113 /*!
114   \return table title
115 */
116 QString SPlot2d_Curve::getTableTitle() const
117 {
118   QString title;
119   if( hasTableIO() )
120     title = getTableIO()->getName();
121   return title;
122 }
123
124 /*!
125   Add owner of the curve.
126   \param owner  - owner of the curve
127 */
128 void SPlot2d_Curve::addOwner(const QString& owner) {
129   myOwners.insert(owner);
130 }
131
132 /*!
133   Remove owner of the curve.
134   \param owner  - owner of the curve
135 */
136 void SPlot2d_Curve::removeOwner(const QString& owner) {
137   myOwners.insert(owner);
138 }
139
140 /*!
141   Get all owners of the curve.
142   \return owners of the curve.
143 */
144 OwnerSet SPlot2d_Curve::getOwners() const {
145   return myOwners;
146 }
147
148
149 /*!
150   Add owners of the curve.
151   \param owners  - owners of the curve
152 */
153 void SPlot2d_Curve::addOwners(OwnerSet& owners) {
154   myOwners = myOwners|=owners;
155 }
156