Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYEtape.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 #include "TYEtape.h"
17 
19 
21 {
22  *this = other;
23 }
24 
26 
28 {
29  if (this != &other)
30  {
31  _type = other._type;
32  _pt = other._pt;
33  _Absorption = other._Absorption;
34  _Attenuation = other._Attenuation;
35  }
36  return *this;
37 }
38 
39 bool TYEtape::operator==(const TYEtape& other) const
40 {
41  if (this != &other)
42  {
43  if (_type != other._type)
44  {
45  return false;
46  }
47  if (_pt != other._pt)
48  {
49  return false;
50  }
51  if (_Absorption != other._Absorption)
52  {
53  return false;
54  }
55  if (_Attenuation != other._Attenuation)
56  {
57  return false;
58  }
59  }
60  return true;
61 }
62 
63 bool TYEtape::operator!=(const TYEtape& other) const
64 {
65  return !operator==(other);
66 }
67 
69 {
70  acoustic_event* returned_event = new acoustic_event();
71  returned_event->pos = _pt;
72  returned_event->type = _type;
73  return returned_event;
74 }
The TYEtape class is used to describe a part (a step) of a path (TYChemin) for the computation of tra...
Definition: TYEtape.h:47
OPoint3D _pt
The starting point of this step.
Definition: TYEtape.h:186
TYEtape & operator=(const TYEtape &other)
Operator =.
Definition: TYEtape.cpp:27
bool operator!=(const TYEtape &other) const
Operator !=.
Definition: TYEtape.cpp:63
ACOUSTIC_EVENT_TYPES _type
Acoustic event type.
Definition: TYEtape.h:185
bool operator==(const TYEtape &other) const
Operator ==.
Definition: TYEtape.cpp:39
TYEtape()
Constructor.
Definition: TYEtape.cpp:18
acoustic_event * asEvent() const
Definition: TYEtape.cpp:68
OSpectreOctave _Absorption
absorption Spectrum
Definition: TYEtape.h:187
OSpectreOctave _Attenuation
attenuation Spectrum
Definition: TYEtape.h:188
virtual ~TYEtape()
Destructor.
Definition: TYEtape.cpp:25
This class store data and provide functions to manipulate event in the acoustic context.
Definition: acoustic_path.h:40
ACOUSTIC_EVENT_TYPES type
Event type.
Definition: acoustic_path.h:60
OPoint3D pos
Event position.
Definition: acoustic_path.h:53