Code_TYMPAN  4.2.0
Industrial site acoustic simulation
TYSolver.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_SOLVER__
17 #define __TY_SOLVER__
18 
19 #include <vector>
20 #include <memory>
21 #include "Tympan/core/interfaces.h"
25 #include "Tympan/core/interfaces.h"
28 
29 class OThreadPool;
30 class TYAcousticModel;
32 class TYFaceSelector;
33 class Scene;
34 
38 class TYSolver : public SolverInterface
39 {
40 public:
41  TYSolver();
42  virtual ~TYSolver();
43 
51  virtual bool solve(const tympan::AcousticProblemModel& aproblem,
53  tympan::LPSolverConfiguration configuration);
54 
55  const std::vector<TYStructSurfIntersect>& getTabPolygon() const { return _tabPolygon; }
56 
59 
61 
62  const Scene* getScene() const { return _scene.get(); }
63 
64 protected:
65  std::unique_ptr<TYFaceSelector> make_face_selector();
66  std::unique_ptr<TYAcousticPathFinder> make_path_finder();
67  std::unique_ptr<TYAcousticModel> make_acoustic_model();
68 
69  std::unique_ptr<TYFaceSelector> _faceSelector;
70  std::unique_ptr<TYAcousticPathFinder> _acousticPathFinder;
71  std::unique_ptr<TYAcousticModel> _acousticModel;
72 
73 private:
74  bool buildCalcStruct(const tympan::AcousticProblemModel& aproblem);
75 
81  bool appendTriangleToScene();
82 
83  // XXX This pointer is actually used like a C array :
84  // TODO replace with a std::deque or similar container.
85  std::vector<TYStructSurfIntersect> _tabPolygon;
86 
87  std::vector<TYTrajet*> _tabTrajets;
88 
90 
91 private:
92  std::unique_ptr<Scene> _scene;
93 };
94 
95 #endif // __TY_SOLVER__
std::unique_ptr< TYAcousticModel > _acousticModel
Pointer to the TYAcousticModel.
Definition: TYSolver.h:71
TYAcousticModel * getAcousticModel()
Get acoustic model.
Definition: TYSolver.h:60
This file provides the top-level declaration for the acoustic result model.
const std::vector< TYStructSurfIntersect > & getTabPolygon() const
Get the array of polygons.
Definition: TYSolver.h:55
This file provides the top-level declaration for the acoustic problem model.
TYSolver()
Constructor.
Definition: TYSolver.cpp:31
Building class of the faces list.
std::unique_ptr< TYFaceSelector > _faceSelector
Pointer to the TYFaceSelector.
Definition: TYSolver.h:69
This file provides class for solver configuration.
Default solver.
Definition: TYSolver.h:38
std::unique_ptr< Scene > _scene
Pointer to the Scene.
Definition: TYSolver.h:92
virtual ~TYSolver()
Destructor.
Definition: TYSolver.cpp:50
std::vector< TYTrajet * > _tabTrajets
Vector of TYTrajet.
Definition: TYSolver.h:87
bool buildCalcStruct(const tympan::AcousticProblemModel &aproblem)
Definition: TYSolver.cpp:183
std::unique_ptr< TYAcousticPathFinder > _acousticPathFinder
Pointer to the TYAcousticPathFinder.
Definition: TYSolver.h:70
const Scene * getScene() const
Get the Scene.
Definition: TYSolver.h:62
bool appendTriangleToScene()
Convertion des triangles Tympan en primitives utilisables par ray tracer.
Definition: TYSolver.cpp:213
Slave threads collection.
Definition: threading.h:254
Build the acoustic path for the default solver.
Class to describe the acoustic problem.
std::unique_ptr< TYFaceSelector > make_face_selector()
TYFaceSelector builder.
Definition: TYSolver.cpp:168
boost::shared_ptr< SolverConfiguration > LPSolverConfiguration
Definition: interfaces.h:24
TYFaceSelector * getFaceSelector()
Get the face selector.
Definition: TYSolver.h:57
This class mainly define a mesh (list of Shape) used by the Simulation object.
Definition: Scene.h:50
std::vector< TYStructSurfIntersect > _tabPolygon
Vector of TYStructSurfIntersect.
Definition: TYSolver.h:85
Contains the results of the model solved.
Acoustic model for the default solver.
OThreadPool * _pool
Definition: TYSolver.h:89
std::unique_ptr< TYAcousticPathFinder > make_path_finder()
TYAcousticPathFinder builder.
Definition: TYSolver.cpp:173
virtual bool solve(const tympan::AcousticProblemModel &aproblem, tympan::AcousticResultModel &aresult, tympan::LPSolverConfiguration configuration)
Launch the resolution and get the results.
Definition: TYSolver.cpp:66
TYAcousticPathFinder * getAcousticPathFinder()
Get the acoustic path finder.
Definition: TYSolver.h:58
std::unique_ptr< TYAcousticModel > make_acoustic_model()
TYAcousticModel builder.
Definition: TYSolver.cpp:178
Interface class for solvers.
Definition: interfaces.h:31