Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYEtape.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) 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.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
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 }
ACOUSTIC_EVENT_TYPES
Definition: acoustic_path.h:22
@ TY_NO_TYPE
Definition: acoustic_path.h:23
The TYEtape class is used to describe a part (a step) of a path (TYChemin) for the computation of tra...
Definition: TYEtape.h:45
OPoint3D _pt
The starting point of this step.
Definition: TYEtape.h:109
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:108
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
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