20 #include <boost/shared_ptr.hpp>
23 #include "Geometry/mathlib.h"
43 :
Base(), position(), direction(), mint(0), maxt(100000), source(NULL), recepteur(NULL),
44 nbReflexion(0), nbDiffraction(0), cumulDistance(0.), cumulDelta(0.)
50 :
Base(), position(_position), direction(_direction), mint(0), maxt(100000), source(NULL),
51 recepteur(NULL), nbReflexion(0), nbDiffraction(0), cumulDistance(0.), cumulDelta(0.)
65 for (
unsigned int i = 0; i < other.
events.size(); i++)
67 events.push_back(other.
events.at(i));
85 for (
unsigned int i = 0; i < other->
events.size(); i++)
87 events.push_back(other->
events.at(i));
102 decimal computeEventsSequenceLength();
108 void computeLongueur();
139 if (
dynamic_cast<Source*
>(ev))
142 return dynamic_cast<Source*
>(ev)->getPosition();
147 return dynamic_cast<Event*
>(ev)->getPosition();
168 return nbDiffraction;
187 return nbDiffraction + nbReflexion;
205 const std::vector<boost::shared_ptr<Event>>*
getEvents()
const
214 vector<unsigned int> getFaceHistory();
220 vector<unsigned int> getPrimitiveHistory();
260 decimal getSolidAngle(
bool& diffraction);
269 assert((source_id < 4096) && (receptor_id < 1048576));
272 return SR += receptor_id;
298 return cumulDistance;
338 return finalPosition;
368 position = _position;
378 direction = _direction;
388 finalPosition = _finalPosition;
428 recepteur = _recepteur;
438 longueur = _longueur;
448 constructId = _constructId;
458 nbReflexion = _nbReflexion;
468 nbDiffraction = _nbDiffraction;
478 cumulDistance = _cumulDistance;
488 cumulDelta = _cumulDelta;
498 events.push_back(_event);
501 vector<unsigned int> getEventSignature();
517 std::vector<boost::shared_ptr<Event>>
events;
std::pair< bitSet, bitSet > signature
Base class of Event, Material, PostFilter, Ray, Repere, Scene, Shape, Simulation, Source.
Class describing an event (reflection, diffraction, ...)
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
decimal cumulDistance
Cumulative length since last valid reflexion.
void setDirection(vec3 _direction)
set the direction if the ray
unsigned int getReflex() const
Return the reflections number encountered by the ray.
decimal cumulDelta
Cumulative difference by the ray computed at each step.
void setPosition(vec3 _position)
set the starting point ray
void setNbDiffraction(unsigned int _nbDiffraction)
set the diffractions number for the ray
const std::vector< boost::shared_ptr< Event > > * getEvents() const
Return the events array encountered by the ray.
unsigned int nbReflexion
Reflections number for the ray.
void * getRecepteur()
Return the ray receptor.
vec3 direction
Direction vector for the ray at the source.
std::vector< boost::shared_ptr< Event > > events
Events list for the ray.
void setFinalPosition(vec3 _finalPosition)
set the ending point of the ray
void setRecepteur(void *_recepteur)
set the pointer to the receptor of the ray
bitSet getSRBitSet(const unsigned int &source_id, const unsigned int &receptor_id)
Compute the bitSet associated with a source and a receptor.
Source * source
Pointer to the source of the ray.
Source * getSource()
Return the ray source.
decimal getMaxt() const
Return maxt.
decimal getMint() const
Return mint.
void setCumulDistance(decimal _cumulDistance)
set the cumulative distance by the ray computed at each step
vec3 finalPosition
Ending point of the ray.
void * recepteur
Pointer to the receptor of the ray.
void setNbReflexion(unsigned int _nbReflexion)
set the reflections number for the ray
vec3 getPosition() const
Return starting point ray.
Ray(const vec3 &_position, const vec3 &_direction)
vec3 getDirection() const
Return direction of the ray.
unsigned long long int getConstructId() const
Return Ray id.
Ray(const Ray &other)
Copy constructors.
void setMaxt(decimal _maxt)
set the maxt
decimal getCumulDelta() const
Return the cumulative difference between the rays length and its length when ignoring diffractions an...
void setSource(Source *_source)
set the pointer to the source of the ray
decimal longueur
Distance traveled by the ray.
unsigned long long int constructId
Ray id.
void setCumulDelta(decimal _cumulDelta)
set the cumulative walking step difference by the ray computed at each step
unsigned int getDiff() const
Return the diffractions number encountered by the ray.
void setMint(decimal _mint)
set the Mint
double getLongueur() const
Return the traveled distance by the ray.
vec3 position
Starting point ray.
vec3 computeLocalOrigin(Base *ev)
Return position of ev which might be a source or an event.
void addEvent(boost::shared_ptr< Event > _event)
virtual ~Ray()
Destructor.
vec3 getFinalPosition() const
Return ending point of the ray (this ending point is set when a the ray hits a receptor in engine....
void setConstructId(unsigned long long int _constructId)
set the ray id
unsigned int nbDiffraction
Diffractions number for the ray.
void setLongueur(decimal _longueur)
set the distance traveled by the ray
decimal getCumulDistance() const
Return the cumulative length since the last reflection event.
unsigned int getNbEvents() const
Return the total number of events.
std::vector< boost::shared_ptr< Event > > * getEvents()
Return the events array encountered by the ray.
base_vec3< decimal > vec3