Code_TYMPAN  4.2.0
Industrial site acoustic simulation
Public Member Functions | Protected Attributes | List of all members
Ray Class Reference

: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-4095) and the receptor number (in the range 0-1048576) as a bit field. The second one describes the sequences of events by their types (user could decide what 1 represent, may be REFLEXION or DIFFRACTION) More...

#include <Ray.h>

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

Public Member Functions

 Ray ()
 Constructors. More...
 
 Ray (const vec3 &_position, const vec3 &_direction)
 
 Ray (const Ray &other)
 Copy constructors. More...
 
 Ray (Ray *other)
 
virtual ~Ray ()
 Destructor. More...
 
decimal computeEventsSequenceLength ()
 Compute the length of the sequence of events. More...
 
void computeLongueur ()
 Compute the distance traveled (length) by the ray and the result is set into the longueur attribute. More...
 
decimal computeTrueLength (const vec3 &ref, const vec3 &lastPos, vec3 &closestPoint)
 Compute ray length from source to closestPoint closestPoint is the projection of ref on the line passing by lastPos and the position of the last event (or source if the ray has no events) More...
 
decimal computePertinentLength (const vec3 &ref, const vec3 &lastPos, vec3 &closestPoint)
 Compute ray length from last pertinent event (i.e. source or last diffraction) to the nearest point of the "event" located at ref position. More...
 
BasegetLastPertinentEventOrSource (typeevent evType=DIFFRACTION)
 Return a pointer to the last event of type evType or source if none. More...
 
vec3 computeLocalOrigin (Base *ev)
 Return position of ev which might be a source or an event. More...
 
double getLongueur () const
 Return the traveled distance by the ray. More...
 
unsigned int getDiff () const
 Return the diffractions number encountered by the ray. More...
 
unsigned int getReflex () const
 Return the reflections number encountered by the ray. More...
 
unsigned int getNbEvents () const
 Return the total number of events. More...
 
std::vector< boost::shared_ptr< Event > > * getEvents ()
 Return the events array encountered by the ray. More...
 
const std::vector< boost::shared_ptr< Event > > * getEvents () const
 Return the events array encountered by the ray. More...
 
vector< unsigned int > getFaceHistory ()
 Return the array of faces id encountered by the ray. More...
 
vector< unsigned int > getPrimitiveHistory ()
 Return the array of primitives id encountered by the ray. More...
 
SourcegetSource ()
 Return the ray source. More...
 
void * getRecepteur ()
 Return the ray receptor. More...
 
signature getSignature (const typeevent &typeEv=SPECULARREFLEXION)
 Compute the signature (i.e. std::pair<unsigned int, unsigned int>) of the ray) More...
 
decimal getThickness (const decimal &distance, bool diffraction)
 Compute the thickness of the ray after having traveled a certain distance depending on the type of source which generated the ray (spherical or diffraction source) More...
 
decimal getSolidAngle (bool &diffraction)
 Compute the solid angle associated with the ray (depends on the type of source which generated the ray and the number of rays it generated) More...
 
bitSet getSRBitSet (const unsigned int &source_id, const unsigned int &receptor_id)
 Compute the bitSet associated with a source and a receptor. More...
 
bitSet getEventsBitSet (const typeevent &typeEv)
 Compute the bitSet associated with a list of events of type evType. More...
 
decimal getCumulDelta () const
 Return the cumulative difference between the rays length and its length when ignoring diffractions and taking the direct path between reflections instead. More...
 
decimal getCumulDistance () const
 Return the cumulative length since the last reflection event. More...
 
unsigned long long int getConstructId () const
 Return Ray id. More...
 
decimal getMint () const
 Return mint. More...
 
decimal getMaxt () const
 Return maxt. More...
 
vec3 getFinalPosition () const
 Return ending point of the ray (this ending point is set when a the ray hits a receptor in engine.searchForReceptor) More...
 
vec3 getDirection () const
 Return direction of the ray. More...
 
vec3 getPosition () const
 Return starting point ray. More...
 
void setPosition (vec3 _position)
 set the starting point ray More...
 
void setDirection (vec3 _direction)
 set the direction if the ray More...
 
void setFinalPosition (vec3 _finalPosition)
 set the ending point of the ray More...
 
void setMint (decimal _mint)
 set the Mint More...
 
void setMaxt (decimal _maxt)
 set the maxt More...
 
void setSource (Source *_source)
 set the pointer to the source of the ray More...
 
void setRecepteur (void *_recepteur)
 set the pointer to the receptor of the ray More...
 
void setLongueur (decimal _longueur)
 set the distance traveled by the ray More...
 
void setConstructId (unsigned long long int _constructId)
 set the ray id More...
 
void setNbReflexion (unsigned int _nbReflexion)
 set the reflections number for the ray More...
 
