Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TYReflectionPathFinderART Class Reference

Reflection path finder relying on ray-tracing using the AcousticRaytracer module. More...

#include <TYReflectionPathFinder.h>

Inheritance diagram for TYReflectionPathFinderART:
Inheritance graph
[legend]
Collaboration diagram for TYReflectionPathFinderART:
Collaboration graph
[legend]

Public Member Functions

 TYReflectionPathFinderART (unsigned int nbRays)
 
std::unique_ptr< TYAbstractReflectionPathFinderinstanciate () const override
 Instanciate a new TYReflectionPathFinderART. The configuration of the former path finder (number of rays, ...) is transfered to the new instance. More...
 
bool setup (size_t maxOrder, const std::deque< TYSIntersection > &tabIntersect, const OPoint3D &source, const OPoint3D &receptor) override
 Set the scene to be treated by the path finder. More...
 
bool remainingPaths () const override
 Tell if some paths remain in the set of remaining paths. More...
 
TYReflectionPath popPath () override
 Give the last computed reflection path, and remove it from the set of remaining paths. More...
 
- Public Member Functions inherited from TYAbstractReflectionPathFinder
virtual ~TYAbstractReflectionPathFinder ()=default
 

Protected Member Functions

 TYReflectionPathFinderART ()=default
 
void setupConfiguration (size_t maxOrder)
 Setup ART' Simulation configuration. More...
 
bool setupScene (const std::deque< TYSIntersection > &tabIntersect, const OPoint3D &sourcePoint, const OPoint3D &receptorPoint)
 Build an AcousticRaytracer scene containing one source, one receptor, and a collection of faces. The faces are built from intersecting segments in EL-plane. Each segment is extruded along normal direction of EL-plane towards up and down directions of a certain length, to avoid singularities (ray-border of faces intersections) during ray tracing. More...
 
void setupAcceleratingDataStructure ()
 Setup accelerating data-structure using ART' Simulation configuration. More...
 
void setupSolver ()
 Setup ART' simulation solver. More...
 
void computeRaytracing ()
 Perform raytracing simulation. More...
 
void buildReflectionPaths (const OPoint3D &source, const OPoint3D &receptor)
 Build reflection paths from valid rays found by the solver. For each sequence of reflecting barriers, only one path is built. More...
 
bool processIntersectingSegment (const TYSIntersection &inter)
 Process an intersecting segment in EL-plane to add equivalent faces in the AcousticRaytracer' simulation scene. Intersecting segments which do not belong to EL-plane are ignored. More...
 
bool processInfraIntersectingSegment (const TYSIntersection &inter)
 Process an infrastructure intersecting segment in EL-plane to add equivalent faces in the AcousticRaytracer' simulation scene. More...
 
bool processTopoIntersectingSegment (const TYSIntersection &inter)
 Process a topography intersecting segment in EL-plane to add equivalent faces in the AcousticRaytracer' simulation scene. More...
 
void buildQuadranglePointsFromInter (const TYSIntersection &inter, OPoint3D &p1Top, OPoint3D &p1Bottom, OPoint3D &p2Top, OPoint3D &p2Bottom) const
 Compute points forming a quadrangle from an intersecting segment in EL-plane. Points are obtained by adding or substracting _extrusionLength along the normal direction of EL-plane to points forming the segment. More...
 
void addOrientedQuadrangle (const OPoint3D &p1Top, const OPoint3D &p1Bottom, const OPoint3D &p2Top, const OPoint3D &p2Bottom, const OVector3D vExt, const TYSIntersection &sourceInter)
 Add an oriented quadrangle to the AcousticRaytracer' simulation scene. The quadrangle is oriented using a vector pointing towards the exterior of the quadrangle. The address of the intersecting segment from which come the quadrangle is used to map the added quadrangle to the intersecting segment. More...
 
ShapeaddOrientedTriangle (const OPoint3D &p1, const OPoint3D &p2, const OPoint3D &p3, const OVector3D &vExt)
 Add an oriented triangle to the AcousticRaytracer' simulation scene. The vertices (v1 = p1, v2 = p2 or p3, v3 = p2 or p3) are set such that the normal of the triangle (v2-v1) x (v3-v1) is oriented the same than vExt. More...
 
OVector3D computeELPlaneNormal (const OPoint3D &source, const OPoint3D &receptor)
 Compute a normal vector of the EL-plane Hypothesis: source and receptor are not aligned along a vertical line. More...
 
bool isPathValid (const TYReflectionPath &path)
 Check if a path is valid. In plus of validation performed during raytracing, it has to be verified: More...
 
bool isPathAlreadyFound (const TYReflectionPath &path) const
 Check if a path has already been found. More...
 
