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_9613__
17 #define __TY_TRAJET_9613__
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 
190  {
191  return _sLP;
192  }
193 
204  {
205  return _sLP.toTOct().toGPhy();
206  }
207  const OSpectre getSpectre() const
208  {
209  return _sLP.toTOct().toGPhy();
210  }
211 
217 
218  // Get the tab of rays
219  std::vector<acoustic_path*>& get_tab_rays();
220 
221  void build_tab_rays();
222 
223 public:
227 
231 
232  // Members
233 protected:
236 
239 
242 
245 
247  double _distance;
248 
252 
254  std::vector<acoustic_path*> _tabRays;
255 };
256 #endif // __TY_TRAJET_9613__
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
OSpectreAbstract & toGPhy() const
Converts to physical quantity.
Definition: spectre.cpp:634
OSpectreAbstract & toTOct() const
Converts to one-third Octave.
Definition: spectre.cpp:701
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()
Get/Set the distance between source and receptor.
Definition: TYTrajet.h:77
void setPtSetPtRfromOSeg3D(const OSegment3D &seg)
Get/Set points for source and receptor with an OSegment3D.
Definition: TYTrajet.h:170
const OSpectre getSpectre() const
Definition: TYTrajet.h:207
OPoint3D _ptS
Source point definition in the site frame.
Definition: TYTrajet.h:235
OSpectreOctave getPEnergetique(const AtmosphericConditions &atmos)
Compute the acoustic pressure in octave bands on the journey.
Definition: TYTrajet.cpp:129
TYChemin getChemin(int index)
Return a path thanks to its index.
Definition: TYTrajet.h:138
void getPtSetPtRfromOSeg3D(OSegment3D &seg) const
Definition: TYTrajet.h:175
TYTabChemin & getCheminsDirect()
Return an array of the direct paths.
Definition: TYTrajet.h:116
OPoint3D _ptR
Receptor point definition in the site frame.
Definition: TYTrajet.h:238
void build_tab_rays()
Definition: TYTrajet.cpp:198
TYTabChemin _chemins
Paths collection.
Definition: TYTrajet.h:241
void addCheminDirect(const TYChemin &chemin)
Add a new path to the array of direct paths.
Definition: TYTrajet.cpp:119
TYTrajet & operator=(const TYTrajet &other)
Operator =.
Definition: TYTrajet.cpp:53
OSpectreOctave getPNoOp()
Return the attenuation without computation (computed by an external function)
Definition: TYTrajet.cpp:124
void setDistance(const double &distance)
Definition: TYTrajet.h:86
void addChemin(const TYChemin &chemin)
Add a new path.
Definition: TYTrajet.cpp:114
void setPtSetPtR(const OPoint3D &pt1, const OPoint3D &pt2)
Get/Set points for source and receptor.
Definition: TYTrajet.h:154
TYTabChemin & getChemins()
Return the collection of paths of *this.
Definition: TYTrajet.h:106
std::vector< acoustic_path * > _tabRays
Vector of rays equivalent to chemin.
Definition: TYTrajet.h:254
size_t getNbChemins()
Return the number of path in *this (in addition to the direct path).
Definition: TYTrajet.h:96
bool operator!=(const TYTrajet &other) const
Operator !=.
Definition: TYTrajet.cpp:109
tympan::source_idx asrc_idx
Definition: TYTrajet.h:226
OSpectre getSpectre()
Get the spectrum in third-octave band at the receptor point \Used to build the result matrix by TYSol...
Definition: TYTrajet.h:203
OSpectreOctave _sLP
Definition: TYTrajet.h:251
TYTabChemin _cheminsDirect
Direct paths collection (without obstacles)
Definition: TYTrajet.h:244
virtual ~TYTrajet()
Destructor.
Definition: TYTrajet.cpp:42
tympan::receptor_idx arcpt_idx
Definition: TYTrajet.h:230
OSpectreOctave & getSpectreOct()
Get the spectrum in octave band at the receptor point \Used to compute the pressure spectrum in octav...
Definition: TYTrajet.h:189
void reset()
Reset method.
Definition: TYTrajet.cpp:47
void getPtSetPtR(OPoint3D &pt1, OPoint3D &pt2)
Definition: TYTrajet.h:159
tympan::AcousticSource & asrc
Business source.
Definition: TYTrajet.h:225
std::vector< acoustic_path * > & get_tab_rays()
Definition: TYTrajet.cpp:207
double _distance
Distance between source and receptor.
Definition: TYTrajet.h:247
bool operator==(const TYTrajet &other) const
Operator ==.
Definition: TYTrajet.cpp:70
TYTrajet(tympan::AcousticSource &asrc_, tympan::AcousticReceptor &arcpt_)
Constructor.
Definition: TYTrajet.cpp:19
const double getDistance() const
Definition: TYTrajet.h:81
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