The Solver class gives an interface to the developer to add easily a new acoustic method using ray tracing. This class provides a way for the programmer to interact at each point of the ray tracing algorithm. It is possible to add several acoustic objects to model phenomena like diffraction. The features of this class are:
More...
#include <Solver.h>
|
| Solver () |
| Default constructor. More...
|
|
| Solver (Solver *_solver) |
| Copy constructor. More...
|
|
virtual bool | postTreatmentScene (Scene *scene, std::vector< Source > &sources, std::vector< Recepteur > &recepteurs) |
| Virtual function to post-process the Scene. It has two phases: transform the meta-objects and load the Scene. During the first phase, we iterate on the different meta-objects lists and are extracted elements for the ray tracer. Typically, a wall object would be transformed in a set of Primitives, extract polylines from punctual Sources,... The Scene will be loaded with objects related to acoustic calculation which are not present into the physical description of the Scene. For instance, diffraction edges are modeled by a cylinder and should be generated. More...
|
|
virtual double | leafTreatment (vector< Intersection > &primitives) |
| Leaf treatment function for accelerators. The default is to keep only the first intersection. It is possible to keep all the intersections which happens before a type specific intersection. For instance, we can keep all the intersections before an intersection with a triangle considered as blocking. More...
|
|
virtual bool | valideIntersection (Ray *r, Intersection *inter) |
| Validation function for an intersection. If the intersection is validated, an event is created and added on the ray. More...
|
|
virtual bool | valideRayon (Ray *r) |
| Ray validation. The developer may, for instance, choose a filtering on the rays and only validate single paths. If the ray is valid, it is added to the valid rays list and will be used for the export. More...
|
|
virtual bool | invalidRayon (Ray *r) |
| Method to arrange the invalid rays. The invalid rays are put away into a debug_ray array in order to visualize all of the rays. More...
|
|
virtual deque< Ray * > * | getValidRays () |
| Return a pointer to the validated rays list. More...
|
|
deque< Ray * > * | getDebugRays () |
| Return a pointer to the invalidated rays list. More...
|
|
virtual void | finish () |
| End the operations. More...
|
|
virtual void | clean () |
| Delete the valid rays array. More...
|
|
virtual bool | loadParameters () |
| Load the computation parameters. More...
|
|
The Solver class gives an interface to the developer to add easily a new acoustic method using ray tracing. This class provides a way for the programmer to interact at each point of the ray tracing algorithm. It is possible to add several acoustic objects to model phenomena like diffraction. The features of this class are:
- post-treatment of the scene
- leaf treatment in accelerators
- intersection validation (generation of the proper event)
- ray validation and export
- Warning
- The developer should check the consistency of the functions used in the library. For instance, if he chooses to post-process the scene by adding diffraction edges without defining the validation function for these edges, then each intersection with an edge will be ignored.
Definition at line 42 of file Solver.h.
◆ Solver() [1/2]
Default constructor.
Definition at line 46 of file Solver.h.
◆ Solver() [2/2]
Solver::Solver |
( |
Solver * |
_solver | ) |
|
|
inline |
Copy constructor.
Definition at line 51 of file Solver.h.
◆ clean()
Delete the valid rays array.
Definition at line 55 of file Solver.cpp.
◆ finish()
◆ getDebugRays()
deque<Ray*>* Solver::getDebugRays |
( |
| ) |
|
|
inline |
Return a pointer to the invalidated rays list.
Definition at line 108 of file Solver.h.
◆ getValidRays()
virtual deque<Ray*>* Solver::getValidRays |
( |
| ) |
|
|
inlinevirtual |
Return a pointer to the validated rays list.
Definition at line 104 of file Solver.h.
◆ invalidRayon()
bool Solver::invalidRayon |
( |
Ray * |
r | ) |
|
|
virtual |
Method to arrange the invalid rays. The invalid rays are put away into a debug_ray array in order to visualize all of the rays.
- Parameters
-
- Returns
- Return true if the ray has been invalidated.
Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.
Definition at line 71 of file Solver.cpp.
◆ leafTreatment()
double Solver::leafTreatment |
( |
vector< Intersection > & |
primitives | ) |
|
|
virtual |
Leaf treatment function for accelerators. The default is to keep only the first intersection. It is possible to keep all the intersections which happens before a type specific intersection. For instance, we can keep all the intersections before an intersection with a triangle considered as blocking.
- Parameters
-
primitives | All the primitives encountered by the current leaf. |
- Returns
- Maximal time authorized by the ray. It is the intersection time before the first blocking primitive.
Definition at line 38 of file Solver.cpp.
◆ loadParameters()
bool Solver::loadParameters |
( |
| ) |
|
|
virtual |
Load the computation parameters.
- Returns
- True if operation succeeds.
Definition at line 78 of file Solver.cpp.
◆ postTreatmentScene()
bool Solver::postTreatmentScene |
( |
Scene * |
scene, |
|
|
std::vector< Source > & |
sources, |
|
|
std::vector< Recepteur > & |
recepteurs |
|
) |
| |
|
virtual |
Virtual function to post-process the Scene. It has two phases: transform the meta-objects and load the Scene. During the first phase, we iterate on the different meta-objects lists and are extracted elements for the ray tracer. Typically, a wall object would be transformed in a set of Primitives, extract polylines from punctual Sources,... The Scene will be loaded with objects related to acoustic calculation which are not present into the physical description of the Scene. For instance, diffraction edges are modeled by a cylinder and should be generated.
- Parameters
-
scene | Scene to post-process |
sources | Sources |
recepteurs | Receptors |
- Returns
- Return true if success
Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.
Definition at line 33 of file Solver.cpp.
◆ valideIntersection()
Validation function for an intersection. If the intersection is validated, an event is created and added on the ray.
- Parameters
-
r | : Ray |
inter | : Intersection to validate |
- Returns
- Return true if the validation is done
- Warning
- The validation functions should agree with the primitives types in the Scene. The unsupported primitives types should throw an exception if not handled by the simulation.
Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.
Definition at line 44 of file Solver.cpp.
◆ valideRayon()
bool Solver::valideRayon |
( |
Ray * |
r | ) |
|
|
virtual |
Ray validation. The developer may, for instance, choose a filtering on the rays and only validate single paths. If the ray is valid, it is added to the valid rays list and will be used for the export.
- Parameters
-
r | : Ray to validate. The ray should have a source and a receiver. |
- Returns
- Return true if the ray has been validated.
Reimplemented in BasicSolver, and TYANIME3DRayTracerSolverAdapter.
Definition at line 49 of file Solver.cpp.
◆ debug_rays
deque<Ray*> Solver::debug_rays |
|
protected |
Rays list which are invalidated by the solver.
Definition at line 124 of file Solver.h.
◆ valid_rays
deque<Ray*> Solver::valid_rays |
|
protected |
Rays list which are validated by the solver.
Definition at line 123 of file Solver.h.
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/codetympan/checkouts/latest/Tympan/geometric_methods/AcousticRaytracer/Acoustic/Solver.h
- /home/docs/checkouts/readthedocs.org/user_builds/codetympan/checkouts/latest/Tympan/geometric_methods/AcousticRaytracer/Acoustic/Solver.cpp