bool isLastSegmentIntersectingSceneElement (const TYReflectionPath &path)
 Check if the last segment of a path intersects a scene element. More...
 
- Protected Member Functions inherited from TYAbstractReflectionPathFinder
 TYAbstractReflectionPathFinder ()=default
 

Private Member Functions

void computeRadiusFromDistanceSR (const OPoint3D &sourcePoint, const OPoint3D &rcptPoint)
 Compute receiver radius from source and receiver points. More...
 
 FRIEND_TEST (test_ReflectionPathFinderART, computeELPlaneNormal_horizontalPlane1)
 
 FRIEND_TEST (test_ReflectionPathFinderART, computeELPlaneNormal_horizontalPlane2)
 
 FRIEND_TEST (test_ReflectionPathFinderART, computeELPlaneNormal_nonHorizontalPlane)
 

Private Attributes

Simulation _ARTSimulation
 
std::unique_ptr< Solver_pSolver
 
std::set< std::vector< const TYSIntersection * > > _foundSequences
 
std::deque< TYReflectionPath_paths
 
std::unordered_map< const Shape *, const TYSIntersection * > _shapeToTYSIntersection
 
unsigned int _nbRays
 
double _rcptRadius
 
double _extrusionLength
 
OVector3D _ELnormal
 

Detailed Description

Reflection path finder relying on ray-tracing using the AcousticRaytracer module.

Definition at line 83 of file TYReflectionPathFinder.h.

Constructor & Destructor Documentation

◆ TYReflectionPathFinderART() [1/2]

TYReflectionPathFinderART::TYReflectionPathFinderART ( unsigned int  nbRays)

Constructor

Parameters
nbRaysnumber of rays to spawn from the source

Definition at line 19 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:

◆ TYReflectionPathFinderART() [2/2]

TYReflectionPathFinderART::TYReflectionPathFinderART ( )
protecteddefault

Member Function Documentation

◆ addOrientedQuadrangle()

void TYReflectionPathFinderART::addOrientedQuadrangle ( const OPoint3D p1Top,
const OPoint3D p1Bottom,
const OPoint3D p2Top,
const OPoint3D p2Bottom,
const OVector3D  vExt,
const TYSIntersection sourceInter 
)
protected

Add an oriented quadrangle to the AcousticRaytracer' simulation scene. The quadrangle is oriented using a vector pointing towards the exterior of the quadrangle. The address of the intersecting segment from which come the quadrangle is used to map the added quadrangle to the intersecting segment.

p1Top p2Top +---------—+ | | | | +---------—+ p1Bottom p2Bottom

Parameters
p1Top
p1Bottom
p2Top
p2Bottom
vExtvector defining the exterior direction of the quadrangle
sourceInterintersecting segment from which come the quadrangle

Definition at line 274 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addOrientedTriangle()

Shape * TYReflectionPathFinderART::addOrientedTriangle ( const OPoint3D p1,
const OPoint3D p2,
const OPoint3D p3,
const OVector3D vExt 
)
protected

Add an oriented triangle to the AcousticRaytracer' simulation scene. The vertices (v1 = p1, v2 = p2 or p3, v3 = p2 or p3) are set such that the normal of the triangle (v2-v1) x (v3-v1) is oriented the same than vExt.

Parameters
p1first point
p2second point
p3third point
vExtvector defining the exterior direction of the triangle
Returns
address of the added triangle

Definition at line 285 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildQuadranglePointsFromInter()

void TYReflectionPathFinderART::buildQuadranglePointsFromInter ( const TYSIntersection inter,
OPoint3D p1Top,
OPoint3D p1Bottom,
OPoint3D p2Top,
OPoint3D p2Bottom 
) const
protected

Compute points forming a quadrangle from an intersecting segment in EL-plane. Points are obtained by adding or substracting _extrusionLength along the normal direction of EL-plane to points forming the segment.

Parameters
inter[in] intersecting segment from which creating the quadrangle
p1Top[out] point created above the first segment point
p1Bottom[out] point created below the first segment point
p2Top[out] point created above the second segment point
p2Bottom[out] point created below the second segment point

Definition at line 259 of file TYReflectionPathFinder.cpp.

Here is the caller graph for this function:

◆ buildReflectionPaths()

void TYReflectionPathFinderART::buildReflectionPaths ( const OPoint3D source,
const OPoint3D receptor 
)
protected

Build reflection paths from valid rays found by the solver. For each sequence of reflecting barriers, only one path is built.

Parameters
sourcesource point
receptorreceptor point

Definition at line 158 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeELPlaneNormal()

OVector3D TYReflectionPathFinderART::computeELPlaneNormal ( const OPoint3D source,
const OPoint3D receptor 
)
protected