void setNbDiffraction (unsigned int _nbDiffraction)
 set the diffractions number for the ray More...
 
void setCumulDistance (decimal _cumulDistance)
 set the cumulative distance by the ray computed at each step More...
 
void setCumulDelta (decimal _cumulDelta)
 set the cumulative walking step difference by the ray computed at each step More...
 
void addEvent (boost::shared_ptr< Event > _event)
 
vector< unsigned int > getEventSignature ()
 
- Public Member Functions inherited from Base
 Base ()
 Default constructor. More...
 
 Base (const Base &other)
 Copy constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
std::string getName ()
 Get the name of the object. More...
 
void setName (const std::string &_name)
 Set the name of the object. More...
 

Protected Attributes

vec3 position
 Starting point ray. More...
 
vec3 direction
 Direction vector for the ray at the source. More...
 
vec3 finalPosition
 Ending point of the ray. More...
 
decimal mint
 
decimal maxt
 
Sourcesource
 Pointer to the source of the ray. More...
 
void * recepteur
 Pointer to the receptor of the ray. More...
 
decimal longueur
 Distance traveled by the ray. More...
 
unsigned long long int constructId
 Ray id. More...
 
unsigned int nbReflexion
 Reflections number for the ray. More...
 
unsigned int nbDiffraction
 Diffractions number for the ray. More...
 
decimal cumulDistance
 Cumulative length since last valid reflexion. More...
 
decimal cumulDelta
 Cumulative difference by the ray computed at each step. More...
 
std::vector< boost::shared_ptr< Event > > events
 Events list for the ray. More...
 
- Protected Attributes inherited from Base
std::string name
 Each instantiated object may be named. More...
 

Detailed Description

: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-4095) and the receptor number (in the range 0-1048576) as a bit field. The second one describes the sequences of events by their types (user could decide what 1 represent, may be REFLEXION or DIFFRACTION)

Definition at line 38 of file Ray.h.

Constructor & Destructor Documentation

◆ Ray() [1/4]

Ray::Ray ( )
inline

Constructors.

Definition at line 43 of file Ray.h.

◆ Ray() [2/4]

Ray::Ray ( const vec3 &  _position,
const vec3 &  _direction 
)
inline

Definition at line 48 of file Ray.h.

◆ Ray() [3/4]

Ray::Ray ( const Ray other)
inline

Copy constructors.

Definition at line 53 of file Ray.h.

◆ Ray() [4/4]

Ray::Ray ( Ray other)
inline

Definition at line 73 of file Ray.h.

◆ ~Ray()

virtual Ray::~Ray ( )
inlinevirtual

Destructor.

Definition at line 94 of file Ray.h.

Member Function Documentation

◆ addEvent()

void Ray::addEvent ( boost::shared_ptr< Event _event)
inline

Definition at line 433 of file Ray.h.

Here is the caller graph for this function:

◆ computeEventsSequenceLength()

decimal Ray::computeEventsSequenceLength ( )

Compute the length of the sequence of events.

Definition at line 74 of file Ray.cpp.

Here is the caller graph for this function:

◆ computeLocalOrigin()

vec3 Ray::computeLocalOrigin ( Base ev)
inline

Return position of ev which might be a source or an event.

Definition at line 134 of file Ray.h.

Here is the caller graph for this function:

◆ computeLongueur()

void Ray::computeLongueur ( )

Compute the distance traveled (length) by the ray and the result is set into the longueur attribute.

Definition at line 24 of file Ray.cpp.

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

◆ computePertinentLength()

decimal Ray::computePertinentLength ( const vec3 &  ref,
const vec3 &  lastPos,
vec3 &  closestPoint 
)

Compute ray length from last pertinent event (i.e. source or last diffraction) to the nearest point of the "event" located at ref position.

Definition at line 143 of file Ray.cpp.

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

◆ computeTrueLength()

decimal Ray::computeTrueLength ( const vec3 &  ref,
const vec3 &  lastPos,
vec3 &  closestPoint 
)

Compute ray length from source to closestPoint closestPoint is the projection of ref on the line passing by lastPos and the position of the last event (or source if the ray has no events)

Parameters
ref
lastPos
closestPoint

Definition at line 98 of file Ray.cpp.

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

◆ getConstructId()

unsigned long long int Ray::getConstructId ( ) const
inline

Return Ray id.

Definition at line 273 of file Ray.h.

◆ getCumulDelta()

decimal Ray::getCumulDelta ( ) const
inline

Return the cumulative difference between the rays length and its length when ignoring diffractions and taking the direct path between reflections instead.

Definition at line 259 of file Ray.h.

Here is the caller graph for this function:

◆ getCumulDistance()

decimal Ray::getCumulDistance ( ) const
inline

