22 : distNextEvent(0.0), distEndEvent(0.0), distPrevNext(0.0), angle(0.0), angletheta(0.0), type(
TY_NO_TYPE),
23 idFace1(-9999), idFace2(-9999), previous(NULL), next(NULL), endEvent(NULL)
28 : pos(pt), distNextEvent(0.0), distEndEvent(0.0), distPrevNext(0.0), angle(0.0), angletheta(0.0),
29 type(
TY_NO_TYPE), idFace1(-9999), idFace2(-9999), previous(NULL), next(NULL), endEvent(NULL)
84 for (
unsigned int i = 0; i <
_events.size(); i++)
104 for (
unsigned int i = 0; i < other.
_events.size(); i++)
124 for (
size_t i = 0; i < other->
getEvents().size(); i++)
147 for (
unsigned int i = 0; i <
_events.size(); i++)
149 length +=
_events.at(i)->distNextEvent;
157 std::vector<int> eventsIndexList;
158 for (
size_t i = 0; i <
_events.size(); i++)
160 if (
_events[i]->type & eventType)
162 eventsIndexList.push_back(
static_cast<int>(i));
166 return eventsIndexList;
179 for (
unsigned int i = 0; i < tabIndexEvents.size(); i++)
181 addEvent(tabEvents.at(tabIndexEvents.at(i)));
191 for (
size_t i = 0; i < idxList.size() - 1; i++)
199 }
while (j != idxList[i + 1]);
201 _events.at(idxList.at(i))->distNextEvent = length;
207 for (
unsigned int i = 1; i <
_events.size() - 1; i++)
209 if (
_events.at(i)->type & eventType)
224 for (
unsigned int j = 0; j <
_events.size() - 1; j++)
237 if (j == tabIndex[k])
260 double result = v0 * v1;
261 int sign = v0.
z > 0 ? 1 : -1;
262 double angle = ::acos(result) * sign;
268 sign = v0.
y > 0 ? 1 : -1;
269 angle = ::acos(result) * sign;
270 angle = v0.
x < 0 ?
M_PI - angle : angle;
272 _events[0]->angletheta = angle;
std::vector< acoustic_event * > tab_acoustic_events
double angle(const OVector3D &vector) const
Computes the angle between this vector and another vector.
This class store data and provide functions to manipulate event in the acoustic context.
double distNextEvent
Distance between this event and the next one in TYRay's list of events.
acoustic_event & operator=(const acoustic_event &other)
ACOUSTIC_EVENT_TYPES type
Event type.
double distPrevNext
Distance between event-1 and event +1.
OPoint3D pos
Event position.
int idFace1
Face id on which the event happens (reflection & diffraction)
double angle
Ray incident angle (for a shooting angle - plan x,z -)
int idFace2
Face id on which the event happens (diffraction only)
acoustic_event * next
Pointer to the next event in TYRay's list of events.
acoustic_event()
Default constructor.
~acoustic_event()
Destructor.
acoustic_event * endEvent
double angletheta
Shooting angle on a horizontal plane (x,y)
acoustic_event * previous
Pointer to the previous event in TYRay's list of events.
OPoint3D _posReceptGlobal
Receptor position in the global frame.
virtual void cleanEventsTab()
clean tab of events
virtual void addEvent(acoustic_event *TYEvent)
Add an event to the events list of the ray.
virtual ~acoustic_path()
Destructor.
virtual double getLength()
Return total length of the ray taking account of all events.
static double sampler_step
max size of step between events after spatial sampling
virtual bool deepCopy(acoustic_path *pOther)
Deep copy of a ray mainly the events tab.
unsigned int source_idx
Source id.
virtual unsigned int getIdentifiant() const
Get the ray id.
virtual void setNextDistance(ACOUSTIC_EVENT_TYPES eventType)
Compute distance between events of the type "eventType" and set distNextEvent to each event matching ...
virtual acoustic_path & operator=(const acoustic_path &other)
equal operator
virtual void setSource(unsigned int source_idx_, OPoint3D &globalPosition)
Set the ray source.
unsigned int _identifiant
Ray id.
OPoint3D _posSourceGlobal
Source position in the global frame.
acoustic_path()
Default constructor.
virtual void setRecepteur(unsigned int receptor_idx_, OPoint3D &globalPosition)
Set the ray receptor. The last polyline point is updated.
virtual std::vector< int > getIndexOfEvents(const int &eventType) const
return a tab of indexes of events of the same type in a ray you can merge two types of events (exampl...
void compute_shot_angle()
Compute shot angle from source.
unsigned int receptor_idx
Receptor id.
virtual void copyEvents(const acoustic_path *tyRay, ACOUSTIC_EVENT_TYPES eventType)
copy only events matching eventType to _events tab
void build_links_between_events()
TYRayEvent has to know is direct neighbourg (before and after him)
tab_acoustic_events _events
Events vector containing the events list (and their positions) of the associated ray.
virtual tab_acoustic_events & getEvents()
Get the events list of the ray.
virtual void setAngles(ACOUSTIC_EVENT_TYPES eventType)
Compute angles of incoming ray segment at event point.
3D vector Vector defined with 3 float numbers
2D Vector Vector defined with 2 float numbers
vec3 OPoint3Dtovec3(const OPoint3D &_p)
Converts a OPoint3D to vec3.