Compute a normal vector of the EL-plane Hypothesis: source and receptor are not aligned along a vertical line.

Parameters
sourcesource point
receptorreceptor point
Returns
normal of EL-plane, normalized

Definition at line 313 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeRadiusFromDistanceSR()

void TYReflectionPathFinderART::computeRadiusFromDistanceSR ( const OPoint3D sourcePoint,
const OPoint3D rcptPoint 
)
private

Compute receiver radius from source and receiver points.

Parameters
sourcePointSource point
rcptPointReceptor point

Definition at line 62 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeRaytracing()

void TYReflectionPathFinderART::computeRaytracing ( )
protected

Perform raytracing simulation.

Definition at line 153 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FRIEND_TEST() [1/3]

TYReflectionPathFinderART::FRIEND_TEST ( test_ReflectionPathFinderART  ,
computeELPlaneNormal_horizontalPlane1   
)
private

◆ FRIEND_TEST() [2/3]

TYReflectionPathFinderART::FRIEND_TEST ( test_ReflectionPathFinderART  ,
computeELPlaneNormal_horizontalPlane2   
)
private

◆ FRIEND_TEST() [3/3]

TYReflectionPathFinderART::FRIEND_TEST ( test_ReflectionPathFinderART  ,
computeELPlaneNormal_nonHorizontalPlane   
)
private

◆ instanciate()

std::unique_ptr< TYAbstractReflectionPathFinder > TYReflectionPathFinderART::instanciate ( ) const
overridevirtual

Instanciate a new TYReflectionPathFinderART. The configuration of the former path finder (number of rays, ...) is transfered to the new instance.

Implements TYAbstractReflectionPathFinder.

Definition at line 36 of file TYReflectionPathFinder.cpp.

◆ isLastSegmentIntersectingSceneElement()

bool TYReflectionPathFinderART::isLastSegmentIntersectingSceneElement ( const TYReflectionPath path)
protected

Check if the last segment of a path intersects a scene element.

Parameters
paththe path to check
Returns
true if the last segment of the path intersects a scene element

Definition at line 341 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPathAlreadyFound()

bool TYReflectionPathFinderART::isPathAlreadyFound ( const TYReflectionPath path) const
protected

Check if a path has already been found.

Parameters
paththe path to check
Returns
true if the sequence of intersecting barriers of the path is the same than another path in _paths

Definition at line 336 of file TYReflectionPathFinder.cpp.

Here is the caller graph for this function:

◆ isPathValid()

bool TYReflectionPathFinderART::isPathValid ( const TYReflectionPath path)
protected

Check if a path is valid. In plus of validation performed during raytracing, it has to be verified:

  • If the sequence of reflecting segments is new
  • If the last step (last reflection point to receptor) does not intersect any scene element
Parameters
paththe path to check
Returns
true if the path is valid

Definition at line 323 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ popPath()

TYReflectionPath TYReflectionPathFinderART::popPath ( )
overridevirtual

Give the last computed reflection path, and remove it from the set of remaining paths.

Returns
a reflection path

Implements TYAbstractReflectionPathFinder.

Definition at line 68 of file TYReflectionPathFinder.cpp.

◆ processInfraIntersectingSegment()

bool TYReflectionPathFinderART::processInfraIntersectingSegment ( const TYSIntersection inter)
protected

Process an infrastructure intersecting segment in EL-plane to add equivalent faces in the AcousticRaytracer' simulation scene.

The triangles forming the face are oriented so that the normal of the triangles point towards the same direction than the normal of the face whose cut produced the intersecting segment. This way, it is guaranteed that any intersection between a ray spawned outdoor and one of the triangles forming the face are found.

          +    ^
         /|   /  normal of the face from which the intersecting segment comes
  • + | / —> ||-> normal of the triangles added

| + |/

  • Parameters
    interintersecting segment used to form the face
    Returns
    true if the quadrangle has been successfully added to the AcousticRaytracer' simulation scene

Definition at line 219 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processIntersectingSegment()

bool TYReflectionPathFinderART::processIntersectingSegment ( const TYSIntersection inter)
protected

Process an intersecting segment in EL-plane to add equivalent faces in the AcousticRaytracer' simulation scene. Intersecting segments which do not belong to EL-plane are ignored.

Parameters
interintersecting segment to process
Returns
true if the intersecting segment has been correctly processed

Definition at line 198 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processTopoIntersectingSegment()

bool TYReflectionPathFinderART::processTopoIntersectingSegment ( const TYSIntersection inter)
protected

Process a topography intersecting segment in EL-plane to add equivalent faces in the AcousticRaytracer' simulation scene.

