Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPanel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 #if TY_USE_IHM
18 #endif
19 #include "TYPanel.h"
20 
22 
24 {
26 
27  _firstPos = "";
28  _secondPos = "";
29  _value = "";
30 }
31 
33 {
34  *this = other;
35 }
36 
38 
40 {
41  if (this != &other)
42  {
43  TYElement::operator=(other);
44  _firstPos = other._firstPos;
45  _secondPos = other._secondPos;
46  _value = other._value;
47  }
48  return *this;
49 }
50 
51 bool TYPanel::operator==(const TYPanel& other) const
52 {
53  if (this != &other)
54  {
55  if (TYElement::operator!=(other))
56  {
57  return false;
58  }
59  if (_firstPos != other._firstPos)
60  {
61  return false;
62  }
63  if (_secondPos != other._secondPos)
64  {
65  return false;
66  }
67  if (_value != other._value)
68  {
69  return false;
70  }
71  }
72  return true;
73 }
74 
75 bool TYPanel::operator!=(const TYPanel& other) const
76 {
77  return !operator==(other);
78 }
79 
80 bool TYPanel::deepCopy(const TYElement* pOther, bool copyId /*=true*/, bool pUseCopyTag /*=false*/)
81 {
82  if (!TYElement::deepCopy(pOther, copyId))
83  {
84  return false;
85  }
86 
87  TYPanel* pOtherPanel = (TYPanel*)pOther;
88 
89  _firstPos = pOtherPanel->_firstPos;
90  _secondPos = pOtherPanel->_secondPos;
91  _value = pOtherPanel->_value;
92 
93  return true;
94 }
95 
96 std::string TYPanel::toString() const
97 {
98  return "TYPanel";
99 }
Representation graphique d'un panel d'informations (fichier header)
TY_EXT_GRAPHIC_INST(TYPanel)
virtual const char * getClassName() const
Definition: TYElement.h:249
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYElement.cpp:307
QString _name
Nom courant de l'element.
Definition: TYElement.h:966
TYElement & operator=(const TYElement &other)
Definition: TYElement.cpp:265
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
Classe de definition d'un panel d'information.
Definition: TYPanel.h:34
bool operator==(const TYPanel &other) const
Operateur ==.
Definition: TYPanel.cpp:51
TYPanel & operator=(const TYPanel &other)
Operateur =.
Definition: TYPanel.cpp:39
TYPanel()
Constructeur. Le constructeur de la calsse TYPanel.
Definition: TYPanel.cpp:23
virtual ~TYPanel()
Destructeur. Le destructeur de la calsse TYPanel.
Definition: TYPanel.cpp:37
virtual std::string toString() const
Definition: TYPanel.cpp:96
std::string _value
Definition: TYPanel.h:142
bool operator!=(const TYPanel &other) const
Operateur !=.
Definition: TYPanel.cpp:75
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYPanel.cpp:80
std::string _secondPos
Definition: TYPanel.h:141
std::string _firstPos
Definition: TYPanel.h:140