23 : distNextEvent(0.0), distEndEvent(0.0), distPrevNext(0.0), angle(0.0), angletheta(0.0), type(
TY_NO_TYPE),
24 idFace1(-9999), idFace2(-9999), previous(NULL), next(NULL), endEvent(NULL)
29 : pos(pt), distNextEvent(0.0), distEndEvent(0.0), distPrevNext(0.0), angle(0.0), angletheta(0.0),
30 type(
TY_NO_TYPE), idFace1(-9999), idFace2(-9999), previous(NULL), next(NULL), endEvent(NULL)
85 for (
unsigned int i = 0; i <
_events.size(); i++)
105 for (
unsigned int i = 0; i < other.
_events.size(); i++)
125 for (
size_t i = 0; i < other->
getEvents().size(); i++)
148 for (
unsigned int i = 0; i <
_events.size(); i++)
150 length +=
_events.at(i)->distNextEvent;
158 std::vector<int> eventsIndexList;
159 for (
size_t i = 0; i <
_events.size(); i++)
161 if (
_events[i]->type & eventType)
163 eventsIndexList.push_back(
static_cast<int>(i));
167 return eventsIndexList;
180 for (
unsigned int i = 0; i < tabIndexEvents.size(); i++)
182 addEvent(tabEvents.at(tabIndexEvents.at(i)));
192 for (
size_t i = 0; i < idxList.size() - 1; i++)
200 }
while (j != idxList[i + 1]);
202 _events.at(idxList.at(i))->distNextEvent = length;
208 for (
unsigned int i = 1; i <
_events.size() - 1; i++)
210 if (
_events.at(i)->type & eventType)
225 for (
unsigned int j = 0; j <
_events.size() - 1; j++)
238 if (j == tabIndex[k])
261 double result = v0 * v1;
262 int sign = v0.
z > 0 ? 1 : -1;
263 double angle = ::acos(result) * sign;
269 sign = v0.
y > 0 ? 1 : -1;
270 angle = ::acos(result) * sign;
271 angle = v0.
x < 0 ?
M_PI - angle : angle;
273 _events[0]->angletheta = angle;
All base classes related to 3D manipulation.
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.