20 unsigned int maxTreeDepth ,
23 _maxTreeDepth(maxTreeDepth), _rayMaxLength(rayMaxLength)
48 if (!
setupScene(tabIntersect, source, receptor))
149 _pSolver = std::make_unique<BasicSolver>();
167 const bool isReflectionPath{pRay->getNbEvents() > 0};
168 if (!isReflectionPath)
178 for (boost::shared_ptr<Event> pEvent : *pRay->getEvents())
213 OPoint3D p1Top, p1Bottom, p2Top, p2Bottom;
235 p1Top = p1 + upExtrusion;
236 p1Bottom = p1 + downExtrusion;
237 p2Top = p2 + upExtrusion;
238 p2Bottom = p2 + downExtrusion;
257 unsigned int i1, i2, i3;
263 if (nCandidate.
scalar(vExt) > 0)
278 return scene.
addTriangle(i1, i2, i3,
nullptr, isSol);
314 const double distLastReflectionReceptor = lastReflection.
distFrom(receptor);
316 const OVector3D rayDirection{lastReflection, receptor};
318 std::list<Intersection> intersections;
319 double distToClosestElement =
322 return distToClosestElement > 0. && distToClosestElement < distLastReflectionReceptor;
std::pair< unsigned int, unsigned int > segment
virtual decimal traverse(Ray *r, std::list< Intersection > &result) const
Run this accelerator.
unsigned int MaxTreeDepth
BvhAccelerator Accelerator option (Maximal tree depth)
bool KeepDebugRay
Flag to store rays into a debug_rays array after being invalidated.
unsigned int MaxReflexion
Maximal reflection events.
double MaxLength
LengthSelector Selector option (maximal length)
unsigned int MaxDiffraction
Maximal diffraction events.
unsigned int MaxProfondeur
Maximal number of events for ray validation in ANIME3D solver.
bool UsePostFilters
Flag to use some specifics Selector.
double distFrom(const OPoint3D &pt) const
Computes the distance from this point to another.
Class to define a segment.
double norme() const
Computes the length of this vector.
double scalar(const OVector3D &vector) const
Performs the scalar product between this object and another vector.
OVector3D cross(const OVector3D &vector) const
Cross product.
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
Receptor inherits from a Sphere Shape.
This class mainly define a mesh (list of Shape) used by the Simulation object.
Shape * addTriangle(unsigned int i1, unsigned int i2, unsigned int i3, Material *m, const bool &isSol=false)
Add a triangle to the scene built with the vertices array.
bool addVertex(const vec3 &newVertex, unsigned int &index)
Add a vertex to the vertices array.
Accelerator * getAccelerator() const
Get the accelerator.
bool finish(int accelerator_id=1, leafTreatment::treatment _intersectionChoice=leafTreatment::FIRST)
Build the selected accelerator on the scene.
base class for shapes (Cylindre, Mesh, Sphere, Triangle,...)
void setSolver(Solver *_solver)
Tool function to set the acoustic solver for the simulation.
AcousticRaytracerConfiguration * getConfiguration()
Get the configuration.
void clean()
Clean the simulation: the scene, sources, and receptors and all the rays are deleted.
void addRecepteur(Recepteur &r)
Tool function to add quickly a receptor for the simulation.
void addSource(const Source &s)
Tool function to add a source to the simulation.
Scene * getScene()
Get a pointer to the scene.
std::vector< Recepteur > & getRecepteurs()
Return a vector of all receptors of the scene.
std::vector< Source > & getSources()
Return the sources list of the scene.
bool launchSimulation()
Program main loop. Extract all the rays from the sources then treat them. The loop finishes when the ...
Scene * get_receptors_landscape()
Return the geometric distribution of receptors.
void setSampler(Sampler *_sampler)
Set the Sampler for this Source.
void setPosition(const vec3 _pos)
Set the position of the Source.
void setInitialRayCount(int nb)
Set the initial rays counter.
void setRadius(decimal _radius)
Set the radius of the sphere.
void setPosition(const vec3 &_position)
Set the center of the sphere.
Interface for multiple reflection paths computation algorithms.
std::unique_ptr< TYAbstractReflectionPathFinder > instanciate() const override
Instanciate a new TYReflectionPathFinderART. The configuration of the former path finder (number of r...
Shape * addOrientedTriangle(const OPoint3D &p1, const OPoint3D &p2, const OPoint3D &p3, const OVector3D &vExt, const bool isSol)
Add an oriented triangle to the AcousticRaytracer' simulation scene. The vertices (v1 = p1,...
void computeRaytracing()
Perform raytracing simulation.
void setupConfiguration(size_t maxOrder)
Setup ART' Simulation configuration.
bool processIntersectingSegment(const TYSIntersection &inter)
Process an intersecting segment in EL-plane to add equivalent faces in the AcousticRaytracer' simulat...
std::unique_ptr< Solver > _pSolver
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.
std::unordered_map< const Shape *, const TYSIntersection * > _shapeToTYSIntersection
void setupAcceleratingDataStructure()
Setup accelerating data-structure using ART' Simulation configuration.
Simulation _ARTSimulation
bool remainingPaths() const override
Tell if some paths remain in the set of remaining paths.
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....
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 ...
std::deque< TYReflectionPath > _paths
bool isPathAlreadyFound(const TYReflectionPath &path) const
Check if a path has already been found.
unsigned int _maxTreeDepth
unsigned int _accelerator
void buildReflectionPaths(const OPoint3D &source, const OPoint3D &receptor)
Build reflection paths from valid rays found by the solver. For each sequence of reflecting barriers,...
TYReflectionPathFinderART()=default
TYReflectionPath popPath() override
Give the last computed reflection path, and remove it from the set of remaining paths.
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 verti...
void computeRadiusFromDistanceSR(const OPoint3D &sourcePoint, const OPoint3D &rcptPoint)
Compute receiver radius from source and receiver points.
void setupSolver()
Setup ART' simulation solver.
std::set< std::vector< const TYSIntersection * > > _foundSequences
bool isPathValid(const TYReflectionPath &path)
Check if a path is valid. In plus of validation performed during raytracing, it has to be verified:
bool isLastSegmentIntersectingSceneElement(const TYReflectionPath &path)
Check if the last segment of a path intersects a scene element.
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 usi...
vec3 OPoint3Dtovec3(const OPoint3D &_p)
Converts a OPoint3D to vec3.
OPoint3D vec3toOPoint3D(const vec3 &_v)
Converts a vec3 to OPoint3D.
vec3 OVector3Dtovec3(const OVector3D &_v)
Converts a OVector3D to vec3.
Data-structure representing a reflection path It stores all needed data to build a TYChemin.
std::deque< OPoint3D > reflectionPoints
std::vector< const TYSIntersection * > reflectingSegments
Data structure for intersections.
bool isInfra
Flag to define if is a infrastructure face.
bool bIntersect[2]
Flag to indicate the face cuts vertical plane ([0]) or horizontal plane ([1])
boost::shared_ptr< tympan::AcousticFaceGeomData > pFaceGeomData