Code_TYMPAN  4.2.0
Industrial site acoustic simulation
TYChemin.h
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 #ifndef __TY_CHEMIN__
17 #define __TY_CHEMIN__
18 
19 
20 #include <deque>
21 #include "TYEtape.h"
24 
38 class TYChemin
39 {
40  // Methods
41 public:
46  TYChemin();
51  TYChemin(const TYChemin& other);
56  virtual ~TYChemin();
57 
59  TYChemin& operator=(const TYChemin& other);
61  bool operator==(const TYChemin& other) const;
63  bool operator!=(const TYChemin& other) const;
64 
69  void calcAttenuation(const TYTabEtape& tabEtapes, const AtmosphericConditions& atmos);
70 
78  const OSpectreComplex& getAttenuation() const { return _attenuation; }
79 
84  void setAttenuation(const OSpectreComplex& att) { _attenuation = att; }
92  double getLongueur() { return _longueur; }
93  const double getLongueur() const { return _longueur; }
94 
95  void setLongueur(const double& longueur) { _longueur = longueur; }
96 
105  double getDistance() { return _distance; }
106  const double getDistance() const { return _distance; }
107 
108  void setDistance(const double& distance) { _distance = distance; }
109 
114  void setType(const int& type) { _typeChemin = (TYTypeChemin)type; } const
115 
121  int getType() const { return _typeChemin; }
122  // Members
127  void build_eq_path(const TYTabEtape& tabEtapes);
129 
130 protected:
133 
135  double _longueur;
136 
138  double _distance;
139 
142 
145 };
146 
147 
149 typedef std::deque<TYChemin> TYTabChemin;
150 
151 
152 
153 #endif // __TY_CHEMIN__
void setType(const int &type)
Change the path type.
Definition: TYChemin.h:114
Representation of one of the most optimal path between source and receptor: S—>R. The class TYChemin represents a path between a Source and a receptor (Recepteur class). It&#39;s constituted of a collection of steps (TYEtape class).
Definition: TYChemin.h:38
bool operator==(const TYChemin &other) const
Operator ==.
Definition: TYChemin.cpp:53
bool operator!=(const TYChemin &other) const
Operator !=.
Definition: TYChemin.cpp:67
double getLongueur()
Get/Set the path length.
Definition: TYChemin.h:92
void build_eq_path(const TYTabEtape &tabEtapes)
build an acoustic_path from the tab of etapes
Definition: TYChemin.cpp:150
double _longueur
Total path length.
Definition: TYChemin.h:135
std::deque< TYChemin > TYTabChemin
TYChemin collection.
Definition: TYChemin.h:149
OSpectreComplex _attenuation
Attenuation spectrum of the path.
Definition: TYChemin.h:141
acoustic_path * _eq_path
Equivalent acoustic_path.
Definition: TYChemin.h:144
TYTypeChemin
Definition: TYChemin.h:32
double getDistance()
Get/Set the distance between source and receptor.
Definition: TYChemin.h:105
const double getDistance() const
Definition: TYChemin.h:106
double _distance
Direct distance between source and receptor.
Definition: TYChemin.h:138
const OSpectreComplex & getAttenuation() const
Definition: TYChemin.h:78
void calcAttenuation(const TYTabEtape &tabEtapes, const AtmosphericConditions &atmos)
Compute the global attenuation on the path.
Definition: TYChemin.cpp:72
void setDistance(const double &distance)
Definition: TYChemin.h:108
const double getLongueur() const
Definition: TYChemin.h:93
void setAttenuation(const OSpectreComplex &att)
Set the attenuation.
Definition: TYChemin.h:84
std::deque< TYEtape > TYTabEtape
TYEtape collection.
Definition: TYEtape.h:149
void setLongueur(const double &longueur)
Definition: TYChemin.h:95
TYChemin()
Constructor.
Definition: TYChemin.cpp:20
The 3D point class.
Definition: 3d.h:484
Class for the definition of atmospheric conditions.
virtual ~TYChemin()
Destructor.
Definition: TYChemin.cpp:31
TYChemin & operator=(const TYChemin &other)
Operator =.
Definition: TYChemin.cpp:39
acoustic_path * get_ray(OPoint3D ptR)
Definition: TYChemin.cpp:159
Acoustic path.
Definition: acoustic_path.h:75
OSpectreComplex & getAttenuation()
Return the path attenuation.
Definition: TYChemin.h:77
TYTypeChemin _typeChemin
Path type (has an influence on the algorithm)
Definition: TYChemin.h:132
int getType() const
Return the path type.
Definition: TYChemin.h:121