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,
58 };
59 
66 class TYChemin
67 {
68  // Methods
69 public:
74  TYChemin();
79  TYChemin(const TYChemin& other);
84  virtual ~TYChemin();
85 
87  TYChemin& operator=(const TYChemin& other);
89  bool operator==(const TYChemin& other) const;
91  bool operator!=(const TYChemin& other) const;
92 
100  double getLongueur()
101  {
102  return _longueur;
103  }
104  const double getLongueur() const
105  {
106  return _longueur;
107  }
108 
109  void setLongueur(const double& longueur)
110  {
111  _longueur = longueur;
112  }
113 
122  double getDistance()
123  {
124  return _distance;
125  }
126  const double getDistance() const
127  {
128  return _distance;
129  }
130 
131  void setDistance(const double& distance)
132  {
133  _distance = distance;
134  }
135 
140  void setType(const TYTypeChemin& type)
141  {
142  _typeChemin = type;
143  }
144 
150  const TYTypeChemin getType() const
151  {
152  return _typeChemin;
153  }
154  // Members
159  template <typename T> void build_eq_path(const T& tabEtapes)
160  {
161  for (size_t i = 0; i < tabEtapes.size(); i++)
162  {
163  _eq_path->addEvent(tabEtapes[i].asEvent());
164  }
165  }
166 
168 
169 protected:
172 
174  double _longueur;
175 
177  double _distance;
178 
181 
182 private:
183 };
184 
186 typedef std::deque<TYChemin> TYTabChemin;
187 
188 #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:186
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:67
const double getDistance() const
Definition: TYChemin.h:126
double getDistance()
Get/Set the distance between source and receptor.
Definition: TYChemin.h:122
double getLongueur()
Get/Set the path length.
Definition: TYChemin.h:100
const TYTypeChemin getType() const
Return the path type.
Definition: TYChemin.h:150
double _distance
Direct distance between source and receptor.
Definition: TYChemin.h:177
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:171
bool operator!=(const TYChemin &other) const
Operator !=.
Definition: TYChemin.cpp:75
void setType(const TYTypeChemin &type)
Change the path type.
Definition: TYChemin.h:140
void setDistance(const double &distance)
Definition: TYChemin.h:131
acoustic_path * _eq_path
Equivalent acoustic_path.
Definition: TYChemin.h:180
TYChemin & operator=(const TYChemin &other)
Operator =.
Definition: TYChemin.cpp:37
void setLongueur(const double &longueur)
Definition: TYChemin.h:109
const double getLongueur() const
Definition: TYChemin.h:104
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:159
double _longueur
Total path length.
Definition: TYChemin.h:174
Acoustic path.
Definition: acoustic_path.h:78
virtual void addEvent(acoustic_event *TYEvent)
Add an event to the events list of the ray.