20 #include <boost/shared_ptr.hpp>
23 #include "Geometry/mathlib.h"
65 for (
unsigned int i = 0; i < other.
events.size(); i++)
85 for (
unsigned int i = 0; i < other->
events.size(); i++)
139 if (
dynamic_cast<Source*
>(ev))
205 const std::vector<boost::shared_ptr<Event>>*
getEvents()
const
269 assert((source_id < 4096) && (receptor_id < 1048576));
272 return SR += receptor_id;
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.
std::string name
Each instantiated object may be named.
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.
decimal computeTrueLength(const vec3 &ref, const vec3 &lastPos, vec3 &closestPoint)
Compute ray length from source to closestPoint.
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.
decimal getSolidAngle(bool &diffraction)
Compute the solid angle associated with the ray (depends on the type of source which generated the ra...
Source * source
Pointer to the source of the ray.
Source * getSource()
Return the ray source.
decimal getMaxt() const
Return maxt.
std::vector< unsigned int > getPrimitiveHistory()
Return the array of primitives id encountered by the ray.
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
decimal getThickness(const decimal &distance, bool diffraction)
Compute the thickness of the ray after having traveled a certain distance depending on the type of so...
vec3 getPosition() const
Return starting point ray.
Base * getLastPertinentEventOrSource(typeevent evType=DIFFRACTION)
Return a pointer to the last event of type evType or source if none.
Ray(const vec3 &_position, const vec3 &_direction)
std::vector< unsigned int > getEventSignature()
vec3 getDirection() const
Return direction of the ray.
unsigned long long int getConstructId() const
Return Ray id.
signature getSignature(const typeevent &typeEv=SPECULARREFLEXION)
Compute the signature (i.e. std::pair<unsigned int, unsigned int>) of the ray)
Ray(const Ray &other)
Copy constructors.
std::vector< unsigned int > getFaceHistory()
Return the array of faces id encountered by the ray.
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
bitSet getEventsBitSet(const typeevent &typeEv)
Compute the bitSet associated with a list of events of type evType.
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 o...
decimal longueur
Distance traveled by the ray.
unsigned long long int constructId
Ray id.
decimal computeEventsSequenceLength()
Compute the length of the sequence of events.
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.
void computeLongueur()
Compute the distance traveled (length) by the ray and the result is set into the longueur attribute.
std::vector< boost::shared_ptr< Event > > * getEvents()
Return the events array encountered by the ray.
base_vec3< decimal > vec3