Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYTrajet.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_TRAJET__
17 #define __TY_TRAJET__
18 
19 #include "TYChemin.h"
24 #include <gtest/gtest_prod.h>
25 
34 class TYTrajet
35 {
36 
37  // Methods
38 public:
46 
51  TYTrajet(const TYTrajet& other);
56  virtual ~TYTrajet();
57 
59  TYTrajet& operator=(const TYTrajet& other);
61  bool operator==(const TYTrajet& other) const;
63  bool operator!=(const TYTrajet& other) const;
64 
69  void reset();
70 
77  double getDistance()
78  {
79  return _distance;
80  }
81  const double getDistance() const
82  {
83  return _distance;
84  }
85 
86  void setDistance(const double& distance)
87  {
88  _distance = distance;
89  }
90 
96  size_t getNbChemins()
97  {
98  return _chemins.size();
99  }
100 
107  {
108  return _chemins;
109  }
110 
117  {
118  return _cheminsDirect;
119  }
120 
125  void addChemin(const TYChemin& chemin);
126 
131  void addCheminDirect(const TYChemin& chemin);
132 
138  TYChemin getChemin(int index)
139  {
140  return _chemins.at(index);
141  }
142 
148 
154  void setPtSetPtR(const OPoint3D& pt1, const OPoint3D& pt2)
155  {
156  _ptS = pt1;
157  _ptR = pt2;
158  }
159  void getPtSetPtR(OPoint3D& pt1, OPoint3D& pt2)
160  {
161  pt1 = _ptS;
162  pt2 = _ptR;
163  }
164 
171  {
172  _ptS = seg._ptA;
173  _ptR = seg._ptB;
174  }
176  {
177  seg._ptA = _ptS, seg._ptB = _ptR;
178  }
179 
187  // TYSpectre& getSpectre() { return _sLP; }
188  // const TYSpectre getSpectre() const { return _sLP; }
189  // void setSpectre(const TYSpectre& spectre) { _sLP = spectre; }
191  {
192  return _sLP;
193  }
194  const OSpectre getSpectre() const
195  {
196  return _sLP;
197  }
198  void setSpectre(const OSpectre& spectre)
199  {
200  _sLP = spectre;
201  }
202 
208 
214 
215  // Get the tab of rays
216  std::vector<acoustic_path*>& get_tab_rays();
217 
218 private:
220  const AtmosphericConditions& atmos, const double& ri, const double& rj) const;
222  FRIEND_TEST(test_TYTrajet, getPInterference);
223  FRIEND_TEST(test_TYTrajet, getPEnergetique);
224 
225 public:
229 
233 
234  // Members
235 protected:
237  OPoint3D _ptS;
238 
240  OPoint3D _ptR;
241 
244 
247 
249  double _distance;
250 
253  // TYSpectre _sLP;
255 
257  std::vector<acoustic_path*> _tabRays;
258 };
259 #endif // __TY_TRAJET__
All base classes related to 3D manipulation.
std::deque< TYChemin > TYTabChemin
TYChemin collection.
Definition: TYChemin.h:255
Representation of one of the most optimal path between source and receptor: S—>R.
Class for the definition of atmospheric conditions.
The 3D point class.
Definition: 3d.h:487
Class to define a segment.
Definition: 3d.h:1089
OPoint3D _ptA
Point A of the segment.
Definition: 3d.h:1201
OPoint3D _ptB
Point B of the segment.
Definition: 3d.h:1203
Representation of one of the most optimal path between source and receptor: S—>R. The class TYChemin ...
Definition: TYChemin.h:71
This class TYTrajet (journey) links a couple Source-Receptor and a collection of paths,...
Definition: TYTrajet.h:35
tympan::AcousticReceptor & arcpt
Business receptor.
Definition: TYTrajet.h:229
double getDistance()
Definition: TYTrajet.h:77
void setPtSetPtRfromOSeg3D(const OSegment3D &seg)
Definition: TYTrajet.h:170
const OSpectre getSpectre() const
Definition: TYTrajet.h:194
OPoint3D _ptS
Source point definition in the site frame.
Definition: TYTrajet.h:235
OSpectre getPEnergetique(const AtmosphericConditions &atmos)
TYChemin getChemin(int index)
Definition: TYTrajet.h:138
void getPtSetPtRfromOSeg3D(OSegment3D &seg) const
Definition: TYTrajet.h:175
OPoint3D _ptR
Receptor point definition in the site frame.
Definition: TYTrajet.h:238
void build_tab_rays()
TYTabChemin _chemins
Paths collection.
Definition: TYTrajet.h:241
void addCheminDirect(const TYChemin &chemin)
OSpectre _sLP
Definition: TYTrajet.h:254
OSpectre getPNoOp()
void setDistance(const double &distance)
Definition: TYTrajet.h:86
void addChemin(const TYChemin &chemin)
void setPtSetPtR(const OPoint3D &pt1, const OPoint3D &pt2)
Definition: TYTrajet.h:154
OSpectre correctTiers(const OSpectreComplex &si, const OSpectreComplex &sj, const AtmosphericConditions &atmos, const double &ri, const double &rj) const
Definition: TYTrajet.cpp:369
std::vector< acoustic_path * > _tabRays
Vector of rays equivalent to chemin.
Definition: TYTrajet.h:254
size_t getNbChemins()
Definition: TYTrajet.h:96
void setSpectre(const OSpectre &spectre)
Definition: TYTrajet.h:198
bool operator!=(const TYTrajet &other) const
Operator !=.
tympan::source_idx asrc_idx
Definition: TYTrajet.h:226
TYTabChemin & getChemins()
Definition: TYTrajet.h:106
TYTrajet & operator=(const TYTrajet &other)
Operator =.
OSpectreOctave _sLP
Definition: TYTrajet.h:251
TYTabChemin _cheminsDirect
Direct paths collection (without obstacles)
Definition: TYTrajet.h:244
TYTrajet(const TYTrajet &other)
tympan::receptor_idx arcpt_idx
Definition: TYTrajet.h:230
std::vector< acoustic_path * > & get_tab_rays()
void reset()
virtual ~TYTrajet()
void getPtSetPtR(OPoint3D &pt1, OPoint3D &pt2)
Definition: TYTrajet.h:159
tympan::AcousticSource & asrc
Business source.
Definition: TYTrajet.h:225
double _distance
Distance between source and receptor.
Definition: TYTrajet.h:247
bool operator==(const TYTrajet &other) const
Operator ==.
TYTrajet(tympan::AcousticSource &asrc_, tympan::AcousticReceptor &arcpt_)
FRIEND_TEST(test_TYTrajet, getPInterference)
OSpectre getPInterference(const AtmosphericConditions &atmos)
Compute the quadratic pressure on the journey.
Definition: TYTrajet.cpp:199
FRIEND_TEST(test_TYTrajet, getPEnergetique)
const double getDistance() const
Definition: TYTrajet.h:81
TYTabChemin & getCheminsDirect()
Definition: TYTrajet.h:116
OSpectre & getSpectre()
Definition: TYTrajet.h:190
Describes an acoustic receptor.
Definition: entities.hpp:388
Describes an acoustic source.
Definition: entities.hpp:366
This file provides the declaration of the entities of the model, which inherit from BaseEntity.
size_t source_idx
Definition: entities.hpp:381
size_t receptor_idx
Definition: entities.hpp:398