Return the cumulative length since the last reflection event.

Definition at line 266 of file Ray.h.

Here is the caller graph for this function:

◆ getDiff()

unsigned int Ray::getDiff ( ) const
inline

Return the diffractions number encountered by the ray.

Returns
Reflections diffractions encountered by the ray.

Definition at line 160 of file Ray.h.

Here is the caller graph for this function:

◆ getDirection()

vect3 Ray::getDirection ( ) const
inline

Return direction of the ray.

Definition at line 301 of file Ray.h.

Here is the caller graph for this function:

◆ getEvents() [1/2]

std::vector< boost::shared_ptr< Event > > * Ray::getEvents ( )
inline

Return the events array encountered by the ray.

Returns
Events array encountered by the ray.

Definition at line 180 of file Ray.h.

Here is the caller graph for this function:

◆ getEvents() [2/2]

const std::vector< boost::shared_ptr< Event > > * Ray::getEvents ( ) const
inline

Return the events array encountered by the ray.

Returns
Events array encountered by the ray.

Definition at line 187 of file Ray.h.

◆ getEventsBitSet()

bitSet Ray::getEventsBitSet ( const typeevent typeEv)

Compute the bitSet associated with a list of events of type evType.

Definition at line 312 of file Ray.cpp.

Here is the caller graph for this function:

◆ getEventSignature()

vector< unsigned int > Ray::getEventSignature ( )

Definition at line 299 of file Ray.cpp.

Here is the call graph for this function:

◆ getFaceHistory()

Ray::getFaceHistory ( )

Return the array of faces id encountered by the ray.

Definition at line 231 of file Ray.cpp.

Here is the call graph for this function:

◆ getFinalPosition()

vec3 Ray::getFinalPosition ( ) const
inline

Return ending point of the ray (this ending point is set when a the ray hits a receptor in engine.searchForReceptor)

Definition at line 294 of file Ray.h.

◆ getLastPertinentEventOrSource()

void * Ray::getLastPertinentEventOrSource ( typeevent  evType = DIFFRACTION)

Return a pointer to the last event of type evType or source if none.

Definition at line 219 of file Ray.cpp.

Here is the caller graph for this function:

◆ getLongueur()

double Ray::getLongueur ( ) const
inline

Return the traveled distance by the ray.

Returns
Traveled distance by the ray.

Definition at line 153 of file Ray.h.

◆ getMaxt()

decimal Ray::getMaxt ( ) const
inline

Return maxt.

Definition at line 287 of file Ray.h.

Here is the caller graph for this function:

◆ getMint()

decimal Ray::getMint ( ) const
inline

Return mint.

Definition at line 280 of file Ray.h.

Here is the caller graph for this function:

◆ getNbEvents()

unsigned int Ray::getNbEvents ( ) const
inline

Return the total number of events.

Definition at line 173 of file Ray.h.

Here is the caller graph for this function:

◆ getPosition()

vect3 Ray::getPosition ( ) const
inline

Return starting point ray.

Definition at line 308 of file Ray.h.

Here is the caller graph for this function:

◆ getPrimitiveHistory()

Ray::getPrimitiveHistory ( )

Return the array of primitives id encountered by the ray.

Definition at line 244 of file Ray.cpp.

Here is the call graph for this function:

◆ getRecepteur()

Recepteur * Ray::getRecepteur ( )
inline

Return the ray receptor.

Returns
Pointer to the ray receptor. NULL if the ray has no associated receptor

Definition at line 213 of file Ray.h.

Here is the caller graph for this function:

◆ getReflex()

unsigned int Ray::getReflex ( ) const
inline

Return the reflections number encountered by the ray.

Returns
Reflections number encountered by the ray.

Definition at line 167 of file Ray.h.

Here is the caller graph for this function:

◆ getSignature()

signature Ray::getSignature ( const typeevent typeEv = SPECULARREFLEXION)

Compute the signature (i.e. std::pair<unsigned int, unsigned int>) of the ray)

Definition at line 291 of file Ray.cpp.

Here is the call graph for this function:

◆ getSolidAngle()

decimal Ray::getSolidAngle ( bool &  diffraction)

Compute the solid angle associated with the ray (depends on the type of source which generated the ray and the number of rays it generated)

Parameters
diffractionSet diffraction true if last pertinent event is a diffraction

Definition at line 269 of file Ray.cpp.

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

◆ getSource()

Source * Ray::getSource ( )
inline

Return the ray source.

Returns
Pointer to the source

Definition at line 206 of file Ray.h.

Here is the caller graph for this function:

◆ getSRBitSet()

bitSet Ray::getSRBitSet ( const unsigned int &  source_id,
const unsigned int &  receptor_id 
)
inline

