Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYTrajet.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_TRAJET__
17 #define __TY_TRAJET__
18 
22 #include <gtest/gtest_prod.h>
23 
32 class TYTrajet
33 {
34 
35  // Methods
36 public:
44 
49  TYTrajet(const TYTrajet& other);
54  virtual ~TYTrajet();
55 
57  TYTrajet& operator=(const TYTrajet& other);
59  bool operator==(const TYTrajet& other) const;
61  bool operator!=(const TYTrajet& other) const;
62 
67  virtual void reset() = 0;
68 
75  double getDistance()
76  {
77  return _distance;
78  }
79  const double getDistance() const
80  {
81  return _distance;
82  }
83 
84  void setDistance(const double& distance)
85  {
86  _distance = distance;
87  }
88 
94  void setPtSetPtR(const OPoint3D& pt1, const OPoint3D& pt2)
95  {
96  _ptS = pt1;
97  _ptR = pt2;
98  }
99  void getPtSetPtR(OPoint3D& pt1, OPoint3D& pt2)
100  {
101  pt1 = _ptS;
102  pt2 = _ptR;
103  }
104 
111  {
112  _ptS = seg._ptA;
113  _ptR = seg._ptB;
114  }
116  {
117  seg._ptA = _ptS, seg._ptB = _ptR;
118  }
119 
120  // Get the tab of rays
121  std::vector<acoustic_path*>& get_tab_rays();
122 
123 private:
124 public:
128 
132 
133  // Members
134 protected:
137 
140 
142  double _distance;
143 
145  std::vector<acoustic_path*> _tabRays;
146 };
147 #endif // __TY_TRAJET__
All base classes related to 3D manipulation.
The 3D point class.
Definition: 3d.h:487
Class to define a segment.
Definition: 3d.h:1141
OPoint3D _ptA
Point A of the segment.
Definition: 3d.h:1253
OPoint3D _ptB
Point B of the segment.
Definition: 3d.h:1255
This class TYTrajet (journey) links a couple Source-Receptor and a collection of paths,...
Definition: TYTrajet.h:33
double getDistance()
Get/Set the distance between source and receptor.
Definition: TYTrajet.h:75
void setPtSetPtRfromOSeg3D(const OSegment3D &seg)
Get/Set points for source and receptor with an OSegment3D.
Definition: TYTrajet.h:110
OPoint3D _ptS
Source point definition in the site frame.
Definition: TYTrajet.h:136
void getPtSetPtRfromOSeg3D(OSegment3D &seg) const
Definition: TYTrajet.h:115
OPoint3D _ptR
Receptor point definition in the site frame.
Definition: TYTrajet.h:139
std::vector< acoustic_path * > _tabRays
Vector of rays equivalent to chemin.
Definition: TYTrajet.h:145
TYTrajet & operator=(const TYTrajet &other)
Operator =.
Definition: TYTrajet.cpp:43
tympan::AcousticSource & asrc
Business source.
Definition: TYTrajet.h:126
void setDistance(const double &distance)
Definition: TYTrajet.h:84
void setPtSetPtR(const OPoint3D &pt1, const OPoint3D &pt2)
Get/Set points for source and receptor.
Definition: TYTrajet.h:94
bool operator!=(const TYTrajet &other) const
Operator !=.
Definition: TYTrajet.cpp:89
tympan::source_idx asrc_idx
Definition: TYTrajet.h:127
virtual void reset()=0
Reset method.
virtual ~TYTrajet()
Destructor.
Definition: TYTrajet.cpp:41
tympan::receptor_idx arcpt_idx
Definition: TYTrajet.h:131
void getPtSetPtR(OPoint3D &pt1, OPoint3D &pt2)
Definition: TYTrajet.h:99
std::vector< acoustic_path * > & get_tab_rays()
Definition: TYTrajet.cpp:94
double _distance
Distance between source and receptor.
Definition: TYTrajet.h:142
bool operator==(const TYTrajet &other) const
Operator ==.
Definition: TYTrajet.cpp:58
tympan::AcousticReceptor & arcpt
Business receptor.
Definition: TYTrajet.h:130
TYTrajet(tympan::AcousticSource &asrc_, tympan::AcousticReceptor &arcpt_)
Constructor.
Definition: TYTrajet.cpp:19
const double getDistance() const
Definition: TYTrajet.h:79
Describes an acoustic receptor.
Definition: entities.hpp:403
Describes an acoustic source.
Definition: entities.hpp:381
This file provides the declaration of the entities of the model, which inherit from BaseEntity.
size_t source_idx
Definition: entities.hpp:396
size_t receptor_idx
Definition: entities.hpp:413