Salome HOME
Merge from V6_main 28/02/2013
[modules/gui.git] / src / SPlot2d / SPlot2d_Curve.cxx
index e6b2c5b8312a784c16f156332a27460e5fe0eb2c..a769bce7e155dc25c2bd018516dc5ed9a9f8addd 100644 (file)
@@ -1,27 +1,28 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
+// License as published by the Free Software Foundation; either
 // version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Curve.cxx
-//  Author : Sergey RUIN
-//  Module : SUIT
+//  Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
 
 #include "SPlot2d_Curve.h"
-using namespace std;
 
 /*!
   Constructor
@@ -42,19 +43,10 @@ SPlot2d_Curve::~SPlot2d_Curve()
   Copy constructor. Makes deep copy of data.
 */
 SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
+: Plot2d_Curve( curve )
 {
-  myAutoAssign = curve.isAutoAssign();
-  myHorTitle   = curve.getHorTitle();
-  myVerTitle   = curve.getVerTitle();
-  myHorUnits   = curve.getHorUnits();
-  myVerUnits   = curve.getVerUnits();
-  myColor      = curve.getColor();
-  myMarker     = curve.getMarker();
-  myLine       = curve.getLine();
-  myLineWidth  = curve.getLineWidth();
-  myPoints     = curve.getPointList();
-  myIO         = curve.getIO();
-  myTableIO    = curve.getTableIO();
+  myIO      = curve.getIO();
+  myTableIO = curve.getTableIO();
 }
 
 /*!
@@ -62,51 +54,65 @@ SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
 */
 SPlot2d_Curve& SPlot2d_Curve::operator=( const SPlot2d_Curve& curve )
 {
-  myAutoAssign = curve.isAutoAssign();
-  myHorTitle   = curve.getHorTitle();
-  myVerTitle   = curve.getVerTitle();
-  myHorUnits   = curve.getHorUnits();
-  myVerUnits   = curve.getVerUnits();
-  myColor      = curve.getColor();
-  myMarker     = curve.getMarker();
-  myLine       = curve.getLine();
-  myLineWidth  = curve.getLineWidth();
-  myPoints     = curve.getPointList();
+  Plot2d_Curve::operator=(curve);
   myIO         = curve.getIO();
   myTableIO    = curve.getTableIO();
   return *this;
 }
 
+/*!
+  \return corresponding SALOME_InteractiveObject
+*/
 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getIO() const
 {
   return myIO;
 }
 
+/*!
+  Sets corresponding SALOME_InteractiveObject
+  \param io - SALOME_InteractiveObject
+*/
 void SPlot2d_Curve::setIO( const Handle(SALOME_InteractiveObject)& io )
 {
   myIO = io;
 }
 
+/*!
+  \return true if curve has table interactive object
+*/
 bool SPlot2d_Curve::hasTableIO() const
 {
   return !myTableIO.IsNull();
 }
 
+/*!
+  \return table interactive object of curve
+*/
 Handle(SALOME_InteractiveObject) SPlot2d_Curve::getTableIO() const
 {
   return myTableIO;
 }
 
+/*!
+  Sets table interactive object of curve
+  \param io - SALOME_InteractiveObject
+*/
 void SPlot2d_Curve::setTableIO( const Handle(SALOME_InteractiveObject)& io )
 {
   myTableIO = io;
 }
 
+/*!
+  \return SALOME_InteractiveObject
+*/
 bool SPlot2d_Curve::hasIO() const
 {
   return !myIO.IsNull();
 }
 
+/*!
+  \return table title
+*/
 QString SPlot2d_Curve::getTableTitle() const
 {
   QString title;
@@ -114,3 +120,37 @@ QString SPlot2d_Curve::getTableTitle() const
     title = getTableIO()->getName();
   return title;
 }
+
+/*!
+  Add owner of the curve.
+  \param owner  - owner of the curve
+*/
+void SPlot2d_Curve::addOwner(const QString& owner) {
+  myOwners.insert(owner);
+}
+
+/*!
+  Remove owner of the curve.
+  \param owner  - owner of the curve
+*/
+void SPlot2d_Curve::removeOwner(const QString& owner) {
+  myOwners.insert(owner);
+}
+
+/*!
+  Get all owners of the curve.
+  \return owners of the curve.
+*/
+OwnerSet SPlot2d_Curve::getOwners() const {
+  return myOwners;
+}
+
+
+/*!
+  Add owners of the curve.
+  \param owners  - owners of the curve
+*/
+void SPlot2d_Curve::addOwners(OwnerSet& owners) {
+  myOwners = myOwners|=owners;
+}
+