Code_TYMPAN  4.2.0
Industrial site acoustic simulation
Step.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14 */
15 
21 #ifndef __STEP_H
22 #define __STEP_H
23 
26 
31 class Step
32 {
33 public :
35  Step(const vec3& Pos = vec3(0., 0., 0.), const vec3& Norme = vec3(0., 0., 0.)) : pos(Pos), norm(Norme) {}
37  Step(const Step& other) { pos = other.pos; norm = other.norm; }
39  ~Step() {}
41  static Step Ray_adapter(Ray& ray)
42  {
43  return Step( ray.getPosition(), ray.getDirection() );
44  }
45 
46 public :
49 };
50 
51 inline Step operator * (const Step& s, const decimal& a)
52 {
53  return Step(s.pos * a, s.norm * a);
54 }
55 
56 inline Step operator + (const Step& s1, const Step& s2)
57 {
58  return Step(s1.pos + s2.pos, s1.norm + s2.norm);
59 }
60 
61 #endif // __STEP_H
Step operator+(const Step &s1, const Step &s2)
Definition: Step.h:56
base_vec3< decimal > vec3
Definition: mathlib.h:269
NxReal s
Definition: NxVec3.cpp:345
vec3 norm
Step normal.
Definition: Step.h:48
3D vector Vector defined with 3 float numbers
Definition: mathlib.h:107
~Step()
Destructor.
Definition: Step.h:39
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
Definition: Ray.h:38
float decimal
Definition: mathlib.h:46
Step(const vec3 &Pos=vec3(0., 0., 0.), const vec3 &Norme=vec3(0., 0., 0.))
Default constructor.
Definition: Step.h:35
Step(const Step &other)
Copy constructor.
Definition: Step.h:37
vec3 pos
Step position.
Definition: Step.h:47
Math library.
Step operator*(const Step &s, const decimal &a)
Definition: Step.h:51
vec3 getDirection() const
Return direction of the ray.
Definition: Ray.h:301
static Step Ray_adapter(Ray &ray)
Return a step build from ray position and direction.
Definition: Step.h:41
vec3 getPosition() const
Return starting point ray.
Definition: Ray.h:308
Describe a step in the ray path.
Definition: Step.h:31