Compute the bitSet associated with a source and a receptor.

Definition at line 239 of file Ray.h.

Here is the caller graph for this function:

◆ getThickness()

decimal Ray::getThickness ( const decimal &  distance,
bool  diffraction 
)

Compute the thickness of the ray after having traveled a certain distance depending on the type of source which generated the ray (spherical or diffraction source)

Definition at line 257 of file Ray.cpp.

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

◆ setConstructId()

void Ray::setConstructId ( unsigned long long int  _constructId)
inline

set the ray id

Definition at line 387 of file Ray.h.

Here is the caller graph for this function:

◆ setCumulDelta()

void Ray::setCumulDelta ( decimal  _cumulDelta)
inline

set the cumulative walking step difference by the ray computed at each step

Definition at line 424 of file Ray.h.

Here is the caller graph for this function:

◆ setCumulDistance()

void Ray::setCumulDistance ( decimal  _cumulDistance)
inline

set the cumulative distance by the ray computed at each step

Definition at line 415 of file Ray.h.

Here is the caller graph for this function:

◆ setDirection()

void Ray::setDirection ( vec3  _direction)
inline

set the direction if the ray

Definition at line 324 of file Ray.h.

Here is the caller graph for this function:

◆ setFinalPosition()

void Ray::setFinalPosition ( vec3  _finalPosition)
inline

set the ending point of the ray

Definition at line 333 of file Ray.h.

Here is the caller graph for this function:

◆ setLongueur()

void Ray::setLongueur ( decimal  _longueur)
inline

set the distance traveled by the ray

Definition at line 378 of file Ray.h.

◆ setMaxt()

void Ray::setMaxt ( decimal  _maxt)
inline

set the maxt

Definition at line 351 of file Ray.h.

Here is the caller graph for this function:

◆ setMint()

void Ray::setMint ( decimal  _mint)
inline

set the Mint

Definition at line 342 of file Ray.h.

Here is the caller graph for this function:

◆ setNbDiffraction()

void Ray::setNbDiffraction ( unsigned int  _nbDiffraction)
inline

set the diffractions number for the ray

Definition at line 406 of file Ray.h.

Here is the caller graph for this function:

◆ setNbReflexion()

void Ray::setNbReflexion ( unsigned int  _nbReflexion)
inline

set the reflections number for the ray

Definition at line 397 of file Ray.h.

Here is the caller graph for this function:

◆ setPosition()

void Ray::setPosition ( vec3  _position)
inline

set the starting point ray

Definition at line 315 of file Ray.h.

Here is the caller graph for this function:

◆ setRecepteur()

void Ray::setRecepteur ( void *  _recepteur)
inline

set the pointer to the receptor of the ray

Definition at line 369 of file Ray.h.

Here is the caller graph for this function:

◆ setSource()

void Ray::setSource ( Source _source)
inline

set the pointer to the source of the ray

Definition at line 360 of file Ray.h.

Here is the caller graph for this function:

Member Data Documentation

◆ constructId

unsigned long long int Ray::constructId
protected

Ray id.

Definition at line 448 of file Ray.h.

◆ cumulDelta

decimal Ray::cumulDelta
protected

Cumulative difference by the ray computed at each step.

Definition at line 452 of file Ray.h.

◆ cumulDistance

decimal Ray::cumulDistance
protected

Cumulative length since last valid reflexion.

Definition at line 451 of file Ray.h.

◆ direction

vec3 Ray::direction
protected

Direction vector for the ray at the source.

Definition at line 441 of file Ray.h.

◆ events

std::vector<boost::shared_ptr<Event> > Ray::events
protected

Events list for the ray.

Definition at line 453 of file Ray.h.

◆ finalPosition

vec3 Ray::finalPosition
protected

Ending point of the ray.

Definition at line 442 of file Ray.h.

◆ longueur

decimal Ray::longueur
protected

Distance traveled by the ray.

Definition at line 447 of file Ray.h.

◆ maxt

decimal Ray::maxt
protected

Definition at line 444 of file Ray.h.

◆ mint

decimal Ray::mint
protected

Definition at line 443 of file Ray.h.

◆ nbDiffraction

unsigned int Ray::nbDiffraction
protected

Diffractions number for the ray.

Definition at line 450 of file Ray.h.

◆ nbReflexion

unsigned int Ray::nbReflexion
protected

Reflections number for the ray.

Definition at line 449 of file Ray.h.

◆ position

vec3 Ray::position
protected

Starting point ray.

Definition at line 440 of file Ray.h.

◆ recepteur

void* Ray::recepteur
protected

Pointer to the receptor of the ray.

Definition at line 446 of file Ray.h.

◆ source

Source* Ray::source
protected

Pointer to the source of the ray.

Definition at line 445 of file Ray.h.


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