The normal of the topography element whose cut produced the intersecting segment is not known by the intersecting segment. In order to guaranty that any intersection between a ray spawned outdoor and one of the triangles forming the face will be found:

  • a normal of the intersecting segment in EL-plane is built (whatever its direction) to define an exterior direction
  • two faces distanced of an infinitesimal distance are built one faced to the other
  • these faces are oriented so that they cannot "see the other" in their normal direction
                                             epsilon
                                              <--->
                                              +   +
                                             /|  /|     ---> one possible normal in EL-plane
    
    • + | + | / —> normal of the triangles added <-|| ||-> normal of the triangles added
  • | + | + |/ |/
    • +
Parameters
interintersecting segment used to form the face
Returns
true if the quadrangles have been successfully added to the AcousticRaytracer' simulation scene

Definition at line 235 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remainingPaths()

bool TYReflectionPathFinderART::remainingPaths ( ) const
overridevirtual

Tell if some paths remain in the set of remaining paths.

Returns
true if at least one path can be obtained from popPath

Implements TYAbstractReflectionPathFinder.

Definition at line 57 of file TYReflectionPathFinder.cpp.

◆ setup()

bool TYReflectionPathFinderART::setup ( size_t  maxOrder,
const std::deque< TYSIntersection > &  tabIntersect,
const OPoint3D source,
const OPoint3D receptor 
)
overridevirtual

Set the scene to be treated by the path finder.

Parameters
maxOrdermaximum order of the reflection paths to find
tabIntersectset of intersecting segments of the scene
sourcesource point from which reflection paths must start
receptorreceptor point to which reflection paths must end
Returns
true if setup succeeded

Implements TYAbstractReflectionPathFinder.

Definition at line 41 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:

◆ setupAcceleratingDataStructure()

void TYReflectionPathFinderART::setupAcceleratingDataStructure ( )
protected

Setup accelerating data-structure using ART' Simulation configuration.

Definition at line 127 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupConfiguration()

void TYReflectionPathFinderART::setupConfiguration ( size_t  maxOrder)
protected

Setup ART' Simulation configuration.

Definition at line 82 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupScene()

bool TYReflectionPathFinderART::setupScene ( const std::deque< TYSIntersection > &  tabIntersect,
const OPoint3D sourcePoint,
const OPoint3D receptorPoint 
)
protected

Build an AcousticRaytracer scene containing one source, one receptor, and a collection of faces. The faces are built from intersecting segments in EL-plane. Each segment is extruded along normal direction of EL-plane towards up and down directions of a certain length, to avoid singularities (ray-border of faces intersections) during ray tracing.

Rays are sampled uniformly in EL-plane, the number of rays being controlled by _nbRays. The receptor is modelled as a sphere, controlled by _rcptRadius.

Parameters
tabIntersectset of intersecting segments of the scene
sourcePointlocation of the source
receptorPointlocation of the receptor
Returns
true if the faces have successfully been built

Definition at line 88 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupSolver()

void TYReflectionPathFinderART::setupSolver ( )
protected

Setup ART' simulation solver.

Definition at line 142 of file TYReflectionPathFinder.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _ARTSimulation

Simulation TYReflectionPathFinderART::_ARTSimulation
private

Definition at line 313 of file TYReflectionPathFinder.h.

◆ _ELnormal

OVector3D TYReflectionPathFinderART::_ELnormal
private

Definition at line 321 of file TYReflectionPathFinder.h.

◆ _extrusionLength

double TYReflectionPathFinderART::_extrusionLength
private

Definition at line 320 of file TYReflectionPathFinder.h.

◆ _foundSequences

std::set<std::vector<const TYSIntersection*> > TYReflectionPathFinderART::_foundSequences
private

Definition at line 315 of file TYReflectionPathFinder.h.

◆ _nbRays

unsigned int TYReflectionPathFinderART::_nbRays
private

Definition at line 318 of file TYReflectionPathFinder.h.

◆ _paths

std::deque<TYReflectionPath> TYReflectionPathFinderART::_paths
private

Definition at line 316 of file TYReflectionPathFinder.h.

◆ _pSolver

std::unique_ptr<Solver> TYReflectionPathFinderART::_pSolver
private

Definition at line 314 of file TYReflectionPathFinder.h.

◆ _rcptRadius

double TYReflectionPathFinderART::_rcptRadius
private

Definition at line 319 of file TYReflectionPathFinder.h.

◆ _shapeToTYSIntersection

std::unordered_map<const Shape*, const TYSIntersection*> TYReflectionPathFinderART::_shapeToTYSIntersection
private

Definition at line 317 of file TYReflectionPathFinder.h.


The documentation for this class was generated from the following files: