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

Class describing an event (reflection, diffraction, ...) More...

#include <Event.h>

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

Public Member Functions

 Event (const vec3 &position=vec3(0.0, 0.0, 0.0), const vec3 &incomingDirection=vec3(0.0, 0.0, 0.0), Shape *_shape=NULL)
 Default constructor. More...
 
 Event (const Event &other)
 Copy constructor. More...
 
virtual ~Event ()
 Destructor. More...
 
const vec3 & getPosition () const
 Return a reference to the event location point. More...
 
void setPosition (const vec3 &_pos)
 Set a new point to the event. More...
 
vec3 getIncomingDirection ()
 Return the direction of the incoming vector. More...
 
void setIncomingDirection (const vec3 &_from)
 Set a new incoming vector. More...
 
bool isReponseLeft ()
 Return true if it remains rays to launch. More...
 
int getNbResponseLeft ()
 Return the number of remaining rays to launch. More...
 
virtual void setNbResponseLeft (int _nbResponseLeft)
 Set the number of remaining rays to launch. More...
 
virtual int getInitialNbResponseLeft () const
 Return the number of rays to launch after event. More...
 
ShapegetShape ()
 Return the primitive of the impact. More...
 
const ShapegetShape () const
 
void setShape (Shape *_shape)
 Set the impacted primitive of the event. More...
 
virtual bool getResponse (vec3 &r, bool force=false)
 Return a direction vector for the impact. Ray direction vector in response of the event. More...
 
virtual bool isAcceptableResponse (vec3 &test)
 Return true if the ray direction vector in response of the event is acceptable. More...
 
virtual bool generateTest (std::vector< vec3 > &succededTest, std::vector< vec3 > &failTest, unsigned int nbResponses)
 
virtual bool generateResponse (std::vector< vec3 > &responses, unsigned int nbResponses)
 
virtual bool appendTarget (vec3 target, bool force=false)
 
virtual int getType () const
 Return the event type. More...
 
virtual void setType (const typeevent &_type)
 Added by DTh to make possible simple test of rays. More...
 
virtual double getAngle () const
 Get incident angle. More...
 
const decimal distance (const Event &other) const
 Return distance from another event. More...
 
- 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 pos
 Location point of the event. More...
 
vec3 from
 Direction vector of the incoming ray. More...
 
int nbResponseLeft
 Number of remaining rays to launch. More...
 
int initialNbResponse
 Number of rays to launch after event. More...
 
Samplersampler
 Pointer to a Sampler. More...
 
Shapeshape
 The impact primitive. More...
 
typeevent type
 Event type. More...
 
- Protected Attributes inherited from Base
std::string name
 Each instantiated object may be named. More...
 

Detailed Description

Class describing an event (reflection, diffraction, ...)

Definition at line 37 of file Event.h.

Constructor & Destructor Documentation

◆ Event() [1/2]

Event::Event ( const vec3 &  position = vec3(0.0, 0.0, 0.0),
const vec3 &  incomingDirection = vec3(0.0, 0.0, 0.0),
Shape _shape = NULL 
)
inline

Default constructor.

Definition at line 41 of file Event.h.

◆ Event() [2/2]

Event::Event ( const Event other)
inline

Copy constructor.

Definition at line 54 of file Event.h.

◆ ~Event()

virtual Event::~Event ( )
inlinevirtual

Destructor.

Definition at line 66 of file Event.h.

Member Function Documentation

◆ appendTarget()

virtual bool Event::appendTarget ( vec3  target,
bool  force = false 
)
inlinevirtual

Definition at line 145 of file Event.h.

Here is the caller graph for this function:

◆ distance()

const decimal Event::distance ( const Event other) const
inline

Return distance from another event.

Parameters
other: event from which distance must be measured

Definition at line 169 of file Event.h.

Here is the call graph for this function:

◆ generateResponse()

virtual bool Event::generateResponse ( std::vector< vec3 > &  responses,
unsigned int  nbResponses 
)
inlinevirtual

Definition at line 143 of file Event.h.

Here is the caller graph for this function:

◆ generateTest()

virtual bool Event::generateTest ( std::vector< vec3 > &  succededTest,
std::vector< vec3 > &  failTest,
unsigned int  nbResponses 
)
inlinevirtual

Reimplemented in Diffraction.

Definition at line 141 of file Event.h.

◆ getAngle()

virtual double Event::getAngle ( ) const
inlinevirtual

Get incident angle.

Definition at line 162 of file Event.h.

Here is the caller graph for this function:

◆ getIncomingDirection()

vec3 * Event::getIncomingDirection ( )
inline

Return the direction of the incoming vector.

Returns
The direction of the incoming vector

Definition at line 93 of file Event.h.

◆ getInitialNbResponseLeft()

virtual int Event::getInitialNbResponseLeft ( ) const
inlinevirtual

Return the number of rays to launch after event.

Definition at line 109 of file Event.h.

Here is the caller graph for this function:

◆ getNbResponseLeft()

int Event::getNbResponseLeft ( )
inline

Return the number of remaining rays to launch.

Definition at line 105 of file Event.h.

◆ getPosition()

const vec3 & Event::getPosition ( ) const
inline

Return a reference to the event location point.

Returns
Vector with coordinates of the point.

Definition at line 79 of file Event.h.

Here is the caller graph for this function:

◆ getResponse()

virtual bool Event::getResponse ( vec3 &  r,
bool  force = false 
)
inlinevirtual

Return a direction vector for the impact. Ray direction vector in response of the event.

Returns
New direction vector
Warning
Should be overloaded by the inherited classes of Event

Reimplemented in Diffraction, DoNothing, and SpecularReflexion.

Definition at line 131 of file Event.h.

◆ getShape() [1/2]

Shape * Event::getShape ( )
inline

Return the primitive of the impact.

Returns
The impacted primitive of the event

Definition at line 116 of file Event.h.

Here is the caller graph for this function:

◆ getShape() [2/2]

const Shape* Event::getShape ( ) const
inline

Definition at line 118 of file Event.h.

◆ getType()

int Event::getType ( ) const
inlinevirtual

Return the event type.

Returns
Event type
Warning
Should be overloaded by the inherited classes of Event

Definition at line 153 of file Event.h.

Here is the caller graph for this function:

◆ isAcceptableResponse()

bool Event::isAcceptableResponse ( vec3 &  test)
inlinevirtual

Return true if the ray direction vector in response of the event is acceptable.

Returns
True if the response is acceptable
Warning
Should be overloaded by the inherited classes of Event

Reimplemented in DoNothing, and SpecularReflexion.

Definition at line 139 of file Event.h.

Here is the caller graph for this function:

◆ isReponseLeft()

bool Event::isReponseLeft ( )
inline

Return true if it remains rays to launch.

Definition at line 103 of file Event.h.

◆ setIncomingDirection()

void Event::setIncomingDirection ( const vec3 &  _from)
inline

Set a new incoming vector.

Parameters
_from: New incoming vector

Definition at line 100 of file Event.h.

◆ setNbResponseLeft()

virtual void Event::setNbResponseLeft ( int  _nbResponseLeft)
inlinevirtual

Set the number of remaining rays to launch.

Reimplemented in Diffraction.

Definition at line 107 of file Event.h.

◆ setPosition()

void Event::setPosition ( const vec3 &  _pos)
inline

Set a new point to the event.

Parameters
_pos: New point.

Definition at line 86 of file Event.h.

◆ setShape()

void Event::setShape ( Shape _shape)
inline

Set the impacted primitive of the event.

Definition at line 124 of file Event.h.

◆ setType()

void Event::setType ( const typeevent _type)
inlinevirtual

Added by DTh to make possible simple test of rays.

Definition at line 159 of file Event.h.

Member Data Documentation

◆ from

vec3 Event::from
protected

Direction vector of the incoming ray.

Definition at line 174 of file Event.h.

◆ initialNbResponse

int Event::initialNbResponse
protected

Number of rays to launch after event.

Definition at line 176 of file Event.h.

◆ nbResponseLeft

int Event::nbResponseLeft
protected

Number of remaining rays to launch.

Definition at line 175 of file Event.h.

◆ pos

vec3 Event::pos
protected

Location point of the event.

Definition at line 173 of file Event.h.

◆ sampler

Sampler* Event::sampler
protected

Pointer to a Sampler.

Definition at line 177 of file Event.h.

◆ shape

Shape* Event::shape
protected

The impact primitive.

Definition at line 178 of file Event.h.

◆ type

typeevent Event::type
protected

Event type.

Definition at line 179 of file Event.h.


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