Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYChemin.h
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 #ifndef __TY_CHEMIN__
17 #define __TY_CHEMIN__
18 
22 
30 enum class TYTypeChemin
31 {
33  CHEMIN_SOL,
36 };
37 
38 ::std::ostream& operator<<(::std::ostream& out, const TYTypeChemin& value);
39 
41 {
47  DZ_TOP,
48  DZ_LEFT,
49  DZ_RIGHT,
57 };
58 
65 class TYChemin
66 {
67  // Methods
68 public:
73  TYChemin();
78  TYChemin(const TYChemin& other);
83  virtual ~TYChemin();
84 
86  TYChemin& operator=(const TYChemin& other);
88  bool operator==(const TYChemin& other) const;
90  bool operator!=(const TYChemin& other) const;
91 
99  double getLongueur()
100  {
101  return _longueur;
102  }
103  const double getLongueur() const
104  {
105  return _longueur;
106  }
107 
108  void setLongueur(const double& longueur)
109  {
110  _longueur = longueur;
111  }
112 
121  double getDistance()
122  {
123  return _distance;
124  }
125  const double getDistance() const
126  {
127  return _distance;
128  }
129 
130  void setDistance(const double& distance)
131  {
132  _distance = distance;
133  }
134 
139  void setType(const TYTypeChemin& type)
140  {
141  _typeChemin = type;
142  }
143 
149  const TYTypeChemin getType() const
150  {
151  return _typeChemin;
152  }
153  // Members
158  template <typename T> void build_eq_path(const T& tabEtapes)
159  {
160  for (size_t i = 0; i < tabEtapes.size(); i++)
161  {
162  _eq_path->addEvent(tabEtapes[i].asEvent());
163  }
164  }
165 
167 
168 protected:
171 
173  double _longueur;
174 
176  double _distance;
177 
180 
181 private:
182 };
183 
185 typedef std::deque<TYChemin> TYTabChemin;
186 
187 #endif // __TY_CHEMIN__
TYTypeAttenuation
Definition: TYChemin.h:41
TYTypeChemin
Definition: TYChemin.h:31
::std::ostream & operator<<(::std::ostream &out, const TYTypeChemin &value)
Definition: TYChemin.cpp:93
std::deque< TYChemin > TYTabChemin
TYChemin collection.
Definition: TYChemin.h:185
The 3D point class.
Definition: 3d.h:487
Representation of one of the most optimal path between source and receptor: S—>R. The class TYChemin ...
Definition: TYChemin.h:66
const double getDistance() const
Definition: TYChemin.h:125
double getDistance()
Get/Set the distance between source and receptor.
Definition: TYChemin.h:121
double getLongueur()
Get/Set the path length.
Definition: TYChemin.h:99
const TYTypeChemin getType() const
Return the path type.
Definition: TYChemin.h:149
double _distance
Direct distance between source and receptor.
Definition: TYChemin.h:176
TYChemin()
Constructor.
Definition: TYChemin.cpp:19
bool operator==(const TYChemin &other) const
Operator ==.
Definition: TYChemin.cpp:50
virtual ~TYChemin()
Destructor.
Definition: TYChemin.cpp:29
TYTypeChemin _typeChemin
Path type (has an influence on the algorithm)
Definition: TYChemin.h:170
bool operator!=(const TYChemin &other) const
Operator !=.
Definition: TYChemin.cpp:75
void setType(const TYTypeChemin &type)
Change the path type.
Definition: TYChemin.h:139
void setDistance(const double &distance)
Definition: TYChemin.h:130
acoustic_path * _eq_path
Equivalent acoustic_path.
Definition: TYChemin.h:179
TYChemin & operator=(const TYChemin &other)
Operator =.
Definition: TYChemin.cpp:37
void setLongueur(const double &longueur)
Definition: TYChemin.h:108
const double getLongueur() const
Definition: TYChemin.h:103
acoustic_path * get_ray(OPoint3D ptR)
Definition: TYChemin.cpp:80
void build_eq_path(const T &tabEtapes)
build an acoustic_path from the tab of etapes
Definition: TYChemin.h:158
double _longueur
Total path length.
Definition: TYChemin.h:173
Acoustic path.
Definition: acoustic_path.h:78
virtual void addEvent(acoustic_event *TYEvent)
Add an event to the events list of the ray.