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,
55 };
56 
63 class TYChemin
64 {
65  // Methods
66 public:
71  TYChemin();
76  TYChemin(const TYChemin& other);
81  virtual ~TYChemin();
82 
84  TYChemin& operator=(const TYChemin& other);
86  bool operator==(const TYChemin& other) const;
88  bool operator!=(const TYChemin& other) const;
89 
97  double getLongueur()
98  {
99  return _longueur;
100  }
101  const double getLongueur() const
102  {
103  return _longueur;
104  }
105 
106  void setLongueur(const double& longueur)
107  {
108  _longueur = longueur;
109  }
110 
119  double getDistance()
120  {
121  return _distance;
122  }
123  const double getDistance() const
124  {
125  return _distance;
126  }
127 
128  void setDistance(const double& distance)
129  {
130  _distance = distance;
131  }
132 
137  void setType(const TYTypeChemin& type)
138  {
139  _typeChemin = type;
140  }
141 
147  const TYTypeChemin getType() const
148  {
149  return _typeChemin;
150  }
151  // Members
156  template <typename T> void build_eq_path(const T& tabEtapes)
157  {
158  for (size_t i = 0; i < tabEtapes.size(); i++)
159  {
160  _eq_path->addEvent(tabEtapes[i].asEvent());
161  }
162  }
163 
165 
166 protected:
169 
171  double _longueur;
172 
174  double _distance;
175 
178 
179 private:
180 };
181 
183 typedef std::deque<TYChemin> TYTabChemin;
184 
185 #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:183
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:64
const double getDistance() const
Definition: TYChemin.h:123
double getDistance()
Get/Set the distance between source and receptor.
Definition: TYChemin.h:119
double getLongueur()
Get/Set the path length.
Definition: TYChemin.h:97
const TYTypeChemin getType() const
Return the path type.
Definition: TYChemin.h:147
double _distance
Direct distance between source and receptor.
Definition: TYChemin.h:174
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:168
bool operator!=(const TYChemin &other) const
Operator !=.
Definition: TYChemin.cpp:75
void setType(const TYTypeChemin &type)
Change the path type.
Definition: TYChemin.h:137
void setDistance(const double &distance)
Definition: TYChemin.h:128
acoustic_path * _eq_path
Equivalent acoustic_path.
Definition: TYChemin.h:177
TYChemin & operator=(const TYChemin &other)
Operator =.
Definition: TYChemin.cpp:37
void setLongueur(const double &longueur)
Definition: TYChemin.h:106
const double getLongueur() const
Definition: TYChemin.h:101
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:156
double _longueur
Total path length.
Definition: TYChemin.h:171
Acoustic path.
Definition: acoustic_path.h:78
virtual void addEvent(acoustic_event *TYEvent)
Add an event to the events list of the ray.